X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=tools%2Fmake%2Fconfigure;h=32b2558ae0838051e4c1e1dca3c7e0fecaf4c6ca;hb=4cfb387892f85b158a240b4a81dab9795ac431a6;hp=0771d5145e17bda5429a1603385f7f65943ff322;hpb=8aa3f75cc1f16a25491abc5cd8a4ed554ad26f0d;p=projects.git diff --git a/tools/make/configure b/tools/make/configure index 0771d51..32b2558 100755 --- a/tools/make/configure +++ b/tools/make/configure @@ -5,6 +5,8 @@ function echo_usage { echo "usage: configure [options]" echo " -b " echo " -a " + echo " -g " + echo " -n : do not delete src dir" } # to build a package you need ... @@ -20,13 +22,33 @@ fi paket=$1 build=$2 +shift 2 ARCH="" cpp_build=0 +alt_repos="" +delete_src=1 + +while getopts ":a:b:g:n" opt; do + case $opt in + a) ARCH=$OPTARG + ;; + b) branch=$OPTARG + ;; + g) alt_repos="-g $OPTARG" + ;; + n) delete_src=0 + ;; + \?) echo "Invalid option: -$OPTARG" + echo_usage + exit 1 + ;; + :) echo "Option -$OPTARG requires an argument." + echo_usage + exit 1 + ;; + esac +done -# checkout build utilities -if [ ! -d projects ]; then - git clone https://github.com/wagner-tech/projects/ -fi ln -sf projects/tools/make/makefile . # check standard files @@ -35,13 +57,13 @@ then echo "file $paket.co missing or not executable." exit 1 fi -if [ ! -x $paket.cp ] + +# clean dirs and check out +if [ -d src -a $delete_src -eq 1 ] then - echo "warning: file $paket.cp missing or not executable:" - echo " this file is necessary for any package production." + rm -rf src fi -# clean dirs and check out if [ -e $paket ] then rm -rf $paket @@ -54,7 +76,7 @@ cwd=$(pwd) # checkout pushd src >/dev/null - ../$paket.co $build + ../$paket.co $alt_repos $build popd >/dev/null # load util functions for C/C++ - build @@ -79,6 +101,15 @@ else version=$(grep Version $paket.control |sed "s/Version: //") fi +# check for copy file +copy=$(find src -name $paket.cp) +if [ -n "$copy" ] +then + ln -sf $copy . +else + echo "warning: file $paket.cp missing or not executable:" + echo " this file is necessary for any package production." +fi # check for postinst postinst=$(find src -name $paket.postinst) @@ -100,4 +131,5 @@ fi # append version to make.pre echo "version = $version" >> make.pre +echo "build = $build" >> make.pre