Change Log

Check here to see previous revisions and for notes on changes made to this page:
Open-Xchange&action=PageHistory

Inspiration for this script was the instructions found on this page:
http://sietse.net/exoops/modules/OpenXchange/

Following on from Greg's original work in publishing a roadmap
with clues on how to get OpenXchange installed on an SME server,

I offer you the following script.
You ought to be able to cut it out and paste it into a suitable editor.

BEWARE!!!  This is pure development stuff!  No account has been taken
of maintaining integrity of the development server,

and security
has not been addressed in any way.

I would have continued the work, but business pressures have intervened
and I'm going to have to do some paying work for a while.

Good luck to potential developers!

Dave

Installation Script

#!/bin/bash
#
# This little (!) command procedure simply fetches some of the software
# required to get OpenXchange working on a fresh
# SME 6.0.1-01 server installation.  Thanks to lots of people!!
#
# ============================================================================= #
# Revision history                                                              #
# 22 February 2005  - Original version by Dave Dumolo                           #
#    -- A 'hack through the software jungle with a machete' version with        #
#    -- the aim of getting all the software needed to achieve a compilation     #
#    -- of Open-Xchange.                                                        #
#    -- Due to lack of time this version was never tested on a new installation #
#    -- of an SME server 6.0.1-01, the system on which it was developed.        #
#                                                                               #
#    -- Someone must want to carry this work on ..........                      #
# ============================================================================= #
#
#
# Create two top level directories for doing all this stuff
# - it just keeps things tidy
#
# The general idea is that we'll get all the files first and then process them.
# That way we're less likely to end up with a mess.
#
Prerequisitedirectory='/OpenXchange-prerequisite'
Installdirectory='/OpenXchange-install'

echo "The pre-requisites directory will be <$Prerequisitedirectory>, and"
echo "the install directory will be <$Installdirectory>"
#
# Some files need to be manually fetched from the Sun Java site.
# We'll check to see if this has been done.  If it hasn't, then
# give the poor user some hints!!  This is the prerequisites stage
# - 'cos we can't to it automagically!
#
echo ""
if ! [ -e "$Prerequisitedirectory" ]
then
  echo "Before the installation of OpenXchange can proceed, certain pre-requisite"
  echo "files need to be fetched manually."
  echo "If you choose to proceed, the pre-requisites directory will be created and"
  echo "you will then see a list of files that need to be fetched manually and"
  echo "placed into the pre-requisite directory <$Prerequisitedirectory>."
  while true; do
    echo "Do you want to create the pre-requisite directory and continue (C),"
    echo -n "or quit the installation while you are ahead? (Q) (C/Q) ?"
    read cq
    case $cq in
      c* | C* )
        mkdir $Prerequisitedirectory; break;;
      [qQ] )
        echo "OK! Probably a very wise decision!  Bye!"; exit;;
      * ) echo "Unrecognised response. Try again" ;;
    esac
  done
else
  echo "A pre-requisite software directory has been found."
  while true; do
    echo "You can continue and the files will be checked (C),"
    echo -n "or you can quit the installation leaving the pre-requisite files intact (Q) (C/Q)"
    read cq
    case $cq in
      c* | C* ) break;;
      [qQ] )
        echo "OK! Probably a very wise decision!  Bye!"; exit;;
      * ) echo "Unrecognised response. Try again" ;;
    esac
  done
fi

echo "Checking pre-requisite files ....."
cd "$Prerequisitedirectory"
Missing=0
if [ ! -e jdk-1_5_0_01-linux-i586.bin ]           # If java not available ...
then
  echo "You need to get jdk-1_5_0_01-linux-i586.bin from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/j2se/1.5.0/download.html using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ ! -e javamail-1_3_2.zip ]           # If javamail not available ...
then
  echo "You need to get javamail-1_3_2.zip from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/products/javamail/downloads/index.html using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ ! -e jaf-1_0_2-upd.zip ]
then
  echo "You need to get jaf-1_0_2-upd.zip from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/products/javabeans/glasgow/jaf.html using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ ! -e jta-1_0_1B-classes.zip ]
then
  echo "You need to get jta-1_0_1B-classes.zip from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/products/jta/ using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ ! -e jta-1_0_1B-doc.zip ]
then
  echo "You need to get jta-1_0_1B-doc.zip from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/products/jta/ using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ ! -e jmx-1_2_1-ri.zip ]
then
  echo "You need to get jmx-1_2_1-ri.zip from the Sun site and place it in <$Prerequisitedirectory>";
  echo "Look in http://java.sun.com/products/JavaManagement/download.html using a web browser."
  echo ""
  let "Missing += 1"
fi

if [ $Missing -gt 0 ]
then
  echo "Checks revealed that $Missing files are missing from the pre-requisites directory."
  echo "Unable to continue until these files have been fetched and placed in $Prerequisitedirectory."
  echo ""
  echo "Good luck with the downloads! Bye!"
  exit
fi

