index ffdf3c9ffbd3a64dda16652ecc58fc217de56948..ae4199ed6d02e542d702a1ae4cf9ffb9a0fd7610 100755 (executable)
-#!/bin/bash
+#!/bin/sh
# This code is part of GOsa (http://www.gosa-project.org)
# Copyright (C) 2008 GONICUS GmbH
#
# This code is part of GOsa (http://www.gosa-project.org)
# Copyright (C) 2008 GONICUS GmbH
#
-c|--changelog Debian changelog entry [$RELEASE_REASON]
-s|--section Debian section to place GOsa in [$SECTION]
-i|--si-section Debian section to place GOsa-SI in [$SI_SECTION]
-c|--changelog Debian changelog entry [$RELEASE_REASON]
-s|--section Debian section to place GOsa in [$SECTION]
-i|--si-section Debian section to place GOsa-SI in [$SI_SECTION]
+ -d|--debian-pkg Don't clear up debian packages for plugins (for developers only)
-h|--help this help
EOF
exit 1
}
-h|--help this help
EOF
exit 1
}
+for cmd in dh-make-gosa debchange dpkg-buildpackage dpkg-source svn; do
+ if ! which $cmd >/dev/null; then
+ echo "Error: cannot find '$cmd' command in path!";
+ exit 1
+ fi
+done
+
# Import command line parameters
# Import command line parameters
-PARMS=`getopt -o brscip:,h --long branch,changelog,plugins,section,si-section,release:,help -n "${0##*/}" -- "$@"`
+PARMS=`getopt -o d::b:r:s:c:i:p:,h --long branch:,changelog:,plugins:,section:,si-section:,release:,help -n "${0##*/}" -- "$@"`
eval set -- "$PARMS"
while true; do
eval set -- "$PARMS"
while true; do
-c|--changelog)
RELEASE_REASON=$2; shift 2 ;;
-p|--plugins)
-c|--changelog)
RELEASE_REASON=$2; shift 2 ;;
-p|--plugins)
- MAKE_PLUGINS=${2//,/ }; shift 2 ;;
+ MAKE_PLUGINS=$(echo $2 | tr ',' ' '); shift 2 ;;
-s|--section)
SECTION=$2; shift 2 ;;
-i|--si-section)
SI_SECTION=$2; shift 2 ;;
-s|--section)
SECTION=$2; shift 2 ;;
-i|--si-section)
SI_SECTION=$2; shift 2 ;;
+ -d|--debian-pkg)
+ DEBIAN_PKG=$2; shift 2 ;;
-h|--help)
usage ;;
--)
-h|--help)
usage ;;
--)
esac
done
esac
done
-echo $BRANCH
-exit 0
-
[ $BRANCH = "trunk" ] || BRANCH="branches/$BRANCH"
echo "Loading svn information for '${BRANCH}'..."
svn co -N https://oss.gonicus.de/repositories/gosa/${BRANCH} gosa-info/ > /dev/null
[ $BRANCH = "trunk" ] || BRANCH="branches/$BRANCH"
echo "Loading svn information for '${BRANCH}'..."
svn co -N https://oss.gonicus.de/repositories/gosa/${BRANCH} gosa-info/ > /dev/null
tar -c -f "gosa-si_${GOSA_VER}.orig.tar" "${GOSA_SI_DIR}"
echo "Compressing sources..."
tar -c -f "gosa-si_${GOSA_VER}.orig.tar" "${GOSA_SI_DIR}"
echo "Compressing sources..."
-gzip -9 "gosa_${GOSA_VER}.orig.tar"
-gzip -9 "gosa-si_${GOSA_VER}.orig.tar"
+gzip -f -9 "gosa_${GOSA_VER}.orig.tar"
+gzip -f -9 "gosa-si_${GOSA_VER}.orig.tar"
export OVERRIDE_VERSION="$GOSA_VER"
if [ -z "$MAKE_PLUGINS" ]; then
export OVERRIDE_VERSION="$GOSA_VER"
if [ -z "$MAKE_PLUGINS" ]; then
mv "gosa-plugins-${BRANCH}/$plugin" .
echo "Debianizing plugin $plugin"
mv "gosa-plugins-${BRANCH}/$plugin" .
echo "Debianizing plugin $plugin"
- yes | dh-make-gosa --section web $plugin
+ yes | dh-make-gosa --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}"
echo "Compressing sources..."
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}"
echo "Compressing sources..."
- gzip -9 "gosa-plugin-${plugin}_${GOSA_VER}.orig.tar"
+ gzip -f -9 "gosa-plugin-${plugin}_${GOSA_VER}.orig.tar"
done
rm -rf gosa-plugins-${BRANCH}
done
rm -rf gosa-plugins-${BRANCH}
done
for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
echo "Adapting version in $dir"
done
for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
echo "Adapting version in $dir"
- (cd "$dir"; echo | debchange -v "${GOSA_VER}-1${TARGET_RELEASE}1" -D "$TARGET_RELEASE" "$RELEASE_REASON" &> /dev/null)
+ (cd "$dir"; echo | debchange -v "${GOSA_VER}-1${TARGET_RELEASE}1" -D "$TARGET_RELEASE" "$RELEASE_REASON" >/dev/null 2>&1)
[ -d $dir/debian/patches ] || continue
echo "Creating patch list for $dir"
ls -1 $dir/debian/patches | grep -v 00list | sed 's%^.*/%%g' > $dir/debian/patches/00list
[ -d $dir/debian/patches ] || continue
echo "Creating patch list for $dir"
ls -1 $dir/debian/patches | grep -v 00list | sed 's%^.*/%%g' > $dir/debian/patches/00list
fi
echo "Removing gosa snapshot..."
fi
echo "Removing gosa snapshot..."
-for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
+if [ -z "$DEBIAN_PKG" ]
+then
+ for dir in $GOSA_DIR; do
+ rm -rf "$dir"
+ done
+else
+ for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
rm -rf "$dir"
rm -rf "$dir"
-done
+ done
+fi
+