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"
110 if [ -n "$old_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"
128 if [ -z "$compile_target" ]
130 echo "compile_target required in $paket.conf"
133 configure_args="$configure_args -e $compile_target"
135 if [ "$target_type" == "FILE" ]
138 configure_args="$configure_args -V"
140 configure_args="$configure_args $paket"
141 echo "Executing ./configure $configure_args ..."
142 ./configure $configure_args
144 if [ "$compile_type" != "NONE" ]
146 if grep -- "-prepare" debian/$paket.build >/dev/null
148 echo "prepare in <paket>.build no longer supported. Use <paket>.prebuild"
158 if [ "$target_type" == "DEB" ]
160 if [ ! -f debian/$paket.cp ]
162 echo "debian/$paket.cp missing for target type DEB"
165 if [ ! -f debian/$paket.control ]
167 echo "debian/$paket.control missing for target type DEB"
171 echo "PACK=binary" >> debian/rules.pre
172 if grep "^Architecture: *all" debian/$paket.control >/dev/null
174 echo "arch = all" >> debian/rules.pre
175 echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre
177 echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre
178 echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre
180 if ! [ -f debian/$paket.changelog ]
182 echo "changelog_source = debian/default.changelog" >> debian/rules.pre
183 if [ -f debian/default.changelog ]
185 rm debian/default.changelog
188 elif [ "$target_type" == "ZIP" ]
190 echo "PACK=zip" >> debian/rules.pre
191 if [ ! -f debian/$paket.cp ]
193 echo "debian/$paket.cp missing for target type ZIP"
196 elif [ "$target_type" == "FILE" ]
198 echo "PACK=version" >> debian/rules.pre
199 if [ "$compile_type" != "ANY" ]
201 if [ -z "$compile_target" ]
203 echo "compile_target is needed for target_type FILE"
206 echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre
207 if [ -n "$target_name" ]
209 echo "TARGET = $target_name" >> debian/rules.pre
211 echo "TARGET = $paket" >> debian/rules.pre
215 echo "Unknown target type: $target_type"