echo "All pre-requisite files appear to be available.  Do you want to"
echo -n "continue on to the automated file fetching and installation process (Y/N)?"
while true; do
  read yn
  case $yn in
    y* | Y* ) break;;
    [nN] )
      echo "OK! Probably a very wise decision!  Bye!"; exit;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo ""
if [ -e "$Installdirectory" ]   # If the installation directory exists ....
then
  echo "It looks as if the software for Open-Xchange has already been installed here."
  echo "If you continue then you can EITHER clean up the installation source"
  echo "and try again OR continue and allow the script to attempt some sort of"
  echo "recovery. Continuing could possibly have some unexpected side effects."
  echo "However, you may want to do this to preserve the files that have already"
  echo "been downloaded.  Note that cleaning up the installation source"
  echo "is not the same as an 'UNINSTALL' process - that's not addressed here!"
  echo ""
  echo "Continue at your own risk!"
  while true; do
    echo -n "Do you want to continue? (Y/N)"
    read yn
    case $yn in
      y* | Y* ) break;;
      [nN] ) echo "Installation terminated by user" ; exit;;
      * ) echo "Unrecognised response. Try again" ;;
    esac
  done
  while true; do
    echo "Do you want to wipe out the install directory structure and start again (W),"
    echo -n "or leave existing files intact and attempt a recovery (R)  (W/R) ?"
    read wr
    case $wr in
    #  If the user wants to continue then we'll simply delete the install directory
    #  and all it's contensts and start over.
      w* | W* )
# I took this out because of the HUGE amount of software that would get removed.
#        rm -R $Installdirectory; break;;
         echo "I did not remove your software - but we will stop anyway"; exit; break;;
      [rR] ) echo "OK! Recovering if possible!" ; break;;
      * ) echo "Unrecognised response. Try again" ;;
    esac
  done
fi

# If we get to here without error than we EITHER have no install directory
# or the user decided to leave the existing structure intact. If there isn't
# one we'll make one and start the installation process.

if [ ! -e "$Installdirectory" ]   # If the installation directory doesn't exist ....
then
  mkdir $Installdirectory
  if [ $? -ne 0 ]         # Test exit status of "mkdir" command.
  then
    echo "Ooops!  Unable to make the installation directory."
    echo "Abandoning installation"
    echo ""
    exit
  fi
fi

# Onwards!!! ....

echo "Now we'll get most of the software required to install Open-XChange."
echo "No installations will take place at this time."

############################
# Get the development RPMs #
############################

echo "Getting the development RPMs ...."
cd $Installdirectory
subdirectory="dev-rpms"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/anaconda-7.3-7es115.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/anaconda-runtime-7.3-7es115.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/apache-devel-1.3.27-2.7.2.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/autoconf-2.13-17.noarch.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/automake-1.4p5-4.noarch.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/bison-1.35-1.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/cpp-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gcc-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gcc-c++-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gettext-0.11.1-2.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/glibc-devel-2.2.5-44.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/glibc-kernheaders-2.4-7.16.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/kernel-source-2.4.20-18.7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libacl-2.0.11-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libacl-devel-2.0.11-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libattr-2.0.8-6.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libstdc++-devel-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libtool-1.4.2-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/m4-1.4.1-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/mkisofs-1.10-11.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/ncurses-devel-5.2-26.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/openssl-devel-0.9.6b-35.7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/pam-devel-0.75-46.7.3.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/readline-devel-4.2a-4.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/rpm-python-4.0.4-7x.18.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/zlib-devel-1.1.4-8.7x.i386.rpm
#wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/smeserver-skel/smeserver-skel-0.2-01.src.rpm
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/XFree86-libs-4.2.0-8.i386.rpm
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/tk-8.3.3-67.i386.rpm
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/expect-5.32.2-67.i386.rpm

###########################################
# Get PHP4.3.10 - thanks to Ergin Ozdemir #
###########################################

echo "Getting PHP 4.3.10 files .... "
cd $Installdirectory
subdirectory="php-rpms"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-devel-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-imap-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-mysql-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-ldap-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-odbc-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-snmp-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-pgsql-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-curl-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-mcrypt-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-mhash-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-domxml-4.3.10-3eo.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/ergozd/scripts/phprpms/php-xmlrpc-4.3.10-3eo.i386.rpm
#wget -c http://mirror.contribs.org/smeserver/contribs/dbrown/RPMS/i386/php-manual-4.3.10-1db_rh73.i386.rpm

# Install unixOBDC if not installed.
rpm -qa > rpmlist
IS_ODBC=`pic rpmlist | grep -c unixODBC`
if [ $IS_ODBC -eq 0 ]
then
  wget -c http://download.fedoralegacy.org/redhat/7.3/os/i386/unixODBC-2.2.0-5.i386.rpm
else
  echo "unixODBC installed skipping download"
fi
rm rpmlist

#########################
# Get the Postgres RPMs #
#########################

echo "Getting Postgres 7.4.2 .... "
cd $Installdirectory
subdirectory="postgres-rpms"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-contrib-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-devel-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-docs-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-jdbc-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-libs-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-pl-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-python-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-server-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-tcl-7.4.2-1PGDG.i386.rpm
wget -c ftp://ftp.be.postgresql.org/postgresql/binary/v7.4.2/redhat/redhat-7.3/postgresql-test-7.4.2-1PGDG.i386.rpm
wget -c http://linuxsoft.cern.ch/cern/7.3.X/i386/RedHat/RPMS/mx-2.0.3-1.i386.rpm

