summaryrefslogtreecommitdiff
path: root/install-kolab.sh
diff options
context:
space:
mode:
authorChristoph Wickert <wickert@kolabsys.com>2010-12-12 22:58:27 (GMT)
committerChristoph Wickert <wickert@kolabsys.com>2010-12-12 22:58:27 (GMT)
commit8a9a1918bc5c81cc8df9d251ee9ebcc2b90c4f0a (patch)
tree779333635952ce3b792e3188ff89f342961244eb /install-kolab.sh
parent5f5b2851b46dd2c4b2ec7380fa165e029e789118 (diff)
downloadserver-8a9a1918bc5c81cc8df9d251ee9ebcc2b90c4f0a.tar.gz
Update install-kolab.sh from 2.2.4 branch
Diffstat (limited to 'install-kolab.sh')
-rwxr-xr-xinstall-kolab.sh141
1 files changed, 77 insertions, 64 deletions
diff --git a/install-kolab.sh b/install-kolab.sh
index 57d905d..d464aaf 100755
--- a/install-kolab.sh
+++ b/install-kolab.sh
@@ -2,7 +2,7 @@
#
# $Id$
#
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009, 2010 by Intevation GmbH
# Copyright (C) 2007 by Gunnar Wrobel
#
# Authors:
@@ -12,15 +12,16 @@
#
# This program is free software under the GNU GPL (>=v2)
-KOLAB_VERSION="2.2.3+CVS"
+KOLAB_VERSION="2.2.4"
KID="19414"
TAG="kolab"
USER=""
PREFIX=""
+UNIQEXT="$RANDOM.$RANDOM.$RANDOM.$$"
PACKAGES="openpkg-tools openldap postfix kolabd kolab-webadmin kolab-fbview kolab-webclient"
-DEFINE="-D openldap::with_pth=no -D sasl::with_ldap -D sasl::with_login -D sasl::with_ntlm -D postfix::with_sasl -D postfix::with_ssl -D postfix::with_ldap -D imapd::with_kolab_nocaps"
+DEFINE="-D openldap::with_pth=no -D sasl::with_ldap -D sasl::with_login -D sasl::with_ntlm -D postfix::with_sasl -D postfix::with_ssl -D postfix::with_ldap -D imapd::with_kolab_nocaps -D imapd::with_crossdomain_acl -D kolab-webclient::with_activesync=no"
EXCLUDEPKGS=""
#Flags
@@ -71,7 +72,7 @@ else
fi
mktmpdir() {
- newtmp="${TMPDIR-/tmp}/install-kolab.$RANDOM.$RANDOM.$RANDOM.$$"
+ newtmp="${TMPDIR-/tmp}/install-kolab.$UNIQEXT"
mkdir "$newtmp" || {
echo "Could not create temporary directory! Exiting." 1>&2
exit 1
@@ -79,6 +80,16 @@ mktmpdir() {
echo "$newtmp"
}
+mkpkgbackup() {
+ pkgbackup="$1.$UNIQEXT"
+ mkdir "$pkgbackup" || {
+ echo "Could not create PKG backup directory! Exiting." 1>&2
+ exit 1
+ }
+ mv "$1/"* "$pkgbackup"
+ echo "$pkgbackup"
+}
+
shtool_get_plattag() {
[ -f shtool ] || sh "$INSTALLER" -t | tar xf - shtool
echo `sh shtool platform --type=binary`-$TAG
@@ -201,6 +212,13 @@ if [ "$FLAG_CLEAN" -o "$FLAG_INDEX" ]; then
fi
fi
+umask 022
+SRCDIR=`pwd`
+WORKDIR=`mktmpdir`
+echo "Changing to temporary working directory $WORKDIR ..."
+cd "$WORKDIR"
+populate_workdir
+
echo
echo "Kolab installation tag (TAG): $TAG"
echo "Kolab installation prefix (PREFIX): $PREFIX"
@@ -212,73 +230,62 @@ echo "Kolab non-priviledged UID (KID): $N_KID"
echo "Exclude following Kolab packages: $EXCLUDEPKGS"
echo
-prefix_openpkg_determine_action() {
- umask 022
- SRCDIR=`pwd`
- WORKDIR=`mktmpdir`
- echo "Changing to temporary working directory $WORKDIR ..."
- cd "$WORKDIR"
- populate_workdir
-
- echo "Received no instructions. Trying to determine required action..."
- if [ -d "$PREFIX/etc/openpkg" -a -z "$FLAG_BOOTSTRAP" ]; then
+echo "Received no instructions. Trying to determine required action..."
+if [ -d "$PREFIX/etc/openpkg" -a -z "$FLAG_BOOTSTRAP" ]; then
# Assume an upgrade based on the current directory
- INSTALL=`pwd`
- if [ "$FLAG_ENV" ]; then
- echo "The OpenPKG environment already exists!"
- exit 1
- fi
- echo "Found an OpenPKG environment. Assuming upgrade..."
- else
- INSTALLER=`find . $FIND1 -name "openpkg-*.src.sh" -print`
- BINARY=`find . $FIND1 -name "openpkg-*.sh" \! -name "openpkg-*.src.sh" -print`
- if [ -z "$INSTALLER" ]; then
+ INSTALL=`pwd`
+ if [ "$FLAG_ENV" ]; then
+ echo "The OpenPKG environment already exists!"
+ exit 1
+ fi
+ echo "Found an OpenPKG environment. Assuming upgrade..."
+else
+ INSTALLER=`find . $FIND1 -name "openpkg-*.src.sh" -print`
+ BINARY=`find . $FIND1 -name "openpkg-*.sh" \! -name "openpkg-*.src.sh" -print`
+ if [ -z "$INSTALLER" ]; then
# No install script? Determine if there is a binary script
- if [ -z "$BINARY" ]; then
- echo "Sorry there is no OpenPKG installation script in the current directory!"
- usage
- exit 0
- else
+ if [ -z "$BINARY" ]; then
+ echo "Sorry there is no OpenPKG installation script in the current directory!"
+ usage
+ exit 0
+ else
# Looks like we only have a binary. Hope that it matches the plattform and install it
- INSTALL="$BINARY"
- echo "Found a binary OpenPKG package. This will be installed now."
- fi
- else
+ INSTALL="$BINARY"
+ echo "Found a binary OpenPKG package. This will be installed now."
+ fi
+ else
# We have a source package. Check for a matching binary
- PLATTAG=`shtool_get_plattag`
- BIN=`basename "$INSTALLER" .src.sh`.$PLATTAG.sh
- if [ "$BINARY" = "$BIN" ]; then
+ PLATTAG=`shtool_get_plattag`
+ BIN=`basename "$INSTALLER" .src.sh`.$PLATTAG.sh
+ if [ "$BINARY" = "$BIN" ]; then
# There is a binary with the correct tag. Install it
- INSTALL=$BIN
- echo "Found a binary OpenPKG package with a correct tag. This will be installed now."
- else
+ INSTALL=$BIN
+ echo "Found a binary OpenPKG package with a correct tag. This will be installed now."
+ else
# Install from source
- INSTALL=$INSTALLER
- echo "Found a source based OpenPKG installer. Trying to install Kolab from source."
- fi
- fi
+ INSTALL=$INSTALLER
+ echo "Found a source based OpenPKG installer. Trying to install Kolab from source."
+ fi
fi
+fi
- if echo "$INSTALL" | grep '\.src\.sh$' >/dev/null; then
+if echo "$INSTALL" | grep '\.src\.sh$' >/dev/null; then
# install from source
- SRC="$INSTALL"
- PLATTAG=`shtool_get_plattag`
- BIN=`basename "$INSTALL" .src.sh`.$PLATTAG.sh
- DIR=`dirname "$SRC"`
- elif echo "$INSTALL" | grep 'openpkg-.*\.sh$' >/dev/null; then
+ SRC="$INSTALL"
+ PLATTAG=`shtool_get_plattag`
+ BIN=`basename "$INSTALL" .src.sh`.$PLATTAG.sh
+ DIR=`dirname "$SRC"`
+elif echo "$INSTALL" | grep 'openpkg-.*\.sh$' >/dev/null; then
# install from binary
- SRC=""
- BIN="$INSTALL"
- DIR=`dirname "$BIN"`
- elif [ -d "$PREFIX/etc/openpkg" ]; then
+ SRC=""
+ BIN="$INSTALL"
+ DIR=`dirname "$BIN"`
+elif [ -d "$PREFIX/etc/openpkg" ]; then
# upgrade
- SRC=""
- BIN=""
- DIR="$INSTALL"
- fi
-}
-
-prefix_openpkg_determine_action
+ SRC=""
+ BIN=""
+ DIR="$INSTALL"
+fi
DIR=`cd $DIR; pwd`
@@ -309,6 +316,10 @@ if [ -n "$BIN" ]; then
fi
if [ -n "$DIR" ]; then
+ PKGDIR="$PREFIX/RPM/PKG"
+ PKGBACKUP=`mkpkgbackup "$PKGDIR"`
+ cd "$PKGDIR" && mv "$WORKDIR"/* "$PKGDIR" && rmdir "$WORKDIR" || exit $?
+
[ -z "$PLATTAG" ] && PLATTAG=`"$PREFIX/bin/openpkg" rpm -q --qf="%{ARCH}-%{OS}" openpkg`-$TAG
if [ -n "$KOLAB_VERSION" ]; then
DEFINE="$DEFINE
@@ -318,16 +329,18 @@ if [ -n "$DIR" ]; then
fi
PACKAGES=`remove_from_list "$EXCLUDEPKGS" "$PACKAGES"`
-
- find "$DIR" $FIND1 -name "*.$PLATTAG.rpm" -exec ln -sf '{}' "$PREFIX/RPM/PKG/" \;
echo "----------- SETUP COMPLETED -----------"
echo
echo " Now running:"
echo
- echo " $PREFIX/bin/openpkg build -kKBuZ -r \"$DIR\" -p \"$PLATTAG\" $DEFINE $PACKAGES | sh"
+ echo " $PREFIX/bin/openpkg build -kKBuZ -r \"$PKGDIR\" -p \"$PLATTAG\" $DEFINE $PACKAGES | sh"
echo
echo "---------------------------------------"
- "$PREFIX/bin/openpkg" build -kKBuZ -r "$DIR" -p "$PLATTAG" $DEFINE $PACKAGES | sh || exit $?
+ "$PREFIX/bin/openpkg" build -kKBuZ -r "$PKGDIR" -p "$PLATTAG" $DEFINE $PACKAGES | sh
+ rc=$?
+ echo "$PKGDIR now contains the installed packages."
+ echo "Previous contents were moved to $PKGBACKUP"
+ exit $?
fi
exit 0