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=OLD" > 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 -b"
107 if [ -n "$compile_dir" ]
109 configure_args="$configure_args -b $compile_dir"
111 if [ -z "$compile_type" ]
113 echo "compile_type required in $paket.conf"
116 if [ "$target_type" == "FILE" ]
119 configure_args="$configure_args -V"
121 configure_args="$configure_args $paket"
122 echo "Executing ./configure $configure_args ..."
123 ./configure $configure_args
125 if [ "$compile_type" != "NONE" ]
127 if grep -- "-prepare" debian/$paket.build >/dev/null
129 echo "prepare in <paket>.build no longer supported. Use <paket>.prebuild"
139 if [ "$target_type" == "DEB" ]
141 if [ ! -f debian/$paket.cp ]
143 echo "debian/$paket.cp missing for target type DEB"
146 if [ ! -f debian/$paket.control ]
148 echo "debian/$paket.control missing for target type DEB"
152 echo "PACK=binary" >> debian/rules.pre
153 if grep "^Architecture: *all" debian/$paket.control >/dev/null
155 echo "arch = all" >> debian/rules.pre
156 echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre
158 echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre
159 echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre
161 if ! [ -f debian/$paket.changelog ]
163 echo "changelog_source = debian/default.changelog" >> debian/rules.pre
164 if [ -f debian/default.changelog ]
166 rm debian/default.changelog
169 elif [ "$target_type" == "ZIP" ]
171 echo "PACK=zip" >> debian/rules.pre
172 if [ ! -f debian/$paket.cp ]
174 echo "debian/$paket.cp missing for target type ZIP"
177 elif [ "$target_type" == "FILE" ]
179 echo "PACK=version" >> debian/rules.pre
180 if [ "$compile_type" != "OLD" ]
182 if [ -z "$compile_target" ]
184 echo "compile_target is needed for target_type FILE"
187 echo "TARGET = $compile_target" >> debian/rules.pre
190 echo "Unknown target type: $target_type"