#############################
# Get the Berkeley DB stuff #
#############################

echo "Getting Berkeley DB 4.3 .... "
cd $Installdirectory
subdirectory="BerleleyDB-pkg"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory
wget -c ftp://ftp.sleepycat.com/releases/db-4.3.27.NC.tar.gz
wget -c http://www.sleepycat.com/update/4.3.27/patch.4.3.27.1
wget -c http://www.sleepycat.com/update/4.3.27/patch.4.3.27.2
wget -c http://www.sleepycat.com/update/4.3.27/patch.4.3.27.3

#######################
# Get OpenLDAP 2.2.23 #
#######################

echo "Getting OpenLDAP 2.2.23 .... "
cd $Installdirectory
subdirectory="OpenLDAP-pkg"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

wget -c ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.2.23.tgz

##########################
# Get some Perl stuff .. #
##########################

echo "Getting OpenLDAP 2.2.23 .... "
cd $Installdirectory
subdirectory="perl-stuff"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory
wget -c http://tdknights.com/buildapache/perlinstall
#ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/expect-5.32.2-67.i386.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-Convert-ASN1-0.18-8.noarch.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-perl-ldap-0.3202-8.noarch.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-IO-Socket-SSL-0.96-8.noarch.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-Net_SSLeay.pm-1.25-8.i386.rpm
##Authen::SASL is ...
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-perl-ldap-0.15-8.noarch.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-XML-NamespaceSupport-1.08-8.noarch.rpm
#wget -c http://www.quantumlinux.com/~kevin/rpmpan/rpm/perl-Bundle-XML-0.11-8.i386.rpm

#######################
# Get some Java stuff #
#######################

echo "Getting some of the required Java files .... "
cd $Installdirectory
subdirectory="java-apps"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory
#
# These RPMs really just supply .spec files that enable RPMs to be built.
#
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.01-3jpp.nosrc.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/javamail-1.3.2-1jpp.nosrc.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/jta-1.0.1-0.b.4jpp.nosrc.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/jmx-1.2.1-1jpp.nosrc.rpm

#Get ant

wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/ant-1.6.2-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/ant-optional-full-1.5.4-2jpp.noarch.rpm

#Get Tomcat

wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/tomcat5-5.0.30-6jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/tomcat5-servlet-2.4-api-5.0.30-6jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/tomcat5-jasper-5.0.30-6jpp.noarch.rpm

# Some additional stuff required to satisfy various dependancies

wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/xerces-j2-2.6.2-4jpp.noarch.rpm            #xerces-j2
wget -c http://mirrors.sunsite.dk/jpackage/1.6/redhat-7.3/free/RPMS/mod_jk-ap13-1.2.6-3jpp.i386.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/redhat-7.3/free/RPMS/mod_jk-manual-1.2.6-3jpp.i386.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/redhat-7.3/free/RPMS/mod_jk-tools-1.2.6-3jpp.i386.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/xalan-j2-2.6.0-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jdom-1.0-1jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/xml-commons-resolver-1.1-3jpp.noarch.rpm

wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/tyrex-1.0.1-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/regexp-1.3-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/bcel-5.1-5jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/wsdl4j-1.4-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/log4j-1.2.8-8jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/axis-1.1-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/junit-3.8.1-4jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/xml-commons-1.0-0.b2.7jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/xml-commons-apis-1.0-0.b2.7jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/mx4j-2.0.1-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-beanutils-1.7.0-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-collections-3.1-1jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-daemon-1.0-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-dbcp-1.2.1-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-digester-1.6-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-pool-1.2-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-el-1.0-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-fileupload-1.0-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-launcher-0.9-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-logging-1.0.4-2jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-modeler-1.1-3jpp.noarch.rpm
wget -c http://mirrors.sunsite.dk/jpackage/1.6/generic/free/RPMS/jakarta-commons-discovery-0.2-2jpp.noarch.rpm

#wget -c ftp://ftp3.ca.postgresql.org/pub/binary/v7.2.4/RPMS/redhat-7.3/postgresql-jdbc-7.2.4-1PGDG.i386.rpm #postgresql-jdbc
wget -c http://mirror.poundhost.com/fedora.redhat.com/development/i386/Fedora/RPMS/servletapi5-5.0.18-1jpp_3fc.noarch.rpm

#######################################
# Finally - get the OpenXchange stuff #
#######################################

echo "Getting OpenXchange files .... "
cd $Installdirectory
subdirectory="ox-pkgs"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

#wget -c http://mirror.open-xchange.org/download/open-xchange-0.7.5.tar.gz ... no longer valid ... Tib
wget -c http://mirror.open-xchange.org/download/archive/open-xchange-0.7.5.tar.gz

###########################################
# Save some configuration files for later #
###########################################

