5 echo "usage: mconfigure <package> [options]"
7 echo " -p : prepare build, but not do it"
17 tag=$(git describe --tags 2>/dev/null) || true
22 changes=$(git status -s |grep "^ *M") || true
32 function check_version {
33 if [ $version = "0.0" ]
37 vline=$(head -1 debian/$paket.changelog)
40 if [ "$clversion" != $version ]
42 echo "version mismatch: git: $version, changelog: $clversion"
46 # to build a package you need ...
47 # <package>.cp (optional): copy step for package production
48 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
58 echo "run mconfigure in the project base directory!"
62 echo "export paket=$1" > debian/setenv.sh
69 echo "export version=$version" >> debian/setenv.sh
70 echo "export build=$build" >> debian/setenv.sh
75 echo "export pwd=$pwd" >> debian/setenv.sh
77 echo "building $paket with build $version-$build"
80 while getopts ":ap" opt; do
86 \?) echo "Invalid option: -$OPTARG"
90 :) echo "Option -$OPTARG requires an argument."
97 ## clean dirs and check out
98 #if [ -d build -a $delete_src -eq 1 ]
104 pushd debian >/dev/null
106 ln -sf /usr/share/mbuild/rules .
112 #rm *.stamp 2>/dev/null || true
113 #rm make.pre 2>/dev/null || true
117 # load util functions for C/C++ - build
118 if [ -f $paket.cpp.sh ]
121 . projects/tools/make/c_configure.sh
125 # copy package control
126 #control=$(find .. -name $paket.control)
127 #build_number=${build#*_}
128 #if [ -z "$control" ]
130 # echo "warning: control file not found"
131 # echo " this file is necessary for any package production."
133 # sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
134 # echo "$paket.control written."
137 # version=$(grep Version $paket.control |sed "s/Version: //")
151 ## check for copy file
152 #if [ ! -f $paket.cp ]
154 # # search for copy file
155 # copy=$(find .. -name $paket.cp)
160 # echo "warning: file $paket.cp missing or not executable:"
161 # echo " this file is necessary for any package production."
165 ## check for installation scripts
166 #files=$(find .. -name $paket.preinst)
167 #files="$files $(find .. -name $paket.postinst)"
168 #files="$files $(find .. -name $paket.prerm)"
169 #files="$files $(find .. -name $paket.postrm)"
175 # create generic make.pre, if not existing
176 #if [ ! -f make.pre ]
178 # cat >>make.pre <<MAKE_PRE
179 ## mBuild make.pre script (auto generated)
185 # echo "arch = $ARCH" >>make.pre
186 # echo "_arch = _${ARCH}" >>make.pre
188 # echo "make.pre written."
191 ## append version to make.pre
192 #echo "version = $version" >> make.pre
193 #echo "build = $build" >> make.pre