X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=tools%2Fmake%2Fmconfigure;h=ecb35a381b82a6bb049aa3ab9b59a8ff330b9e47;hb=f98036f07e88d9bf219ef068a78250c7ed6c7938;hp=d329219f5b79ca33db3c0b818df916f7dc31c971;hpb=1dd818ead588216487bfcd91c2a7767b1bdabbe8;p=projects.git diff --git a/tools/make/mconfigure b/tools/make/mconfigure index d329219..ecb35a3 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" + if test -n "$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