cd $Installdirectory
subdirectory="saved-stuff"
if [ ! -e $subdirectory ]
then
  mkdir $subdirectory
fi
cd $subdirectory

cp /etc/rc.d/init.d/ldap .
cp /etc/e-smith/templates/etc/openldap .

############################################################################################

echo ""
echo "So far, so good!  That is all the files needed to continue."
echo "You will be warned when you get to the point where the SME distribution"
echo "is modified in a way that cannot easily be restored."
echo ""
echo "Now we need to install some of the files to be able to continue ..."
while true; do
  echo -n "Do you want to install the development RPMs (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      cd "$Installdirectory/dev-rpms"
# The *.rpm doesn't work for some reason!!
#      rpm -Uvh --nodeps *.rpm                  # Install all the development RPMs
      rpm -Uvh --nodeps anaconda-7.3-7es115.i386.rpm
      rpm -Uvh --nodeps anaconda-runtime-7.3-7es115.i386.rpm
      rpm -Uvh --nodeps apache-devel-1.3.27-2.7.2.i386.rpm
      rpm -Uvh --nodeps autoconf-2.13-17.noarch.rpm
      rpm -Uvh --nodeps automake-1.4p5-4.noarch.rpm
      rpm -Uvh --nodeps bison-1.35-1.i386.rpm
      rpm -Uvh --nodeps cpp-2.96-113.i386.rpm
      rpm -Uvh --nodeps expect-5.32.2-67.i386.rpm
      rpm -Uvh --nodeps gcc-2.96-113.i386.rpm
      rpm -Uvh --nodeps gcc-c++-2.96-113.i386.rpm
      rpm -Uvh --nodeps gettext-0.11.1-2.i386.rpm
      rpm -Uvh --nodeps glibc-devel-2.2.5-44.i386.rpm
      rpm -Uvh --nodeps glibc-kernheaders-2.4-7.16.i386.rpm
      rpm -Uvh --nodeps kernel-source-2.4.20-18.7.i386.rpm
      rpm -Uvh --nodeps libacl-2.0.11-7.i386.rpm
      rpm -Uvh --nodeps libacl-devel-2.0.11-7.i386.rpm
      rpm -Uvh --nodeps libattr-2.0.8-6.i386.rpm
      rpm -Uvh --nodeps libstdc++-devel-2.96-113.i386.rpm
      rpm -Uvh --nodeps libtool-1.4.2-7.i386.rpm
      rpm -Uvh --nodeps m4-1.4.1-7.i386.rpm
      rpm -Uvh --nodeps mkisofs-1.10-11.i386.rpm
      rpm -Uvh --nodeps ncurses-devel-5.2-26.i386.rpm
      rpm -Uvh --nodeps openssl-devel-0.9.6b-35.7.i386.rpm
      rpm -Uvh --nodeps pam-devel-0.75-46.7.3.i386.rpm
      rpm -Uvh --nodeps readline-devel-4.2a-4.i386.rpm
      rpm -Uvh --nodeps rpm-python-4.0.4-7x.18.i386.rpm
      rpm -Uvh --nodeps tk-8.3.3-67.i386.rpm
      rpm -Uvh --nodeps XFree86-libs-4.2.0-8.i386.rpm
      rpm -Uvh --nodeps zlib-devel-1.1.4-8.7x.i386.rpm
      break;;
    [nN] ) echo "Skipping installation of development RPMs" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done
echo ""
echo "Only continue if the development RPMs installed"
echo "without problem.  The whole installation process"
echo "from now on depends on each step working correctly."
echo ""
echo "Now we'll get Perl up to date ...."
echo "This will replace the existing Perl with the latest available."
echo ""
echo "You'll only need to do this once in the course of testing"
while true; do
  echo -n "Do you want to bring Perl up to date and install some extra modules (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      cd "$Installdirectory/perl-stuff"
      chmod 755 perlinstall
      ./perlinstall
# Do this to check that everything is up to date
#      perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
       perl -MCPAN -e 'install Convert::ASN1'
       perl -MCPAN -e 'install Net::LDAP'
       perl -MCPAN -e 'install IO::Socket::SSL'
       perl -MCPAN -e 'force install Net::SSLeay'
       perl -MCPAN -e 'install Authen::SASL'
       perl -MCPAN -e 'install Authen::PAM'
       perl -MCPAN -e 'install XML::NamespaceSupport'
       perl -MCPAN -e 'install XML::SAX'
      break;;
    [nN] ) echo "Skipping installation of Perl and Perl modules" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done
