# delete changelog and control
rm debian/changelog debian/control || true
- echo "paket=$paket" > debian/rules.pre
+ # mconfigure builds 2 environment files: setenv.sh + rules.pre
+ # setenv.sh is finally appended to rules.pre
+
+ dpkg-architecture > debian/setenv.sh
+ echo "" > debian/rules.pre
+
+ echo "paket=$paket" >> debian/setenv.sh
# shift
ARCH=""
cpp_build=0
set_build
check_version
- echo "version=$version" >> debian/rules.pre
- echo "build=$build" >> debian/rules.pre
+ echo "version=$version" >> debian/setenv.sh
+ echo "build=$build" >> debian/setenv.sh
# get repository name
# tmp=$(pwd)
then
echo "add_inst_tgt += debian/tmp/DEBIAN/preinst" >> rules.pre
fi
- if [ -f $paket.postinst ]
- then
- echo "add_inst_tgt += debian/tmp/DEBIAN/postinst" >> rules.pre
- fi
- if [ -f $paket.prerm ]
- then
- echo "add_inst_tgt += debian/tmp/DEBIAN/prerm" >> rules.pre
- fi
- if [ -f $paket.postrm ]
- then
- echo "add_inst_tgt += debian/tmp/DEBIAN/postrm" >> rules.pre
- fi
+ if [ -f $paket.postinst ]
+ then
+ echo "add_inst_tgt += debian/tmp/DEBIAN/postinst" >> rules.pre
+ fi
+ if [ -f $paket.prerm ]
+ then
+ echo "add_inst_tgt += debian/tmp/DEBIAN/prerm" >> rules.pre
+ fi
+ if [ -f $paket.postrm ]
+ then
+ echo "add_inst_tgt += debian/tmp/DEBIAN/postrm" >> rules.pre
+ fi
+
+ cat setenv.sh >> rules.pre
mkdir -p tmp/DEBIAN
else
echo "PACK=version" >> debian/rules.pre
fi
- cp debian/rules.pre debian/setenv.sh
fi
if [ $compile -eq 1 -a ! -e debian/$paket.build ]
dpkg-gencontrol
debian/control: debian/$(paket).control
- cp debian/$(paket).control debian/control
+ sed "s/_DEB_HOST_ARCH/${DEB_HOST_ARCH}/" debian/$(paket).control >> debian/control
debian/changelog: debian/$(paket).changelog debian/rules.pre
sed "s/%BUILD%/$(build)/" debian/$(paket).changelog > debian/changelog