epic
[projects.git] / tools / make / configure
index 31efc26..47a1304 100755 (executable)
@@ -89,12 +89,13 @@ fi
 
 # 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/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
+       sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
        echo "$paket.control written."
 
        # extract version
@@ -111,12 +112,15 @@ else
        echo "  this file is necessary for any package production."
 fi
 
-# check for postinst
-postinst=$(find -L src -name $paket.postinst)
-if [ -n "$postinst" ]
-then
-       ln -sf $postinst .
-fi
+# check for installation scripts
+files=$(find src -name $paket.preinst)
+files="$files $(find -L src -name $paket.postinst)"
+files="$files $(find -L src -name $paket.prerm)"
+files="$files $(find -L src -name $paket.postrm)"
+for file in $files
+do
+       ln -sf $file .
+done
 
 # create generic make.pre, if not existing
 if [ ! -f make.pre ]