5 echo "usage: mconfigure [options] <package>"
6 echo " -o: old style build (not recommended"
10 function create_conf {
11 if [ -f "debian/$paket.cmake" ]
13 echo "compile_type=CMAKE" > debian/$paket.conf
14 elif [ -f "debian/$paket.build" ]
16 if [ -f "debian/$paket.cpp" ]
18 echo "compile_type=CPP" > debian/$paket.conf
20 echo "compile_type=ANY" > debian/$paket.conf
23 echo "compile_type=NONE" > debian/$paket.conf
26 if [ -f "$paket.control" -a -f "$paket.cp" ]
28 echo "target_type=DEB" >> debian/$paket.conf
30 echo "target_type=FILE" >> debian/$paket.conf
32 echo "$paket.conf created."
35 ##############################################################################
37 ##############################################################################
41 echo "run mconfigure in the project base directory with a debian directory in it!"
46 configure_args="-i debian/tmp"
47 while [ $OPTIND -le "$#" ]
54 \?) $confirure_args="$configure_ars -$OPTARG"
55 if [ $OPTARG="a" -o $OPTARG="C" -o $OPTARG="i" -o $OPTARG="v" ]
58 $confirure_args="$configure_ars ${!OPTIND}"
61 :) echo "Option -$OPTARG requires an argument."
78 if [ ! -f debian/$paket.conf ]
80 # check if any files for $paket are present
81 if ! ls debian/$paket.* 2>/dev/null
83 echo "$paket is no build target in this repository."
88 echo "$paket.conf missing. We create it ..."
94 ln -s /usr/share/mbuild/configure .
97 # clean build directory
98 if [ "$compile_type" != "NONE" ]
105 configure_args="$configure_args -d ~/build"
112 rm debian/$paket.conf
115 if [ "$compile_type" != "NONE" ]
117 configure_args="$configure_args -b"
118 if [ -n "$compile_dir" ]
120 configure_args="$configure_args -d $compile_dir"
122 if [ -z "$compile_type" ]
124 echo "compile_type required in $paket.conf"
127 configure_args="$configure_args -c $compile_type"
129 if [ "$target_type" == "FILE" ]
132 configure_args="$configure_args -V"
134 configure_args="$configure_args $paket"
135 echo "Executing ./configure $configure_args ..."
136 ./configure $configure_args
138 if [ "$compile_type" != "NONE" ]
140 if grep -- "-prepare" debian/$paket.build >/dev/null
142 echo "prepare in <paket>.build no longer supported. Use <paket>.prebuild"
152 if [ "$target_type" == "DEB" ]
154 if [ ! -f debian/$paket.cp ]
156 echo "debian/$paket.cp missing for target type DEB"
159 if [ ! -f debian/$paket.control ]
161 echo "debian/$paket.control missing for target type DEB"
165 echo "PACK=binary" >> debian/rules.pre
166 if grep "^Architecture: *all" debian/$paket.control >/dev/null
168 echo "arch = all" >> debian/rules.pre
169 echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre
171 echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre
172 echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre
174 if ! [ -f debian/$paket.changelog ]
176 echo "changelog_source = debian/default.changelog" >> debian/rules.pre
177 if [ -f debian/default.changelog ]
179 rm debian/default.changelog
182 elif [ "$target_type" == "ZIP" ]
184 echo "PACK=zip" >> debian/rules.pre
185 if [ ! -f debian/$paket.cp ]
187 echo "debian/$paket.cp missing for target type ZIP"
190 elif [ "$target_type" == "FILE" ]
192 echo "PACK=version" >> debian/rules.pre
193 if [ "$compile_type" != "ANY" ]
195 if [ -z "$compile_target" ]
197 echo "compile_target is needed for target_type FILE"
200 echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre
201 if [ -n "$target_name" ]
203 echo "TARGET = $target_name" >> debian/rules.pre
205 echo "TARGET = $paket" >> debian/rules.pre
209 echo "Unknown target type: $target_type"