Code

Updated index.php to allow passwords with quotes.
[gosa.git] / gosa-core / contrib / make-gosa-package
index acb7c37a606147aa8678614a3d0c4db1de6b7df9..297eb5920bc2e62a5fd6f753728caa1580c83d72 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # This code is part of GOsa (http://www.gosa-project.org)
 # Copyright (C) 2008 GONICUS GmbH
 #
@@ -29,7 +29,7 @@ MAKE_GOTO=""
 GOTO=""
 PBUILDER=""
 NOT_RELEASED="heimdal dak dfs glpi apache2"
-GOTO_NOT_RELEASED="apache-directory-studio goto-cd libresourcepool-net-ldap-perl-1.002 libresourcepool-perl-1.0104 openproj ptc syslinux" 
+GOTO_NOT_RELEASED="apache-directory-studio goto-cd libresourcepool-net-ldap-perl-1.002 libresourcepool-perl-1.0104 openproj ptc syslinux konch ldm openssh-4.3p2
 DEBIAN_PKG="remove"
 NO_SVN="use"
 EXTRACT=`pwd`
@@ -51,7 +51,7 @@ usage() {
          -n|--no-svn       Don't extract gosa from svn (when internet connectivity is not present)
          -x|--extract-dir  Directory where the checkout is for no-svn
          -g|--build-goto   Build the goto2 packages
-          -l|--use-pbuilder Use pbuilder to build the packages
+         -l|--use-pbuilder Use pbuilder to build the packages
          -h|--help         this help
 
        EOF
@@ -111,11 +111,13 @@ then
        BRANCH_REV=$(LANG=C svn info gosa-info | sed -n -e 's/^Last Changed Rev: \([0-9]*\).*$/\1/p')
        rm -rf gosa-info
 
-        echo "Loading svn information for goto '${BRANCH}'..."
-        svn co -N https://oss.gonicus.de/repositories/goto/${BRANCH} goto-info/ > /dev/null
-        GOTO_BRANCH_REV=$(LANG=C svn info goto-info | sed -n -e 's/^Last Changed Rev: \([0-9]*\).*$/\1/p')
-        rm -rf goto-info
-
+       if [ "$GOTO" = "use" ]
+               then
+               echo "Loading svn information for goto '${BRANCH}'..."
+               svn co -N https://oss.gonicus.de/repositories/goto/${BRANCH} goto-info/ > /dev/null
+               GOTO_BRANCH_REV=$(LANG=C svn info goto-info | sed -n -e 's/^Last Changed Rev: \([0-9]*\).*$/\1/p')
+               rm -rf goto-info
+       fi
 else
         echo "Loading svn information for gosa '${BRANCH}' from local checkout ..."
        BRANCH_REV=$(LANG=C svn info $EXTRACT/gosa-core | sed -n -e 's/^Last Changed Rev: \([0-9]*\).*$/\1/p')
@@ -134,8 +136,19 @@ then
                | head -n 1 | sed -n -e 's/.*(\([^-]*\).*/\1/p')
        if [ "$BRANCH" == "trunk" ]; then
                GOSA_VER="${VERSION}+svn${BRANCH_REV}"
+
+               if [ "$GOTO" = "use" ]
+               then
+                       GOTO_VER="+svn${GOTO_BRANCH_REV}"
+               fi
        else
                GOSA_VER="${VERSION}"
+
+                if [ "$GOTO" = "use" ]
+                then
+                        GOTO_VER=""
+                fi
+
        fi
 
 else
@@ -222,8 +235,8 @@ then
 fi
 
 echo "Creating original sources 'gosa-${GOSA_VER}'..."
-tar -c -f "gosa_${GOSA_VER}.orig.tar" "${GOSA_DIR}"
-tar -c -f "gosa-si_${GOSA_VER}.orig.tar" "${GOSA_SI_DIR}"
+tar -c --exclude "${GOSA_DIR}"/debian -f "gosa_${GOSA_VER}.orig.tar" "${GOSA_DIR}"
+tar -c --exclude "${GOSA_SI_DIR}"/debian -f "gosa-si_${GOSA_VER}.orig.tar" "${GOSA_SI_DIR}"
 
 echo "Compressing sources..."
 gzip -f -9 "gosa_${GOSA_VER}.orig.tar"
