X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/projects.git/blobdiff_plain/5430e52c52a1918b8b337c5ad2b9982a83097a7d..1dd818ead588216487bfcd91c2a7767b1bdabbe8:/tools/make/mconfigure diff --git a/tools/make/mconfigure b/tools/make/mconfigure index d49601e..d329219 100755 --- a/tools/make/mconfigure +++ b/tools/make/mconfigure @@ -12,10 +12,16 @@ function set_build { build=$(svnversion) elif [ -e .git ] then - build=$(git describe --tags 2>/dev/null) - test -n "$build" || build="TOP" + build=$(git describe --tags 2>/dev/null) || true + if test -z "$build" + then + build="0.0-TOP" + fi changes=$(git status -s |grep "^ *M") || true - test -z "$changes" || build="${build}M" + if test -z "$changes" + then + build="${build}M" + fi fi } @@ -29,15 +35,24 @@ then exit 1 fi -#TODO: check, if running in debian-dir +if [ ! -d debian ] +then + echo "run mconfigure in the project base directory!" + exit 2 +fi -paket=$1 +export paket=$1 shift ARCH="" cpp_build=0 -delete_src=1 set_build +export build + +# get repository name +tmp=$(pwd) +export pwd=${tmp##*/} + echo "building $paket with build $build" #while getopts ":a" opt; do @@ -61,17 +76,19 @@ echo "building $paket with build $build" # rm -rf build #fi # -#mkdir -p build -#pushd build >/dev/null -# -#ln -sf /usr/share/mbuild/makefile . -if [ -e $paket ] -then - rm -rf $paket -fi -rm *.stamp || true -rm make.pre || true +pushd debian >/dev/null + +ln -sf /usr/share/mbuild/rules . + +#if [ -e tmp ] +#then +# rm -rf tmp +#fi +#rm *.stamp 2>/dev/null || true +#rm make.pre 2>/dev/null || true + +mkdir -p tmp/DEBIAN # load util functions for C/C++ - build if [ -f $paket.cpp.sh ] @@ -82,39 +99,48 @@ then fi # copy package control -control=$(find .. -name $paket.control) -build_number=${build#*_} -if [ -z "$control" ] -then - echo "warning: control file not found" - echo " this file is necessary for any package production." -else - sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control - echo "$paket.control written." - - # extract version - version=$(grep Version $paket.control |sed "s/Version: //") -fi +#control=$(find .. -name $paket.control) +#build_number=${build#*_} +#if [ -z "$control" ] +#then +# echo "warning: control file not found" +# echo " this file is necessary for any package production." +#else +# sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control +# echo "$paket.control written." +# +# # extract version +# version=$(grep Version $paket.control |sed "s/Version: //") +#fi -# check for copy file -copy=$(find .. -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 +popd >/dev/null + +# build package +debian/rules binary -# check for installation scripts -files=$(find .. -name $paket.preinst) -files="$files $(find .. -name $paket.postinst)" -files="$files $(find .. -name $paket.prerm)" -files="$files $(find .. -name $paket.postrm)" -for file in $files -do - ln -sf $file . -done +## check for copy file +#if [ ! -f $paket.cp ] +#then +# # search for copy file +# copy=$(find .. -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 +#fi +# +## check for installation scripts +#files=$(find .. -name $paket.preinst) +#files="$files $(find .. -name $paket.postinst)" +#files="$files $(find .. -name $paket.prerm)" +#files="$files $(find .. -name $paket.postrm)" +#for file in $files +#do +# ln -sf $file . +#done # create generic make.pre, if not existing #if [ ! -f make.pre ]