#
while true; do
  echo -n "Do you want to install Postgres 7.4.2 (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      cd "$Installdirectory/postgres-rpms"
      rpm -Uvh --nodeps *.rpm                   # Install all the Postgres RPMs
      /etc/init.d/postgresql start
      # Create template directories
      mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
      mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
      # Copy original config file into template directory
      cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data
      cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data
      # Make modifications for this SME install
      # This changes '#tcpip_socket = false' to 'tcpip_socket = true' whilst
      # making the copy
      sed '/#tcpip_socket/s/#tcpip_socket/tcpip_socket/;s/false/true/' \
       /etc/e-smith/templates/var/lib/pgsql/data/postgresql.conf > \
       /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf
      # This changes 'local all all ident sameuser' to '#local all all ident sameuser'
      # whilst making the copy
      sed -e '/local/s/local[ ]*all[ ]*all/#local all all/' \
      /etc/e-smith/templates/var/lib/pgsql/data/pg_hba.conf > \
      /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
      # ..and this adds some lines
      echo ""
      echo -n "Enter the IP address of this server (please get it right, there's no checking!!) "
      read ipstring
      echo -n "Enter the IP mask of this server (probably 255.255.255.0) "
      read maskstring
      echo "host all all $ipstring $maskstring trust" >> /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
      echo "host all all 0.0.0.0 255.255.255.255 reject" >> /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
      #
      # ..and these should not really be added - it's just for testing
      echo "local all all                              trust" >> /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
      echo "host  all all 127.0.0.1  255.255.255.255   trust" >> /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf

      /sbin/e-smith/expand-template /var/lib/pgsql/data/pg_hba.conf
      /sbin/e-smith/expand-template /var/lib/pgsql/data/postgresql.conf

      # Just a symbolic link so that the actual postgress Java interfacec can be changed easily
      ln -s /usr/share/java/pg74.1jdbc3.jar /usr/share/java/postgresql.jar

      /etc/init.d/postgresql stop
      /etc/init.d/postgresql start

      # Enable automatic launching of postgres on system start
      ln -s /etc/init.d/postgresql /etc/rc.d/rc7.d/S56postgresql
      ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql
      break;;
    [nN] ) echo "Skipping installation of Postgres" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo ""
echo "That's got Postgres up and running!!"
echo ""
while true; do
  echo -n "Do you want to install the PHP upgrade (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      # This is a cludge! The file libpq.so.2 is missing.
      # A fix that seems to work is to make a symbolic link to libpq.so.3
      ln -s /usr/lib/libpq.so.3 /usr/lib/libpq.so.2
      cd "$Installdirectory/php-rpms"
      rpm -Uvh --nodeps *.rpm                   # Install all the development RPMs
      mkdir -p /etc/e-smith/templates-custom/etc/php.ini
      templatefile="/etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories"
      touch $templatefile
      echo 'include_path   = ".:/usr/share/pear"' > $templatefile
      echo 'doc_root       =' >> $templatefile
      echo 'user_dir       =' >> $templatefile
      echo 'extension_dir  = /usr/lib/php4' >> $templatefile
      echo 'enable_dl      = On' >> $templatefile
      # Make Postgres available to PHP
      templatefile="/etc/e-smith/templates-custom/etc/php.ini/70PgsqlExtension"
      touch $templatefile
      echo "extension=pgsql.so" > $templatefile

      pear upgrade Log
      pear upgrade Date
      /sbin/e-smith/expand-template /etc/php.ini
      # service httpd restart     # Modified after requtest from contribs.org forum to:
      /etc/e-smith/events/actions/restart-httpd-full
      break;;
    [nN] ) echo "Skipping installation of PHP" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo "That's the PHP upgrade done!"
echo ""
echo ""
echo "From now on the SME server will be modified by means other than installing RPMs."
echo "This means that an original SME server cannot easily be restored once the"
echo "following changes have n=been made."
echo "YOU HAVE BEEN WARNED!!!....."
echo ""

#################################
# Build and install Berkeley DB #
#################################

while true; do
  echo -n "Do you want to build and install Berkeley DB (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      cd "$Installdirectory/BerleleyDB-pkg"
      tar -zxvf db-4.3.27.NC.tar.gz
      cd db-4.3.27.NC
      patch -p0 < ../patch.4.3.27.1
      patch -p0 < ../patch.4.3.27.2
      patch -p0 < ../patch.4.3.27.3
      cd build_unix
      ../dist/configure
      make
      make install
      while true; do
        echo -n "Do you want to modify /etc/ld.so.conf (Y/N) ?"
        read yn1
        case $yn1 in
          y* | Y* ) echo "" >> /etc/ld.so.conf; break;;
          [nN] ) echo "Skipping modification of ld.so.conf" ; break;;
          * ) echo "Unrecognised response. Try again" ;;
        esac
      done
      ldconfig
      break;;
    [nN] ) echo "Skipping build and installation of Berkeley DB" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

############################
# Process the new OpenLDAP #
############################

# What goes on here is not very nice!  The following should really be
# done using one or more RPMS - but I don't know how to build them.
# This method results in the loss of the Directory command from the
# server manager front end - not very clever!!
#
while true; do
  echo -n "Do you want to build and install an updated OpenLDAP (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      cd "$Installdirectory/OpenLDAP-pkg"
      tar -zxvf openldap-2.2.23.tgz
      cd openldap-2.2.23
