5 echo "usage: mconfigure <package> [options]"
9 echo " -p : pack default: do all"
20 tag=$(git describe --tags 2>/dev/null) || true
25 changes=$(git status -s |grep "^ *M") || true
31 version=${version##*_}
34 echo "No configuration system found. Cannot determine version."
39 function check_version {
40 vline=$(head -1 debian/$paket.changelog)
43 if [ $version = "0.0" ]
48 if [ "$clversion" != $version ]
50 echo "version mismatch: git: $version, changelog: $clversion"
54 # to build a package you need ...
55 # <package>.cp (optional): copy step for package production
56 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
66 echo "run mconfigure in the project base directory with a debian directory in it!"
76 while getopts ":acdp" opt; do
86 \?) echo "Invalid option: -$OPTARG"
90 :) echo "Option -$OPTARG requires an argument."
97 # if nothing is selected, select all
98 if [ $configure -eq 0 -a $compile -eq 0 -a $pack -eq 0 ]
105 if [ $configure -eq 1 ]
107 echo "paket=$paket" > debian/rules.pre
114 echo "version=$version" >> debian/rules.pre
115 echo "build=$build" >> debian/rules.pre
117 # get repository name
121 # echo "pwd=$pwd" >> debian/rules.pre
123 echo "building $paket with build $version-$build"
125 pushd debian >/dev/null
126 # ./debian -------------------------------------
128 ln -sf /usr/share/mbuild/rules .
135 # check for pre/post installation scripts
136 if [ -f $paket.preinst ]
138 echo "add_inst_tgt += debian/tmp/DEBIAN/preinst" >> rules.pre
140 if [ -f $paket.postinst ]
142 echo "add_inst_tgt += debian/tmp/DEBIAN/postinst" >> rules.pre
144 if [ -f $paket.prerm ]
146 echo "add_inst_tgt += debian/tmp/DEBIAN/prerm" >> rules.pre
148 if [ -f $paket.postrm ]
150 echo "add_inst_tgt += debian/tmp/DEBIAN/postrm" >> rules.pre
155 # load util functions for C/C++ - build
156 if [ -f $paket.cpp.sh ]
159 . projects/tools/make/c_configure.sh
164 # ./. ---------------------------------------------
166 # copy package control
167 if [ ! -f debian/control ]
169 control=$(find etc -name $paket.control) || true
172 echo "warning: control file not found"
173 echo " this file is necessary for any package production."
178 Maintainer: WagnerTech UG <mail@wagnertech.de>
180 grep -v "Version:" $control |grep -v "Maintainer:" >> debian/control
185 # check for copy file
186 #if [ ! -f debian/$paket.cp ]
188 # # search for copy file
189 # copy=$(find . -name $paket.cp)
192 # echo "ln -sf ../$copy debian/"
193 # ln -sf ../$copy debian/
195 # echo "warning: file $paket.cp missing or not executable:"
196 # echo " this file is necessary for any package production."
200 if [ ! -e debian/build.sh ]
202 echo "no debian/build.sh: skipping build step"
205 if [ $compile -eq 1 ]