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 vline=$(head -1 debian/$paket.changelog)
37 if [ $version = "0.0" ]
42 if [ "$clversion" != $version ]
44 echo "version mismatch: git: $version, changelog: $clversion"
48 # to build a package you need ...
49 # <package>.cp (optional): copy step for package production
50 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
60 echo "run mconfigure in the project base directory!"
65 echo "export paket=$1" > debian/setenv.sh
72 echo "export version=$version" >> debian/setenv.sh
73 echo "export build=$build" >> debian/setenv.sh
79 echo "export pwd=$pwd" >> debian/setenv.sh
81 echo "building $paket with build $version-$build"
84 while getopts ":ap" opt; do
90 \?) echo "Invalid option: -$OPTARG"
94 :) echo "Option -$OPTARG requires an argument."
101 ## clean dirs and check out
102 #if [ -d build -a $delete_src -eq 1 ]
108 pushd debian >/dev/null
110 ln -sf /usr/share/mbuild/rules .
116 #rm *.stamp 2>/dev/null || true
117 #rm make.pre 2>/dev/null || true
121 # load util functions for C/C++ - build
122 if [ -f $paket.cpp.sh ]
125 . projects/tools/make/c_configure.sh
131 # copy package control
132 if [ ! -f debian/control ]
134 control=$(find etc -name $paket.control)
137 echo "warning: control file not found"
138 echo " this file is necessary for any package production."
143 Maintainer: WagnerTech UG <mail@wagnertech.de>
145 grep -v "Version:" $control |grep -v "Maintainer:" >> debian/control
154 # check for copy file
155 #if [ ! -f debian/$paket.cp ]
157 # # search for copy file
158 # copy=$(find . -name $paket.cp)
161 # echo "ln -sf ../$copy debian/"
162 # ln -sf ../$copy debian/
164 # echo "warning: file $paket.cp missing or not executable:"
165 # echo " this file is necessary for any package production."
174 ## check for installation scripts
175 #files=$(find .. -name $paket.preinst)
176 #files="$files $(find .. -name $paket.postinst)"
177 #files="$files $(find .. -name $paket.prerm)"
178 #files="$files $(find .. -name $paket.postrm)"
184 # create generic make.pre, if not existing
185 #if [ ! -f make.pre ]
187 # cat >>make.pre <<MAKE_PRE
188 ## mBuild make.pre script (auto generated)
194 # echo "arch = $ARCH" >>make.pre
195 # echo "_arch = _${ARCH}" >>make.pre
197 # echo "make.pre written."
200 ## append version to make.pre
201 #echo "version = $version" >> make.pre
202 #echo "build = $build" >> make.pre