# Some configuration command, eh?
# This is the command line to get OpenLDAP to configure
LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/usr/local/BerkeleyDB.4.3/lib:/usr/local/ssl/lib" \
LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.3/lib -L/usr/local/ssl/lib" \
CPPFLAGS="-I/usr/local/include -I/usr/local/BerkeleyDB.4.3/include -I/usr/local/ssl/include" \
./configure --enable-bdb --enable-crypt --with-tls
      make depend
      make
      while true; do
        echo "In order to install the new OpenLDAP, certain distribution RPMs need to be removed."
        echo "It will be difficult to recover to a clean SME server from now on."
        echo -n "Do you want to continue? (Y/N) "
        read yn1
        case $yn1 in
          y* | Y* )
            rpm -e --nodeps openldap-2.0.27-2.7.3es
            rpm -e --nodeps openldap-clients-2.0.27-2.7.3es
            rpm -e --nodeps perl-perl-ldap-0.22-10
            rpm -e --nodeps openldap-servers-2.0.27-2.7.3es
            rpm -e --nodeps e-smith-ldap-4.10.0-03
            rpm -e --nodeps php-ldap-4.3.8-1db
            break;;
          [nN] ) echo "Termination the installation process."; exit; break;;
          * ) echo "Unrecognised response. Try again" ;;
        esac
      done
      make install
      while true; do
        echo -n "Do you want to run the installations tests(Y/N) ?"
        read yn1
        case $yn1 in
          y* | Y* ) make test; break;;
          [nN] ) echo "Skipping modification of ld.so.conf" ; break;;
          * ) echo "Unrecognised response. Try again" ;;
        esac
      done
      make clean
      cd "$Installdirectory/saved-stuff"
      cp ldap /etc/rc.d/init.d
      cp -R openldap /etc/e-smith/templates
      /sbin/e-smith/expand-template /etc/openldap/ldap.conf
      /sbin/e-smith/expand-template /etc/openldap/slapd.conf
      break;;
    [nN] ) echo "Skipping build and installation of Berkeley DB" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

#################################
# Now for the Java installation #
#################################

while true; do
  echo -n "Do you want to install Java and the Java modules (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      echo "This process involves making RPMs as root."
      echo "This is probably not a very good idea, but it will do for testing."
      echo -n "Hit <RET> to continue ..."
      read anykey
      echo "Making the required Java rpms ...."
      if [ ! -e /usr/src/redhat/TMP ]
      then
        mkdir /usr/src/redhat/TMP
      fi
      if [ !  -e ~/.rpmmacros ]
      then
        touch ~/.rpmmacros
        echo "%_builddir      /usr/src/redhat/BUILD" >> ~/.rpmmacros
        echo "%_rpmdir        /usr/src/redhat/RPMS" >> ~/.rpmmacros
        echo "%_sourcedir     /usr/src/redhat/SOURCES" >> ~/.rpmmacros
        echo "%_specdir       /usr/src/redhat/SPECS" >> ~/.rpmmacros
        echo "%_srcrpmdir     /usr/src/redhat/SRPMS" >> ~/.rpmmacros
        echo "%_tmppath       /usr/src/redhat/TMP" >> ~/.rpmmacros
      fi
# Build Java
      echo "Building and installing Java ...."
      cd $Installdirectory/java-apps/
      #The nosrc.rpm just creates the required /usr/src/redhat/SPEC file
      rpm -Uvh $Installdirectory/java-apps/java-1.5.0-sun-1.5.0.01-3jpp.nosrc.rpm
      cp $Prerequisitedirectory/jdk-1_5_0_01-linux-i586.bin /usr/src/redhat/SOURCES
      chmod +x /usr/src/redhat/SOURCES/jdk-1_5_0_01-linux-i586.bin
      cd  /usr/src/redhat/SPECS
      rpmbuild -ba java-1.5.0-sun.spec
      rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-1.5.0.01-3jpp.i586.rpm
      rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.01-3jpp.i586.rpm
      rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-src-1.5.0.01-3jpp.i586.rpm
      rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-demo-1.5.0.01-3jpp.i586.rpm
      rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-plugin-1.5.0.01-3jpp.i586.rpm
##     rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-fonts-1.5.0.01-3jpp.i586.rpm
##     rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-alsa-1.5.0.01-3jpp.i586.rpm
##     rpm -Uvh  /usr/src/redhat/RPMS/i586/java-1.5.0-sun-jdbc-1.5.0.01-3jpp.i586.rpm
# Build JTA
      echo "Building and installing JTA ...."
      #The nosrc.rpm just creates the required /usr/src/redhat/SPEC file
      rpm -Uvh $Installdirectory/java-apps/jta-1.0.1-0.b.4jpp.nosrc.rpm
      cp $Prerequisitedirectory/jta-1_0_1B-classes.zip /usr/src/redhat/SOURCES
      cp $Prerequisitedirectory/jta-1_0_1B-doc.zip /usr/src/redhat/SOURCES
      cd  /usr/src/redhat/SPECS
      rpmbuild -ba jta.spec
      rpm -Uvh  /usr/src/redhat/RPMS/noarch/jta-1.0.1-0.b.4jpp.noarch.rpm
      rpm -Uvh  /usr/src/redhat/RPMS/noarch/jta-javadoc-1.0.1-0.b.4jpp.noarch.rpm
