-# copy package control
-control=$(find -L src -name $paket.control)
-build_number=${build#*_}
-if [ -z "$control" ]
-then
- echo "warning: control file not found"
- echo " this file is necessary for any package production."
-else
- sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
- echo "$paket.control written."
-
- # extract version
- version=$(grep Version $paket.control |sed "s/Version: //")
+ ln -sf /usr/share/mbuild/rules .
+
+ #if [ -e tmp ]
+ #then
+ # rm -rf tmp
+ #fi
+ #rm *.stamp 2>/dev/null || true
+ #rm make.pre 2>/dev/null || true
+
+ mkdir -p tmp/DEBIAN
+
+ # load util functions for C/C++ - build
+ if [ -f $paket.cpp.sh ]
+ then
+ cpp_build=1
+ . projects/tools/make/c_configure.sh
+ . $paket.cpp.sh
+ fi
+
+ popd >/dev/null
+
+ # copy package control
+ if [ ! -f debian/control ]
+ then
+ control=$(find etc -name $paket.control)
+ if [ -z "$control" ]
+ then
+ echo "warning: control file not found"
+ echo " this file is necessary for any package production."
+ else
+ echo "Source: $pwd
+ Section: main
+ Priority: optional
+ Maintainer: WagnerTech UG <mail@wagnertech.de>
+ " > debian/control
+ grep -v "Version:" $control |grep -v "Maintainer:" >> debian/control
+ fi
+ fi