epic-ts
[projects.git] / tools / make / mconfigure
index a6e919d..4313e46 100755 (executable)
@@ -120,15 +120,21 @@ then
        # 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)
@@ -153,18 +159,20 @@ then
        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
 
@@ -226,7 +234,6 @@ then
        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 ]