# Build Javamail
      echo "Building and installing Javamail ...."
      #The nosrc.rpm just creates the required /usr/src/redhat/SPEC file
      rpm -Uvh $Installdirectory/java-apps/javamail-1.3.2-1jpp.nosrc.rpm
      cp $Prerequisitedirectory/javamail-1_3_2.zip /usr/src/redhat/SOURCES
      cd  /usr/src/redhat/SPECS
      rpmbuild -ba javamail.spec
      rpm -Uvh /usr/src/redhat/RPMS/noarch/javamail-1.3.2-1jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/javamail-manual-1.3.2-1jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/javamail-javadoc-1.3.2-1jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/javamail-demo-1.3.2-1jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/javamail-monolithic-1.3.2-1jpp.noarch.rpm
# Build JAF
      echo "Building and installing JAF .... "
      #The nosrc.rpm just creates the required /usr/src/redhat/SPEC file
      rpm -Uvh $Installdirectory/java-apps/jaf-1.0.2-4jpp.nosrc.rpm
      cp $Prerequisitedirectory/jaf-1_0_2-upd.zip /usr/src/redhat/SOURCES
      cd  /usr/src/redhat/SPECS
      rpmbuild -ba jaf.spec
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jaf-1.0.2-4jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jaf-manual-1.0.2-4jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jaf-javadoc-1.0.2-4jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jaf-demo-1.0.2-4jpp.noarch.rpm
# Build JMX
      echo "Building and installing JMX .... "
      #The nosrc.rpm just creates the required /usr/src/redhat/SPEC file
      rpm -Uvh $Installdirectory/java-apps/jmx-1.2.1-1jpp.nosrc.rpm
      cp $Prerequisitedirectory/jmx-1_2_1-ri.zip /usr/src/redhat/SOURCES
      cd  /usr/src/redhat/SPECS
      rpmbuild -ba jmx.spec
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jmx-1.2.1-1jpp.noarch.rpm
      rpm -Uvh /usr/src/redhat/RPMS/noarch/jmx-javadoc-1.2.1-1jpp.noarch.rpm
#
      echo "Installing ANT ...."
      rpm -Uvh $Installdirectory/java-apps/ant-1.6.2-3jpp.noarch.rpm
#
      echo "Installing JAVA support modules .... "
      cd $Installdirectory/java-apps
      rpm -Uvh servletapi5-5.0.18-1jpp_3fc.noarch.rpm
      rpm -Uvh jakarta-commons-beanutils-1.7.0-2jpp.noarch.rpm
      rpm -Uvh jakarta-commons-collections-3.1-1jpp.noarch.rpm
      rpm -Uvh jakarta-commons-digester-1.6-2jpp.noarch.rpm
      rpm -Uvh jakarta-commons-daemon-1.0-2jpp.noarch.rpm
      rpm -Uvh jakarta-commons-dbcp-1.2.1-3jpp.noarch.rpm
      rpm -Uvh jakarta-commons-pool-1.2-2jpp.noarch.rpm
      rpm -Uvh jakarta-commons-el-1.0-3jpp.noarch.rpm
      rpm -Uvh servletapi5-5.0.18-1jpp_3fc.noarch.rpm
      rpm -Uvh jakarta-commons-fileupload-1.0-3jpp.noarch.rpm
      rpm -Uvh jakarta-commons-launcher-0.9-3jpp.noarch.rpm
      rpm -Uvh jakarta-commons-logging-1.0.4-2jpp.noarch.rpm
      rpm -Uvh xml-commons-resolver-1.1-3jpp.noarch.rpm
      rpm -Uvh xerces-j2-2.6.2-4jpp.noarch.rpm
      rpm -Uvh xalan-j2-2.6.0-2jpp.noarch.rpm
      rpm -Uvh jakarta-commons-modeler-1.1-3jpp.noarch.rpm
      rpm -Uvh jakarta-commons-discovery-0.2-2jpp.noarch.rpm
      rpm -Uvh xml-commons-1.0-0.b2.7jpp.noarch.rpm
      rpm -Uvh xml-commons-apis-1.0-0.b2.7jpp.noarch.rpm
      rpm -Uvh junit-3.8.1-4jpp.noarch.rpm
      rpm -Uvh log4j-1.2.8-8jpp.noarch.rpm
      rpm -Uvh wsdl4j-1.4-3jpp.noarch.rpm
      rpm -Uvh axis-1.1-3jpp.noarch.rpm
      rpm -Uvh regexp-1.3-2jpp.noarch.rpm
      rpm -Uvh bcel-5.1-5jpp.noarch.rpm
      rpm -Uvh mx4j-2.0.1-2jpp.noarch.rpm
      rpm -Uvh tyrex-1.0.1-2jpp.noarch.rpm
      rpm -Uvh tomcat5-servlet-2.4-api-5.0.30-6jpp.noarch.rpm
      rpm -Uvh tomcat5-jasper-5.0.30-6jpp.noarch.rpm
      rpm -Uvh tomcat5-5.0.30-6jpp.noarch.rpm
      break;;
    [nN] ) echo "Skipping installation of Java and Java modules" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo "That's Java and the Java modules installed!"