@@ -237,6 +250,10 @@ if [ -z "$MAKE_PLUGINS" ]; then
        done
 fi
 
+if [ "TARGET_RELEASE" == "etch" ]; then
+  NOBREAKS="--no-break"
+fi
+
 for plugin in $MAKE_PLUGINS; do
 
        GOSA_PLUG_DIR="gosa-plugin-$plugin-${GOSA_VER}"
@@ -246,11 +263,11 @@ for plugin in $MAKE_PLUGINS; do
        mv "gosa-plugins-${BNAME}/$plugin" .
 
        echo "Debianizing plugin $plugin"
-       yes | dh-make-gosa --section $SECTION $plugin
+       yes | dh-make-gosa $NOBREAKS --section $SECTION $plugin
        rm -rf "$plugin"
 
        echo "Packing original sources 'gosa-plugin-$plugin-${GOSA_VER}'..."
-       tar -c -f "gosa-plugin-${plugin}_${GOSA_VER}.orig.tar" "${GOSA_PLUG_DIR}"
+       tar -c --exclude "gosa-plugin-${plugin}-${GOSA_VER}/debian" -f "gosa-plugin-${plugin}_${GOSA_VER}.orig.tar" "${GOSA_PLUG_DIR}"
 
        echo "Compressing sources..."
        gzip -f -9 "gosa-plugin-${plugin}_${GOSA_VER}.orig.tar"
@@ -266,11 +283,31 @@ then
                 MAKE_GOTO=$(echo -n $MAKE_GOTO | sed "s/$i//")
         done
 
-       for goto in $MAKE_GOTO; do
-               mv "goto-${BNAME}/$goto" .
-       done
+        for goto in $MAKE_GOTO; do
+
+                mv "goto-${BNAME}/$goto" .
+
+                echo "Packing original sources '$goto'..."
+                GOTO_VERSION=$(cat $goto/debian/changelog | head -n 1 | sed -n -e 's/.*(\([^-]*\).*/\1/p')
+
+                if [ "$GOTO_VER" = "" ]
+                then
+                       tar -c --exclude "$goto/debian" -f "${goto}_${GOTO_VERSION}.orig.tar" $goto
+                        echo "Compressing sources..."
+                        gzip -f -9 "${goto}_${GOTO_VERSION}.orig.tar"
+                else
+                       tar -c --exclude "$goto/debian" -f "${goto}_${GOTO_VERSION}${GOTO_VER}.orig.tar" $goto
+
+                       echo "Compressing svn sources..."
+                       gzip -f -9 "${goto}_${GOTO_VERSION}${GOTO_VER}.orig.tar"
+
+                       echo "Adapting version in $goto"
+                       (cd "$goto"; echo | debchange -v "${GOTO_VERSION}${GOTO_VER}-1${TARGET_RELEASE}1" -D "$TARGET_RELEASE" "$RELEASE_REASON")
+               fi
+
+        done
 
-       rm -rf goto-${BNAME}
+        rm -rf goto-${BNAME}
 fi
 
 echo "Deploying patches..."
@@ -334,13 +371,12 @@ then
        fi
 else
        echo "Creating debian packages..."
-       echo $PBUILDER
 
        for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
        if [ "$PBUILDER" = "use" ]
        then
-               echo "using pbuilder"
-               (cd "$dir"; pdebuild)
+               echo "using pbuilder to build gosa gosa-si gosa-plugins"
+               (cd "$dir"; pdebuild --debbuildopts -sa; debsign)
        else
                (cd "$dir"; dpkg-buildpackage -k$DEBSIGN_KEYID -rfakeroot -sa)
        fi
@@ -353,7 +389,7 @@ else
                if [ "$PBUILDER" = "use" ]
                then
                        echo "using pbuilder to build goto debian packages"
-                       (cd "$dir"; pdebuild)
+                       (cd "$dir"; pdebuild --debbuildopts -sa; debsign -k$DEBSIGN_KEYID)
                else
                        (cd "$dir"; dpkg-buildpackage -k$DEBSIGN_KEYID -rfakeroot -sa)
                fi