5 echo "usage: mconfigure [options] <package>"
10 if [ -f "debian/$paket.cmake" ]
12 echo "compile_type=CMAKE" > debian/$paket.conf
13 elif [ -f "debian/$paket.build" ]
15 if [ -f "debian/$paket.cpp" ]
17 echo "compile_type=CPP" > debian/$paket.conf
19 echo "compile_type=ANY" > debian/$paket.conf
22 echo "compile_type=NONE" > debian/$paket.conf
25 if [ -f "$paket.control" -a -f "$paket.cp" ]
27 echo "target_type=DEB" >> debian/$paket.conf
29 echo "target_type=FILE" >> debian/$paket.conf
31 echo "$paket.conf created."
34 ##############################################################################
36 ##############################################################################
40 echo "run mconfigure in the project base directory with a debian directory in it!"
45 configure_args="-i debian/tmp"
46 while [ $OPTIND -le "$#" ]
51 \?) $confirure_args="$configure_ars -$OPTARG"
52 if [ $OPTARG="a" -o $OPTARG="C" -o $OPTARG="i" -o $OPTARG="v" ]
55 $confirure_args="$configure_ars ${!OPTIND}"
58 :) echo "Option -$OPTARG requires an argument."
75 if [ ! -f debian/$paket.conf ]
77 # check if any files for $paket are present
78 if ! ls debian/$paket.* 2>/dev/null
80 echo "$paket is no build target in this repository."
85 echo "$paket.conf missing. We create it ..."
91 ln -s /usr/share/mbuild/configure .
94 # clean build directory
95 if [ "$compile_type" != "NONE" ]
102 configure_args="$configure_args -d ~/build"
107 if [ "$compile_type" != "NONE" ]
109 configure_args="$configure_args -b"
110 if [ -n "$compile_dir" ]
112 configure_args="$configure_args -d $compile_dir"
114 if [ -z "$compile_type" ]
116 echo "compile_type required in $paket.conf"
120 if [ "$target_type" == "FILE" ]
123 configure_args="$configure_args -V"
125 configure_args="$configure_args $paket"
126 echo "Executing ./configure $configure_args ..."
127 ./configure $configure_args
129 if [ "$compile_type" != "NONE" ]
131 if grep -- "-prepare" debian/$paket.build >/dev/null
133 echo "prepare in <paket>.build no longer supported. Use <paket>.prebuild"
143 if [ "$target_type" == "DEB" ]
145 if [ ! -f debian/$paket.cp ]
147 echo "debian/$paket.cp missing for target type DEB"
150 if [ ! -f debian/$paket.control ]
152 echo "debian/$paket.control missing for target type DEB"
156 echo "PACK=binary" >> debian/rules.pre
157 if grep "^Architecture: *all" debian/$paket.control >/dev/null
159 echo "arch = all" >> debian/rules.pre
160 echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre
162 echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre
163 echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre
165 if ! [ -f debian/$paket.changelog ]
167 echo "changelog_source = debian/default.changelog" >> debian/rules.pre
168 if [ -f debian/default.changelog ]
170 rm debian/default.changelog
173 elif [ "$target_type" == "ZIP" ]
175 echo "PACK=zip" >> debian/rules.pre
176 if [ ! -f debian/$paket.cp ]
178 echo "debian/$paket.cp missing for target type ZIP"
181 elif [ "$target_type" == "FILE" ]
183 echo "PACK=version" >> debian/rules.pre
184 if [ "$compile_type" != "ANY" ]
186 if [ -z "$compile_target" ]
188 echo "compile_target is needed for target_type FILE"
191 echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre
192 if [ -n "$target_name" ]
194 echo "TARGET = $target_name" >> debian/rules.pre
196 echo "TARGET = $paket" >> debian/rules.pre
200 echo "Unknown target type: $target_type"