]> wagnertech.de Git - projects.git/blobdiff - tools/make/mconfigure
posaune
[projects.git] / tools / make / mconfigure
index 7b6db959340b4567032035cff2416a373097d939..a6e919d46a75b6923a2e73bf4077d811b7d2fbb8 100755 (executable)
@@ -22,6 +22,11 @@ function set_build {
                then
                        tag="0.0-TOP"
                fi
+               tag_paket=${tag%_*}
+               if [ "$tag_paket" != "$paket" ]
+               then
+                       tag="0.0-TOP"
+               fi
                changes=$(git status -s |grep "^ *M") || true
                if test -n "$changes"
                then
@@ -37,6 +42,7 @@ function set_build {
 }
 
 function check_version {
+       
        vline=$(head -1 debian/$paket.changelog)
        vline=${vline%-*}
        clversion=${vline#*(}
@@ -45,6 +51,13 @@ function check_version {
                version=$clversion
                return
        fi
+
+       # do no check on a modified git repos
+       if [ "${build: -1}" == "M" ]
+       then
+               return
+       fi
+
        if [ "$clversion" != $version ]
        then
                echo "version mismatch: git: $version, changelog: $clversion"
@@ -104,6 +117,9 @@ fi
 
 if [ $configure -eq 1 ]
 then
+       # delete changelog and control
+       rm debian/changelog debian/control || true
+       
        echo "paket=$paket" > debian/rules.pre
 #      shift
        ARCH=""
@@ -164,40 +180,56 @@ then
        # ./. ---------------------------------------------
 
        # copy package control
-       if [ ! -f debian/control ]
+       if [ -f debian/$paket.control ]
        then
+               # proceed
+               echo
+       else
+               # try old fashoned way
                control=$(find etc -name $paket.control) || true
                if [ -z "$control" ]
                then
                        echo "warning: control file not found"
                        echo "  this file is necessary for any package production."
                else    
-                       echo "Source: $pwd
+                       echo "Source: $paket
        Section: main
        Priority: optional
        Maintainer: WagnerTech UG <mail@wagnertech.de>
-       " > debian/control
-                       grep -v "Version:" $control |grep -v "Maintainer:" >> debian/control 
+       " > debian/$paket.control
+                       grep -v "Version:" $control |grep -v "Maintainer:" >> debian/$paket.control 
                fi
        fi
+       
+       # build prepare
+       if [ -e debian/$paket.build ]
+       then
+               if [ -e ../build ]
+               then
+                       rm -rf ../build
+                       mkdir ../build
+               fi
+               if grep -- "-prepare" debian/$paket.build >/dev/null
+               then
+                       debian/rules sync
+                       debian/$paket.build -prepare
+               fi
+       fi
+       
+       # pack prepare
+       if [ -f debian/$paket.cp -a -f debian/$paket.control ]
+       then
+               echo "PACK=binary" >> debian/rules.pre
+       elif [ -f debian/$paket.cp ]
+       then
+               echo "PACK=zip" >> debian/rules.pre
+       else
+               echo "PACK=version" >> debian/rules.pre
+       fi
+       cp debian/rules.pre debian/setenv.sh
 fi
 
-# check for copy file
-#if [ ! -f debian/$paket.cp ]
-#then
-#      # search for copy file
-#      copy=$(find . -name $paket.cp)
-#      if [ -n "$copy" ]
-#      then
-#              echo "ln -sf ../$copy debian/"
-#              ln -sf ../$copy debian/
-#      else
-#              echo "warning: file $paket.cp missing or not executable:"
-#              echo "  this file is necessary for any package production."
-#      fi
-#fi
-
-if [ ! -e debian/build.sh ]
+if [ $compile -eq 1 -a ! -e debian/$paket.build ]
 then
        echo "no debian/build.sh: skipping build step"
        compile=0
@@ -205,12 +237,14 @@ fi
 if [ $compile -eq 1 ]
 then
        # build artefacts
+       . debian/setenv.sh
        debian/rules build
 fi
 
 if [ $pack -eq 1 ]
 then
        # build package
-       debian/rules binary
+       . debian/setenv.sh
+       debian/rules pack
 fi