Code

Updated apache stuff - Works, but not cleanup.
[gosa.git] / gosa-core / dh-make-gosa
index ded67ec9064372c384043457e810d425fee98a32..4d9dfb705e516391aa677630744114fe01babf1e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 usage() {
-  echo "Usage: ${0##*/} [--download] [-b|--branch branch] [-e|--email mail] [--depends] plugin-dir|plugin.tar.gz" >&2
+  echo "Usage: ${0##*/} [--download] [--section section name] [-b|--branch branch] [-e|--email mail] [--depends] plugin-dir|plugin.tar.gz" >&2
   exit 1
 }
 
@@ -14,6 +14,10 @@ load_dsc() {
     for dep in $TDEPENDS; do
       PL_DEPENDS="gosa-plugin-$dep, $PL_DEPENDS"
     done
+    TCONFLICTS=$(sed -n 's/"//g;s/^conflicts\s*=\s*\(.*\)$/\1/p' "$1")
+    for dep in $TCONFLICTS; do
+      PL_CONFLICTS="gosa-plugin-$dep, $PL_CONFLICTS"
+    done
     PL_DESCRIPTION=$(sed -n 's/"//g;s/^description\s*=\s*\(.*\)$/\1/p' "$1")
     PL_AUTHOR=$(sed -n 's/"//g;s/^author\s*=\s*\([^<]*\).*$/\1/p' "$1")
     PL_MAIL=$(sed -n 's/"//g;s/^author\s*=[^<].*<\([^>]*\).*$/\1/p' "$1")
@@ -24,7 +28,7 @@ load_dsc() {
 }
 
 
-TEMP=`getopt -o e:r: --long download,release:,email:,depends: -n 'dh-make-gosa' -- "$@"`
+TEMP=`getopt -o e:r: --long download,release:,email:,depends:,section: -n 'dh-make-gosa' -- "$@"`
 if [ $? != 0 ] ; then
   echo "Error: cannot get command line information" >&2
   exit 1
@@ -36,6 +40,7 @@ eval set -- "$TEMP"
 RELEASE=trunk
 DOWNLOAD=
 DEPENDS=
+SECTION=web
 DEST=
 while true; do
   case "$1" in
@@ -51,6 +56,9 @@ while true; do
     --depends)  DEPENDS="$2"
                 shift 2
                 ;;
+    --section)  SECTION="$2"
+                shift 2
+                ;;
     --dest)     DEST=$2/
                 shift 2
                 ;;
@@ -124,6 +132,7 @@ echo "Plugin:       $PL_NAME"
 echo "Version:      $PL_VERSION"
 echo "Description:  $PL_DESCRIPTION"
 echo "Depends:      $PL_DEPENDS"
+echo "Conflicts:    $PL_CONFLICTS"
 echo "Author name:  $PL_AUTHOR"
 echo "Author email: $PL_MAIL"
 echo
@@ -145,7 +154,7 @@ fi
 echo "Apdapting debian descriptive files..."
 
 # Generate install file
-for dir in admin personal addons; do
+for dir in admin personal addons gofax gofon generic; do
        [ -d $dir ] && echo -e "$dir\t\t\t/usr/share/gosa/plugins" >> debian/install
 done
 for dir in help/*; do
@@ -178,9 +187,16 @@ sed -i "/.put author's name and email here.\
 sed -i '/^Upstream/,/^$/d' debian/copyright
 
 # Adapt control
-sed -i 's/^Section: unknown/Section: web/g' debian/control
+sed -i "s#^Section: unknown#Section: $SECTION#g" debian/control
 sed -i 's/^Architecture: any/Architecture: all/g' debian/control
-sed -i 's/^Depends: .*$/Depends: gosa/g' debian/control
+if [ "$PL_DEPENDS" ]; then
+       sed -i "s/^Depends: .*$/Depends: gosa, $PL_DEPENDS/g" debian/control
+else
+       sed -i 's/^Depends: .*$/Depends: gosa/g' debian/control
+fi
+if [ "$PL_CONFLICTS" ]; then
+       sed "11Conflicts: $PL_CONFLICTS" debian/control
+fi
 sed -i 's/^\(Build-Depends: .*\)$/\1, dpatch/g' debian/control
 sed -i "s/^Description: .*$/Description: $PL_NAME plugin for GOsa/g" debian/control
 sed -i "s/^ <.*$/ %DESCRIPTION%/g" debian/control