5 echo "usage: mconfigure <package> [options]"
7 echo " -p : prepare build, but not do it"
18 tag=$(git describe --tags 2>/dev/null) || true
23 changes=$(git status -s |grep "^ *M") || true
33 function check_version {
34 if [ $version = "0.0" ]
38 vline=$(head -1 debian/$paket.changelog)
41 if [ "$clversion" != $version ]
43 echo "version mismatch: git: $version, changelog: $clversion"
47 # to build a package you need ...
48 # <package>.cp (optional): copy step for package production
49 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
59 echo "run mconfigure in the project base directory!"
63 echo "export paket=$1" > debian/setenv.sh
70 echo "export version=$version" >> debian/setenv.sh
71 echo "export build=$build" >> debian/setenv.sh
77 echo "export pwd=$pwd" >> debian/setenv.sh
79 echo "building $paket with build $version-$build"
82 while getopts ":ap" opt; do
88 \?) echo "Invalid option: -$OPTARG"
92 :) echo "Option -$OPTARG requires an argument."
99 ## clean dirs and check out
100 #if [ -d build -a $delete_src -eq 1 ]
106 pushd debian >/dev/null
108 ln -sf /usr/share/mbuild/rules .
114 #rm *.stamp 2>/dev/null || true
115 #rm make.pre 2>/dev/null || true
119 # load util functions for C/C++ - build
120 if [ -f $paket.cpp.sh ]
123 . projects/tools/make/c_configure.sh
129 # copy package control
130 if [ ! -f debian/control ]
132 control=$(find etc -name $paket.control)
135 echo "warning: control file not found"
136 echo " this file is necessary for any package production."
141 Maintainer: WagnerTech UG <mail@wagnertech.de>
143 grep -v "Version:" $control |grep -v "Maintainer:" >> debian/control
152 # check for copy file
153 #if [ ! -f debian/$paket.cp ]
155 # # search for copy file
156 # copy=$(find . -name $paket.cp)
159 # echo "ln -sf ../$copy debian/"
160 # ln -sf ../$copy debian/
162 # echo "warning: file $paket.cp missing or not executable:"
163 # echo " this file is necessary for any package production."
172 ## check for installation scripts
173 #files=$(find .. -name $paket.preinst)
174 #files="$files $(find .. -name $paket.postinst)"
175 #files="$files $(find .. -name $paket.prerm)"
176 #files="$files $(find .. -name $paket.postrm)"
182 # create generic make.pre, if not existing
183 #if [ ! -f make.pre ]
185 # cat >>make.pre <<MAKE_PRE
186 ## mBuild make.pre script (auto generated)
192 # echo "arch = $ARCH" >>make.pre
193 # echo "_arch = _${ARCH}" >>make.pre
195 # echo "make.pre written."
198 ## append version to make.pre
199 #echo "version = $version" >> make.pre
200 #echo "build = $build" >> make.pre