summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d1ce57)
raw | patch | inline | side by side (parent: 2d1ce57)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Apr 2008 07:57:05 +0000 (07:57 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Apr 2008 07:57:05 +0000 (07:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10381 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/dh-make-gosa | patch | blob | history |
diff --git a/gosa-core/dh-make-gosa b/gosa-core/dh-make-gosa
index 437c274fcc852eea61ea93fd938d8293db9857e5..b6096dbae9c2dbf38f6dcebdb275249d46dcca43 100755 (executable)
--- a/gosa-core/dh-make-gosa
+++ b/gosa-core/dh-make-gosa
-#!/bin/sh
+#!/bin/bash
usage() {
echo "Usage: ${0##*/} [--download] [-b|--branch branch] [-e|--email mail] [--depends] plugin-dir|plugin.tar.gz" >&2
load_dsc() {
- if [[ -r "$1" ]]; then
+ if [ -r "$1" ]; then
PL_NAME=$(sed -n 's/"//g;s/^name\s*=\s*\(.*\)$/\1/p' "$1")
PL_VERSION=$(sed -n 's/"//g;s/^version\s*=\s*\(.*\)$/\1/p' "$1")
TDEPENDS=$(sed -n 's/"//g;s/^depends\s*=\s*\(.*\)$/\1/p' "$1")
TEMP=`getopt -o e:r: --long download,release:,email:,depends: -n 'dh-make-gosa' -- "$@"`
-if [[ $? != 0 ]] ; then
+if [ $? != 0 ] ; then
echo "Error: cannot get command line information" >&2
exit 1
fi
shift 2
;;
-r|--release)
- if [[ "$2" != "trunk" ]]; then
+ if [ "$2" != "trunk" ]; then
RELEASE=tags/$2
fi
shift 2
esac
done
-[[ $# -ne 1 ]] && usage
+[ $# -ne 1 ] && usage
file=$*
# Three possiblities
-if [[ -d "$file" ]]; then
+if [ -d "$file" ]; then
# It's a local directory
load_dsc $file/plugin.dsc
# Setup build environment
BUILD_PATH=${DEST}gosa-plugin-${PL_NAME}-${PL_VERSION}
- if [[ -d "$BUILD_PATH" ]]; then
+ if [ -d "$BUILD_PATH" ]; then
echo "Error: build path $BUILD_PATH already exists" >&2
exit 2
fi
cp -a "$PL_NAME" "$BUILD_PATH"
-elif [[ -f "$file" ]]; then
+elif [ -f "$file" ]; then
# It's a compressed user contributed file
TMPDIR="/tmp/dh-make-gosa-$PPID"
- if [[ -d "/tmp/dh-make-gosa-$PPID" ]]; then
+ if [ -d "/tmp/dh-make-gosa-$PPID" ]; then
echo "Error: directory $TMPDIR exists" >&2
exit 4
fi
# Untar
mkdir -p "$TMPDIR"
tar --extract --directory "$TMPDIR" -fz "$file" &> /dev/null
- if [[ $? -ne 0 ]]; then
+ if [ $? -ne 0 ]; then
echo "Error: cannot extract plugin file - invalid file format" >&2
exit 5
fi
echo "Author email: $PL_MAIL"
echo
read -s -n 1 -p "Do you want to continue? (y/n)" ans; echo
-[[ "$ans" != "y" ]] && exit 0
+[ "$ans" != "y" ] && exit 0
pushd . &> /dev/null
# Use gosa-plugin skelleton
echo "Calling dh_make..."
echo | dh_make -e "$PL_MAIL" -c gpl -s -n -f gosa-plugin-${PL_NAME}-${PL_VERSION}.tar.gz &> /dev/null
-if [[ $? -ne 0 ]]; then
+if [ $? -ne 0 ]; then
echo "Failed to call dh_make - aborting!"
exit 1
fi
echo "Apdapting debian descriptive files..."
+
# Generate install file
for dir in admin personal addons; do
- [[ -d $dir ]] && echo -e "$dir\t\t\t/usr/share/gosa/plugins" > debian/install
+ [ -d $dir ] && echo -e "$dir\t\t\t/usr/share/gosa/plugins" > debian/install
done
for dir in help/*; do
echo -e "$dir\t\t\t/usr/share/gosa/plugins/$PL_NAME" >> debian/install
# Generate dirs
echo "usr/share/gosa" > debian/dirs
+# If we've a contrib directory include it to the docs
+if [ -d contrib ]; then
+ echo "contrib /usr/share/doc/gosa-plugin-$PL_NAME" >> debian/install
+fi
+
# Adapt control
sed -i 's/^Section: unknown/Section: web/g' debian/control
sed -i 's/^Depends: .*$/Depends: gosa/g' debian/control
# Get apache versions running\
servers=""\
for srv in apache apache-ssl apache2; do\
- if [[ -x /usr/sbin/$srv ]]; then\
+ if [ -x /usr/sbin/$srv ]; then\
servers="$srv $servers"\
fi\
done\
\
# Finally restart servers\
for server in $servers; do\
- if [[ -x /usr/sbin/invoke-rc.d ]]; then\
+ if [ -x /usr/sbin/invoke-rc.d ]; then\
invoke-rc.d $server restart\
else\
/etc/init.d/$server restart\