echo ""

new
####################################
# Configure and build Open-Xchange #
####################################

while true; do
  echo -n "Do you want to install Open-Xchange (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )
      echo ""
      echo "Creating a new Postgres database and user ...."
      echo "When asked for a password, enter xyzzy."
      echo "This is only for development and the password xyzzy is hard coded later!!"
      echo ""
      /usr/sbin/adduser ox
      su - postgres -c "dropdb openexchange"
      su - postgres -c "dropuser openexchange"
      su - postgres -c "createuser -A -D -P openexchange"
      su - postgres -c "createdb openexchange"
#
      cd $Installdirectory/ox-pkgs
      tar -zxvf open-xchange-0.7.5.tar.gz
      cd open-xchange.0.7.5
#
      export ANT_HOME=/usr/local/ant
      export JAVA_HOME="/usr/lib/jvm/java"
      export PATH=${PATH}:${ANT_HOME}/bin
      export OX_INSTALL=/usr/local/ox

      ./configure \
      --prefix=$OX_INSTALL \
      --with-dbpass="xyzzy" \
      --with-mailjar=/usr/share/java/javamail.jar \
      --with-activationjar=/usr/share/java/activation.jar \
      --with-jdomjar=/usr/share/java/jdom.jar \
      --with-xercesjar=/usr/share/java/xerces-j2.jar \
      --with-jsdkjar=/usr/share/java/servletapi5.jar \
      --with-jdbcjar=/usr/share/java/postgresql.jar \
      --enable-webdav \
      --with-runuid=ox \
      --with-rungid=ox
      make
      make install
      cp /usr/local/ox/share/perl/login.* /home/e-smith/files/ibays/Primary/cgi-bin/
      break;;
    [nN] ) echo "Skipping installation of Open-Xchange" ; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo "That's the Open-Xchange built!!  We're not finished yet"
echo "but you might like to us a web browser to visit"
echo "  http://<your-server>/cgi-bin/login.pl  and see if you get a login screen"
echo "before you continue."
echo ""
while true; do
  echo -n "Do you want to continue (Y/N) ?"
  read yn
  case $yn in
    y* | Y* )      break;;
    [nN] ) echo "Terminating at user request" ; exit; break;;
    * ) echo "Unrecognised response. Try again" ;;
  esac
done

echo "Doing post installation stuff ...."
echo ""

cd /var/lib/tomcat5/webapps
if [ -e "servlet" ]
then
  rm -R servlet/*
  rmdir servlet
fi
mkdir servlet
mkdir servlet/WEB-INF
mkdir servlet/WEB-INF/classes
mkdir servlet/WEB-INF/lib
cd servlet/WEB-INF/
cp $OX_INSTALL/share/servlets/*.class classes/
cp $OX_INSTALL/lib/* lib/
cp /OpenXchange-install/ox-pkgs/open-xchange.0.7.5/system/servlet/web.xml /var/lib/tomcat5/webapps/servlet/WEB-INF
service tomcat5 restart
#
echo "Now, go to the URL http://myhost:8080/servlet/intranet. You should see a message"
echo "\"No running Server found\". This means that all is OK."
echo "Otherwise, try to have a look at the Manager: http://myhost:8080/manager/html"
echo "To be able to pass the login prompt, you have to edit the file"
echo "/etc/tomcat5/tomcat-users.xml and add a line like this:"
echo "<user username=\"themanager\" password=\"thepassword\" roles=\"manager\">"
echo ""
echo -n "When you've tried this, hit any key to continue ..."
read yn
#
echo ""
echo "Installing mod_jk ..."

cp /usr/share/doc/mod_jk-ap20-1.2.5/workers.properties.sample /etc/httpd/conf/workers.properties
cp /usr/share/doc/mod_jk-ap20-1.2.5/mod_jk.conf.sample /etc/httpd/conf/mod_jk.conf
echo "JkMount /servlet/* ajp13" >> /etc/httpd/conf/mod_jk.conf
echo "JkMount /servlet/webdav.contacts/* ajp13" >> /etc/httpd/conf/mod_jk.conf
service httpd restart
#
echo "You should now be able to go to the URL http://myhost/servlet/intranet"
echo "and again obtain \"No running server found\"
echo ""
echo -n "When you've tried this, hit any key to continue ..."
read yn
echo ""
echo "Updating the Postgres database ..."
psql -dopenexchange -h localhost -Uopenexchange -W -f $OX_INSTALL/share/init_database.sql
touch temp.sql
echo "INSERT INTO sys_gen_rights_template values " > temp.sql
echo "('now','admin','now','','default_template','y','y','y','y'," >> temp.sql
echo "'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y'," >> temp.sql
echo "'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y'," >> temp.sql
echo "'y','y','y','y','y','y','y','y','y','y','y','y','y');" >> temp.sql
psql -dopenexchange -h localhost -Uopenexchange -W -f temp.sql
rm temp.sql
#
#
echo "That is as far as I had time for.  Post installation and configuration"
echo "still needs to be done to get this whole thing working"
echo ""
echo "Any volunteers??"