summaryrefslogtreecommitdiff
path: root/install-kolab.sh
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2008-05-07 15:27:14 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2008-05-07 15:27:14 (GMT)
commit1d5e0c3263e7998c339f86f0a2218f1bf00ec47a (patch)
tree6ebce0ea8a6c4a244066d9bdb76e6ad1481d9c4d /install-kolab.sh
parent7c0937cb4a95c7c69395b023fc8810d0c9c9cee8 (diff)
downloadserver-1d5e0c3263e7998c339f86f0a2218f1bf00ec47a.tar.gz
consistent indentation for install-kolab.sh
Diffstat (limited to 'install-kolab.sh')
-rwxr-xr-xinstall-kolab.sh473
1 files changed, 237 insertions, 236 deletions
diff --git a/install-kolab.sh b/install-kolab.sh
index 7c0bf41..923ead0 100755
--- a/install-kolab.sh
+++ b/install-kolab.sh
@@ -31,180 +31,180 @@ FLAG_FBVIEW=""
FLAG_HORDE=""
usage() {
- echo "Usage:"
- echo " $0 (will try to determine mode of action itself)"
- echo
- echo " $0 -i directory/openpkg-*-*.src.sh"
- echo " $0 -i directory/openpkg-*-*.ix86-debian4.0.sh"
- echo " $0 -i directory"
- echo
- echo "Options:"
- echo
- echo " -H (install the Horde groupware web client)"
- echo " -F (install the free/busy view frontend)"
- echo
- echo " -h (display this help)"
- echo
- echo "Advanced options:"
- echo
- echo " -t TAG (alternate binary tag; default is kolab)"
- echo " -I UID (alternate base uid; default is 19414)"
- echo
- echo " -c (clean the environment specified with \$PREFIX; DANGEROUS!)"
- echo
- echo " -p PREFIX (alternate installation prefix; default is /\$TAG)"
- echo " -u USER (alternate user name; default is \$TAG)"
- echo
- echo " -V VERSION (alternate version; default is $KOLAB_VERSION)"
- echo
- echo " -D (generate a binary distribution based on ./ and /\$PREFIX)"
- echo " -S (generate a source distribution based on ./ and /\$PREFIX)"
- echo
- echo " -B (abort after generating the basic openpkg binary)"
- echo " -E (abort after generating the openpkg environment)"
- echo
- echo " -O (additional build options, used for openpkg bootstraping from source)"
+ echo "Usage:"
+ echo " $0 (will try to determine mode of action itself)"
+ echo
+ echo " $0 -i directory/openpkg-*-*.src.sh"
+ echo " $0 -i directory/openpkg-*-*.ix86-debian4.0.sh"
+ echo " $0 -i directory"
+ echo
+ echo "Options:"
+ echo
+ echo " -H (install the Horde groupware web client)"
+ echo " -F (install the free/busy view frontend)"
+ echo
+ echo " -h (display this help)"
+ echo
+ echo "Advanced options:"
+ echo
+ echo " -t TAG (alternate binary tag; default is kolab)"
+ echo " -I UID (alternate base uid; default is 19414)"
+ echo
+ echo " -c (clean the environment specified with \$PREFIX; DANGEROUS!)"
+ echo
+ echo " -p PREFIX (alternate installation prefix; default is /\$TAG)"
+ echo " -u USER (alternate user name; default is \$TAG)"
+ echo
+ echo " -V VERSION (alternate version; default is $KOLAB_VERSION)"
+ echo
+ echo " -D (generate a binary distribution based on ./ and /\$PREFIX)"
+ echo " -S (generate a source distribution based on ./ and /\$PREFIX)"
+ echo
+ echo " -B (abort after generating the basic openpkg binary)"
+ echo " -E (abort after generating the openpkg environment)"
+ echo
+ echo " -O (additional build options, used for openpkg bootstraping from source)"
}
while getopts hcBDSEFHi:V:p:I:u:t:O: ARGS; do
- case $ARGS in
- h) # Display help
- usage
- exit 0
- ;;
- i) # What should be installed?
- INSTALL="$OPTARG"
- ;;
- V) # User specified a specific Kolab version
- KOLAB_VERSION="$OPTARG"
- ;;
- p) # User specified an alternative prefix
- PREFIX="$OPTARG"
- ;;
- I) # User specified an alternative base Kolab UID
- KID="$OPTARG"
- ;;
- u) # User specified an alternative user name
- USER="$OPTARG"
- ;;
- t) # User specified an alternative tag
- TAG="$OPTARG"
- ;;
- B) # User only wants the basic openpkg package in binary form
- FLAG_BASE="Yes"
- ;;
- E) # User only wants the basic openpkg environment
- FLAG_ENV="Yes"
- ;;
- F) # User wants to install fbview
- FLAG_FBVIEW="Yes"
- ;;
- H) # User wants to install Horde
- FLAG_HORDE="Yes"
- ;;
- c) # User wants to erase the openpkg environment
- FLAG_CLEAN="Yes"
- ;;
- D) # User wants to collect a set of binary packages into a distribution
- FLAG_BDIST="Yes"
- ;;
- S) # User wants to collect a set of source packages into a distribution
- FLAG_SDIST="Yes"
- ;;
- O) # User wants additional options when building OpenPK
- ADDITIONAL_BUILD_OPTS="$OPTARG"
- ;;
- *) # Unknown Option
- echo
- usage
- exit 1
- ;;
- esac
+ case $ARGS in
+ h) # Display help
+ usage
+ exit 0
+ ;;
+ i) # What should be installed?
+ INSTALL="$OPTARG"
+ ;;
+ V) # User specified a specific Kolab version
+ KOLAB_VERSION="$OPTARG"
+ ;;
+ p) # User specified an alternative prefix
+ PREFIX="$OPTARG"
+ ;;
+ I) # User specified an alternative base Kolab UID
+ KID="$OPTARG"
+ ;;
+ u) # User specified an alternative user name
+ USER="$OPTARG"
+ ;;
+ t) # User specified an alternative tag
+ TAG="$OPTARG"
+ ;;
+ B) # User only wants the basic openpkg package in binary form
+ FLAG_BASE="Yes"
+ ;;
+ E) # User only wants the basic openpkg environment
+ FLAG_ENV="Yes"
+ ;;
+ F) # User wants to install fbview
+ FLAG_FBVIEW="Yes"
+ ;;
+ H) # User wants to install Horde
+ FLAG_HORDE="Yes"
+ ;;
+ c) # User wants to erase the openpkg environment
+ FLAG_CLEAN="Yes"
+ ;;
+ D) # User wants to collect a set of binary packages into a distribution
+ FLAG_BDIST="Yes"
+ ;;
+ S) # User wants to collect a set of source packages into a distribution
+ FLAG_SDIST="Yes"
+ ;;
+ O) # User wants additional options when building OpenPK
+ ADDITIONAL_BUILD_OPTS="$OPTARG"
+ ;;
+ *) # Unknown Option
+ echo
+ usage
+ exit 1
+ ;;
+ esac
done
if [ -z "$USER" ]; then
- USER=$TAG
+ USER=$TAG
fi
if [ -n "$FLAG_HORDE" ]; then
- DEFINE="$DEFINE -D kolabd::with_horde"
- PACKAGES="$PACKAGES horde-kolab-client"
+ DEFINE="$DEFINE -D kolabd::with_horde"
+ PACKAGES="$PACKAGES horde-kolab-client"
fi
if [ -n "$FLAG_FBVIEW" ]; then
- PACKAGES="$PACKAGES fbview-kronolith"
+ PACKAGES="$PACKAGES fbview-kronolith"
fi
if [ -z "$PREFIX" ]; then
- PREFIX="/$TAG"
+ PREFIX="/$TAG"
fi
R_KID=`expr $KID + 1`
N_KID=`expr $R_KID + 1`
if [ -n "$FLAG_CLEAN" -o -n "$FLAG_BDIST" -o -n "$FLAG_SDIST" ]; then
- if [ -x "$PREFIX/bin/openpkg" ]; then
- if [ -n "$FLAG_CLEAN" ]; then
- echo
- echo "This will completely wipe your installation in $PREFIX!"
- echo "Are you certain you want to do that (YES/NO)?"
- read ANSWER
- if [ "$ANSWER" = "YES" ]; then
- $PREFIX/bin/openpkg rpm -e `$PREFIX/bin/openpkg rpm -qa` || exit $?
- echo "Erased OpenPKG environment $PREFIX"
- exit 0
- else
- echo "Not cleaning."
- exit 0
- fi
- elif [ -n "$FLAG_SDIST" ]; then
- SDIST_DIR=$PREFIX/RPM/SDIST
- INSTALLER=`find . -name "openpkg-*.src.sh" -print`
- if [ -z "$INSTALLER" ]; then
- echo "No source based installer found. Unable to create a source distribution!"
- exit 1
- fi
- mkdir -p $SDIST_DIR
- cp $0 $SDIST_DIR
- if [ -n "$INSTALLER" ]; then
- cp $INSTALLER $SDIST_DIR
- fi
- if [ -n "*.src.rpm" ]; then
- cp *.src.rpm $SDIST_DIR
- fi
- if [ -n "$PREFIX/RPM/PKG/*.src.rpm" ]; then
- cp $PREFIX/RPM/PKG/*.src.rpm $SDIST_DIR
- fi
- chown -R $USER:$USER $SDIST_DIR
- cd $SDIST_DIR && $PREFIX/bin/openpkg index -r . -o 00INDEX.rdf -i .
- exit 0
- elif [ -n "$FLAG_BDIST" ]; then
- PLATTAG=`"$PREFIX/lib/openpkg/shtool" platform --type=binary`-$TAG
- BDIST_DIR=$PREFIX/RPM/BDIST
- BINARY=`find . -name "openpkg-*.$PLATTAG.sh" -print`
- if [ -z "$BINARY" ]; then
- echo "No binary installer package found. Unable to create a binary distribution!"
- exit 1
- fi
- mkdir -p $BDIST_DIR
- cp $0 $BDIST_DIR
- if [ -n "$BINARY" ]; then
- cp $BINARY $BDIST_DIR
- fi
- if [ -n "*$PLATTAG.rpm" ]; then
- cp *$PLATTAG.rpm $BDIST_DIR
- fi
- if [ -n "$PREFIX/RPM/PKG/*$PLATTAG.rpm" ]; then
- cp $PREFIX/RPM/PKG/*$PLATTAG.rpm $BDIST_DIR
- fi
- chown -R $USER:$USER $BDIST_DIR
- cd $BDIST_DIR && $PREFIX/bin/openpkg index -r . -o 00INDEX.rdf -i -p $PLATTAG .
- exit 0
- else
- echo "\"$PREFIX\" seems to be no OpenPKG environment."
- exit 1
- fi
- fi
+ if [ -x "$PREFIX/bin/openpkg" ]; then
+ if [ -n "$FLAG_CLEAN" ]; then
+ echo
+ echo "This will completely wipe your installation in $PREFIX!"
+ echo "Are you certain you want to do that (YES/NO)?"
+ read ANSWER
+ if [ "$ANSWER" = "YES" ]; then
+ $PREFIX/bin/openpkg rpm -e `$PREFIX/bin/openpkg rpm -qa` || exit $?
+ echo "Erased OpenPKG environment $PREFIX"
+ exit 0
+ else
+ echo "Not cleaning."
+ exit 0
+ fi
+ elif [ -n "$FLAG_SDIST" ]; then
+ SDIST_DIR=$PREFIX/RPM/SDIST
+ INSTALLER=`find . -name "openpkg-*.src.sh" -print`
+ if [ -z "$INSTALLER" ]; then
+ echo "No source based installer found. Unable to create a source distribution!"
+ exit 1
+ fi
+ mkdir -p $SDIST_DIR
+ cp $0 $SDIST_DIR
+ if [ -n "$INSTALLER" ]; then
+ cp $INSTALLER $SDIST_DIR
+ fi
+ if [ -n "*.src.rpm" ]; then
+ cp *.src.rpm $SDIST_DIR
+ fi
+ if [ -n "$PREFIX/RPM/PKG/*.src.rpm" ]; then
+ cp $PREFIX/RPM/PKG/*.src.rpm $SDIST_DIR
+ fi
+ chown -R $USER:$USER $SDIST_DIR
+ cd $SDIST_DIR && $PREFIX/bin/openpkg index -r . -o 00INDEX.rdf -i .
+ exit 0
+ elif [ -n "$FLAG_BDIST" ]; then
+ PLATTAG=`"$PREFIX/lib/openpkg/shtool" platform --type=binary`-$TAG
+ BDIST_DIR=$PREFIX/RPM/BDIST
+ BINARY=`find . -name "openpkg-*.$PLATTAG.sh" -print`
+ if [ -z "$BINARY" ]; then
+ echo "No binary installer package found. Unable to create a binary distribution!"
+ exit 1
+ fi
+ mkdir -p $BDIST_DIR
+ cp $0 $BDIST_DIR
+ if [ -n "$BINARY" ]; then
+ cp $BINARY $BDIST_DIR
+ fi
+ if [ -n "*$PLATTAG.rpm" ]; then
+ cp *$PLATTAG.rpm $BDIST_DIR
+ fi
+ if [ -n "$PREFIX/RPM/PKG/*$PLATTAG.rpm" ]; then
+ cp $PREFIX/RPM/PKG/*$PLATTAG.rpm $BDIST_DIR
+ fi
+ chown -R $USER:$USER $BDIST_DIR
+ cd $BDIST_DIR && $PREFIX/bin/openpkg index -r . -o 00INDEX.rdf -i -p $PLATTAG .
+ exit 0
+ else
+ echo "\"$PREFIX\" seems to be no OpenPKG environment."
+ exit 1
+ fi
+ fi
fi
echo
@@ -218,106 +218,107 @@ echo "Kolab non-priviledged UID (KID): $N_KID"
echo
if [ -z "$INSTALL" ]; then
- # Hm, user wants us to figure out what we should do
- echo "Received no instructions. Trying to determine required action..."
- if [ -d "$PREFIX/etc/openpkg" ]; then
- # Assume an upgrade based on the current directory
- INSTALL=`pwd`
- echo "Found an OpenPKG environment. Assuming upgrade..."
- else
- INSTALLER=`find . -name "openpkg-*.src.sh" -print`
- BINARY=`find . -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
- # 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
- # We have a source package. Check for a matching binary
- PLATTAG=`sh "$INSTALLER" -t | tar xf - -O shtool | sh -s platform --type=binary`-$TAG
- 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 from source
- INSTALL=$INSTALLER
- echo "Found a source based OpenPKG installer. Trying to install Kolab from source."
- fi
- fi
- fi
+ # Hm, user wants us to figure out what we should do
+ echo "Received no instructions. Trying to determine required action..."
+ if [ -d "$PREFIX/etc/openpkg" ]; then
+ # Assume an upgrade based on the current directory
+ INSTALL=`pwd`
+ echo "Found an OpenPKG environment. Assuming upgrade..."
+ else
+ INSTALLER=`find . -name "openpkg-*.src.sh" -print`
+ BINARY=`find . -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
+ # 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
+ # We have a source package. Check for a matching binary
+ PLATTAG=`sh "$INSTALLER" -t | tar xf - -O shtool | sh -s platform --type=binary`-$TAG
+ 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 from source
+ INSTALL=$INSTALLER
+ echo "Found a source based OpenPKG installer. Trying to install Kolab from source."
+ fi
+ fi
+ fi
fi
if echo "$INSTALL" | grep '\.src\.sh$' >/dev/null; then
- # install from source
- SRC="$INSTALL"
- PLATTAG=`sh "$INSTALL" -t | tar xf - -O shtool | sh -s platform --type=binary`-$TAG
- BIN=`basename "$INSTALL" .src.sh`.$PLATTAG.sh
- DIR=`dirname "$SRC"`
+ # install from source
+ SRC="$INSTALL"
+ PLATTAG=`sh "$INSTALL" -t | tar xf - -O shtool | sh -s platform --type=binary`-$TAG
+ 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"`
+ # install from binary
+ SRC=""
+ BIN="$INSTALL"
+ DIR=`dirname "$BIN"`
elif [ -d "$PREFIX/etc/openpkg" ]; then
- # upgrade
- SRC=""
- BIN=""
- DIR="$INSTALL"
+ # upgrade
+ SRC=""
+ BIN=""
+ DIR="$INSTALL"
fi
DIR=`cd $DIR; pwd`
if [ -n "$SRC" ]; then
- echo "Creating binary openpkg package from $SRC!"
- [ -n "$ADDITIONAL_BUILD_OPTS" ] && \
- echo "Using additional options: $ADDITIONAL_BUILD_OPTS"
- sh "$SRC" \
+ echo "Creating binary openpkg package from $SRC!"
+ [ -n "$ADDITIONAL_BUILD_OPTS" ] && \
+ echo "Using additional options: $ADDITIONAL_BUILD_OPTS"
+ sh "$SRC" \
$ADDITIONAL_BUILD_OPTS \
- --prefix="$PREFIX" \
- --tag="$TAG" --user="$USER" --group="$USER" \
- --muid="$KID" --ruid="$R_KID" --nuid="$N_KID" \
- --mgid="$KID" --rgid="$R_KID" --ngid="$N_KID" \
- || exit $?
- if [ -n "$FLAG_BASE" ]; then
- echo "Created basic openpkg binary for you platform!"
- exit 0
- fi
+ --prefix="$PREFIX" \
+ --tag="$TAG" --user="$USER" --group="$USER" \
+ --muid="$KID" --ruid="$R_KID" --nuid="$N_KID" \
+ --mgid="$KID" --rgid="$R_KID" --ngid="$N_KID" \
+ || exit $?
+ if [ -n "$FLAG_BASE" ]; then
+ echo "Created basic openpkg binary for you platform!"
+ exit 0
+ fi
fi
if [ -n "$BIN" ]; then
- sh "$BIN" || exit $?
- if [ -n "$FLAG_ENV" ]; then
- echo "Created basic openpkg environment!"
- exit 0
- fi
+ sh "$BIN" || exit $?
+ if [ -n "$FLAG_ENV" ]; then
+ echo "Created basic openpkg environment!"
+ exit 0
+ fi
fi
if [ -n "$DIR" ]; then
- [ -z "$PLATTAG" ] && PLATTAG=`"$PREFIX/lib/openpkg/shtool" platform --type=binary`-$TAG
- if [ -n "$KOLAB_VERSION" ]; then
- DEFINE="
- $DEFINE
- -Dkolabd::kolab_version=$KOLAB_VERSION
- -Dkolab-webadmin::kolab_version=$KOLAB_VERSION
- "
- fi
- find "$DIR" -mindepth 1 -maxdepth 1 -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 ""
- echo "---------------------------------------"
- "$PREFIX/bin/openpkg" build -kKBuZ -r "$DIR" -p "$PLATTAG" $DEFINE $PACKAGES | sh || exit $?
+ [ -z "$PLATTAG" ] && PLATTAG=`"$PREFIX/lib/openpkg/shtool" platform --type=binary`-$TAG
+ if [ -n "$KOLAB_VERSION" ]; then
+ DEFINE="$DEFINE
+ -Dkolabd::kolab_version=$KOLAB_VERSION
+ -Dkolab-webadmin::kolab_version=$KOLAB_VERSION
+ "
+ fi
+ find "$DIR" -mindepth 1 -maxdepth 1 -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
+ echo "---------------------------------------"
+ "$PREFIX/bin/openpkg" build -kKBuZ -r "$DIR" -p "$PLATTAG" $DEFINE $PACKAGES | sh || exit $?
fi
exit 0
+
+# vim:ai et sta sw=4 sts=4 tw=0: