From 8f9ac18ce143b85eb5a200913e9544e7e0ef2f4b Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Tue, 17 Apr 2018 22:23:07 +0200 Subject: [PATCH] phpide --- debian/control | 2 +- debian/mbuild.changelog | 6 ++++ tools/make/mconfigure | 78 ++++++++++++++++++++++++++++------------- tools/make/rules | 16 ++++----- 4 files changed, 69 insertions(+), 33 deletions(-) create mode 100644 debian/mbuild.changelog diff --git a/debian/control b/debian/control index baf5d7d..4034bfd 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: projects Section: main Priority: optional -Maintainer: Michael Wagner +Maintainer: Michael Wagner Build-Depends: git Package: mbuild diff --git a/debian/mbuild.changelog b/debian/mbuild.changelog new file mode 100644 index 0000000..f684a91 --- /dev/null +++ b/debian/mbuild.changelog @@ -0,0 +1,6 @@ +projects (0.1-%BUILD%) unstable; urgency=medium + + * Build in neuer git-Umgebung + + -- Michael Wagner Mon, 12 Feb 2018 09:45:25 +0100 + diff --git a/tools/make/mconfigure b/tools/make/mconfigure index d329219..3bca62a 100755 --- a/tools/make/mconfigure +++ b/tools/make/mconfigure @@ -4,27 +4,45 @@ set -e function echo_usage { echo "usage: mconfigure [options]" echo " -a " + echo " -p : prepare build, but not do it" } function set_build { if [ -e .svn ] then + version="0.0" build=$(svnversion) elif [ -e .git ] then - build=$(git describe --tags 2>/dev/null) || true - if test -z "$build" + tag=$(git describe --tags 2>/dev/null) || true + if test -z "$tag" then - build="0.0-TOP" + tag="0.0-TOP" fi changes=$(git status -s |grep "^ *M") || true if test -z "$changes" then - build="${build}M" + tag="${tag}M" fi + version=${tag%-*} + build=${tag#*-} fi } +function check_version { + if [ $version = "0.0" ] + then + return + fi + vline=$(head -1 debian/$paket.changelog) + vline=${vline%-*} + clversion=${vline#*(} + if [ "$clversion" != $version ] + then + echo "version mismatch: git: $version, changelog: $clversion" + exit 1 + fi +} # to build a package you need ... # .cp (optional): copy step for package production # .cpp.sh (optional): commands to setup the C++ compile environment @@ -41,34 +59,40 @@ then exit 2 fi -export paket=$1 +echo "export paket=$1" > debian/setenv.sh shift ARCH="" cpp_build=0 set_build -export build +check_version +echo "export version=$version" >> debian/setenv.sh +echo "export build=$build" >> debian/setenv.sh # get repository name tmp=$(pwd) -export pwd=${tmp##*/} - -echo "building $paket with build $build" - -#while getopts ":a" opt; do -# case $opt in -# a) ARCH=$OPTARG -# ;; -# \?) echo "Invalid option: -$OPTARG" -# echo_usage -# exit 1 -# ;; -# :) echo "Option -$OPTARG requires an argument." -# echo_usage -# exit 1 -# ;; -# esac -#done +pwd=${tmp##*/} +echo "export pwd=$pwd" >> debian/setenv.sh + +echo "building $paket with build $version-$build" + +prepare=0 +while getopts ":ap" opt; do + case $opt in + a) ARCH=$OPTARG + ;; + p) prepare=1 + ;; + \?) echo "Invalid option: -$OPTARG" + echo_usage + exit 1 + ;; + :) echo "Option -$OPTARG requires an argument." + echo_usage + exit 1 + ;; + esac +done # ## clean dirs and check out #if [ -d build -a $delete_src -eq 1 ] @@ -115,7 +139,13 @@ fi popd >/dev/null +if [ $prepare = 1 ] +then + exit 0 +fi + # build package +. debian/setenv.sh debian/rules binary ## check for copy file diff --git a/tools/make/rules b/tools/make/rules index 68ba315..d61e224 100755 --- a/tools/make/rules +++ b/tools/make/rules @@ -12,7 +12,6 @@ default: # Löschen aller kompilierten, erzeugten und nicht benötigten Dateien im Bauverzeichnis clean: -rm -rf debian/tmp - -rm debian/changelog # Bauen der kompilierten Programme und formatierten Dokumente aus den Quellen im Bauverzeichnis build: @@ -33,22 +32,23 @@ binary: debian/tmp/DEBIAN/control binary-arch binary-indep binary-arch: # Erstellen Architektur-unabhängiger (Architecture: all) Binärpakete im übergeordneten Verzeichnis -binary-indep: copy ../$(paket)_$(build)$(_arch).deb +binary-indep: copy ../$(paket)_$(version)-$(build)$(_arch).deb copy: debian/$(paket).cp debian/$(paket).cp debian/tmp -../$(paket)_$(build)$(_arch).deb: +../$(paket)_$(version)-$(build)$(_arch).deb: $(DEB) - mv debian/tmp.deb ../$(paket)_$(build)$(_arch).deb + mv debian/tmp.deb ../$(paket)_$(version)-$(build)$(_arch).deb debian/tmp/DEBIAN/control: debian/control debian/changelog dpkg-gencontrol -debian/changelog: - echo "${pwd} (${build}) unstable; urgency=medium" > debian/changelog - echo " * generated by mbuild" >> debian/changelog - echo " -- Michael Wagner Sun, 11 Feb 2018 20:03:04 +0100" >> debian/changelog +debian/changelog: debian/$(paket).changelog + sed "s/%BUILD%/$(build)/" debian/$(paket).changelog > debian/changelog +# echo "${pwd} (${build}) unstable; urgency=medium" > debian/changelog +# echo " * generated by mbuild" >> debian/changelog +# echo " -- Michael Wagner Sun, 11 Feb 2018 20:03:04 +0100" >> debian/changelog # mb_create_changelog # Load project specification -- 2.20.1