# needs to be changed to the position of the downloaded files from erfrakon
kolabinstall=/home/timop/kolab
function compAndInstall()
{
# compiles an rpm from source, as user kolab.
# then installs that new rpm as user root
PACKAGE=$1
VERSION=$2
DEFINE=$3
cmd="export PATH=/kolab/bin:/kolab/sbin:$PATH; cd /kolab/RPM/SRC/"$PACKAGE"; "
if [ -z "$3" ]
then
cmd=$cmd"rpm -bb "$PACKAGE".spec"
else
cmd=$cmd"rpm -ba "$PACKAGE".spec "$DEFINE
fi
su - kolab --command="$cmd"
export PATH=/kolab/bin:/kolab/sbin:$PATH
/kolab/bin/rpm -Uhv /kolab/RPM/PKG/$PACKAGE-$VERSION.ix86-linux2.4-kol.rpm
}
# some preparation to have enough diskspace (our / partition is not big enough)
mkdir /usr/local/kolab
ln -s /usr/local/kolab /kolab
mv /tmp /usr/local/kolab/tmp
ln -s /usr/local/kolab/tmp/ /tmp
# bootstrap openpkg
ln -s $kolabinstall /kolabsrc
mkdir /kolab/install
cd /kolab/install
sh $kolabinstall/openpkg-20030606-20030606.src.sh --prefix=/kolab --user=kolab --group=kolab 2>&1 | tee kolab.log
sh -x ./openpkg-20030606-20030606.ix86-linux2.4-kol.sh
# install the src rpms
su - kolab --command="export PATH=/kolab/bin:/kolab/sbin:$PATH; cd /kolabsrc; rpm -ihv *.src.rpm"
# compile and install the required packages
compAndInstall "make" "3.80-20030109"
compAndInstall "patch" "2.5.9-20030520"
compAndInstall "binutils" "2.14-20030613"
compAndInstall "gcc" "3.3-20030614"
compAndInstall "fsl" "1.1.0-20030522"
compAndInstall "procmail" "3.22-20030330"
compAndInstall "zlib" "1.1.4-20030227"
compAndInstall "expat" "1.95.6-20030130"
compAndInstall "readline" "4.3-20020718"
compAndInstall "ncurses" "5.3.20030614-20030615"
compAndInstall "perl" "5.8.0-20030409"
compAndInstall "perl-openpkg" "20030515-20030515"
compAndInstall "openssl" "0.9.7b-20030530"
compAndInstall "perl-ds" "20030123-20030123"
compAndInstall "perl-time" "20030325-20030325"
compAndInstall "perl-xml" "20030614-20030614"
compAndInstall "perl-term" "20030411-20030411"
compAndInstall "perl-crypto" "20030309-20030309"
compAndInstall "perl-conv" "20030513-20030513"
compAndInstall "perl-ssl" "20030614-20030614"
compAndInstall "perl-sys" "20030612-20030612"
compAndInstall "perl-util" "20030610-20030610"
compAndInstall "perl-mail" "20030521-20030521"
compAndInstall "perl-net" "20030614-20030614"
compAndInstall "perl-www" "1.2.1-1.2.1"
compAndInstall "perl-ldap" "20030520-20030520"
compAndInstall "m4" "1.4o-20020206"
compAndInstall "bison" "1.35-20030604"
compAndInstall "sed" "4.0.7-20030411"
compAndInstall "libiconv" "1.9.1-20030529"
compAndInstall "gettext" "0.12.1-20030528"
compAndInstall "imap" "2002d-20030530"
compAndInstall "getopt" "20030307-20030609"
compAndInstall "flex" "2.5.4a-20030402"
compAndInstall "pcre" "4.3-20030530"
compAndInstall "db" "4.1.25.1-20030605"
compAndInstall "mm" "1.3.0-20030307"
compAndInstall "gdbm" "1.8.3-20030213" "--define 'with_ndbm yes'"
compAndInstall "openldap" "2.1.21-20030609" "--define 'with_sasl no'"
compAndInstall "sasl" "2.1.13-20030530_kolab" "--define 'with_ldap yes' --define 'with_login yes'"
compAndInstall "postfix" "2.0.12-20030617" "--define 'with_sasl yes' --define 'with_tls yes' --define 'with_ldap yes'"
compAndInstall "imapd" "2.1.14-20030707_kolab" "--define 'with_groupfile_hack yes' --define 'with_vhost_hack yes'"
#compAndInstall "apache" "1.3.27-20030611" "--define 'with_mod_ssl yes' --define 'with_mod_dav yes' --define 'with_mod_auth_ldap yes' --define 'with_mod_php_openldap yes' --define 'with_mod_php_imap yes' --define 'with_mod_php yes' --define 'with_mod_php_gettext yes' --define 'with_gdbm yes' --define 'with_ndbm yes'"
compAndInstall "apache" "1.3.27-20030611" "--define 'with_mod_ssl yes' --define 'with_mod_dav yes' --define 'with_mod_auth_ldap yes' --define 'with_mod_php_openldap yes' --define 'with_mod_php_imap yes' --define 'with_mod_php yes' --define 'with_mod_php_gettext yes' --define 'with_gdbm_ndbm yes'
compAndInstall "proftpd" "1.2.8-20030609" "--define 'with_ldap yes'"
compAndInstall "kolab" "1.0-1.0.12" " "
# clean up
rm /tmp
mv /usr/local/kolab/tmp /tmp
rm /kolabsrc
rm -Rf /kolab/install
/sbin/chkconfig httpd off
/sbin/service httpd stop
# copy some prepared config files
cp kolab.init /etc/init.d/kolab
chmod a+x /etc/init.d/kolab
cp S65.internal.kolab /etc/om-firewall.d
chmod u+x /etc/om-firewall.d/S65.internal.kolab
cp proftpd.conf.template /kolab/etc/kolab
cp kolab.rc /kolab/etc/rc.d
chmod o+rx /kolab/etc/kolab
/kolab/etc/kolab/kolab_bootstrap -b
/kolab/etc/rc.d/rc.kolab start
/etc/init.d/om-firewall restart
/etc/init.d/kolab restart
echo "The compiled packages are in /kolab/RPM/PKG/*kol.rpm"
echo "building and installing of kolab finished."
# needs to be changed to the position of the compiled files from whereever you got them
kolabinstall=/home/timop/kolab
# some preparation to have enough diskspace (our / partition is not big enough)
mkdir /usr/local/kolab
ln -s /usr/local/kolab /kolab
# bootstrap openpkg
sh -x ./openpkg-20030606-20030606.ix86-linux2.4-kol.sh
# install the required packages
export PATH=/kolab/bin:/kolab/sbin:$PATH
/kolab/bin/rpm -Uhv make-*-kol.rpm
/kolab/bin/rpm -Uhv patch-*-kol.rpm
/kolab/bin/rpm -Uhv binutils-*-kol.rpm
/kolab/bin/rpm -Uhv gcc-*-kol.rpm
/kolab/bin/rpm -Uhv procmail-*-kol.rpm
/kolab/bin/rpm -Uhv zlib-*-kol.rpm
/kolab/bin/rpm -Uhv expat-*-kol.rpm
/kolab/bin/rpm -Uhv readline-*-kol.rpm
/kolab/bin/rpm -Uhv openssl-*-kol.rpm
/kolab/bin/rpm -Uhv perl-*-kol.rpm
#/kolab/bin/rpm -Uhv perl-openpkg*-kol.rpm
#/kolab/bin/rpm -Uhv perl-conv*-kol.rpm
#/kolab/bin/rpm -Uhv perl-ssl*-kol.rpm
#/kolab/bin/rpm -Uhv perl-ds*-kol.rpm
#/kolab/bin/rpm -Uhv perl-time*-kol.rpm
#/kolab/bin/rpm -Uhv perl-util*-kol.rpm
#/kolab/bin/rpm -Uhv perl-mail*-kol.rpm
#/kolab/bin/rpm -Uhv perl-net*-kol.rpm
#/kolab/bin/rpm -Uhv perl-term*-kol.rpm
#/kolab/bin/rpm -Uhv perl-sys*-kol.rpm
#/kolab/bin/rpm -Uhv perl-crypto*-kol.rpm
#/kolab/bin/rpm -Uhv perl-www*-kol.rpm
#/kolab/bin/rpm -Uhv perl-xml*-kol.rpm
#/kolab/bin/rpm -Uhv perl-ldap*-kol.rpm
/kolab/bin/rpm -Uhv m4-*-kol.rpm
/kolab/bin/rpm -Uhv bison-*-kol.rpm
/kolab/bin/rpm -Uhv sed-*-kol.rpm
/kolab/bin/rpm -Uhv libiconv-*-kol.rpm
/kolab/bin/rpm -Uhv gettext-*-kol.rpm
/kolab/bin/rpm -Uhv imap-*-kol.rpm
/kolab/bin/rpm -Uhv getopt-*-kol.rpm
/kolab/bin/rpm -Uhv flex-*-kol.rpm
/kolab/bin/rpm -Uhv pcre-*-kol.rpm
/kolab/bin/rpm -Uhv fsl-*-kol.rpm
/kolab/bin/rpm -Uhv gdbm-*-kol.rpm
/kolab/bin/rpm -Uhv db-*-kol.rpm
/kolab/bin/rpm -Uhv mm-*-kol.rpm
/kolab/bin/rpm -Uhv ncurses-*-kol.rpm
/kolab/bin/rpm -Uhv openldap*kol.rpm
/kolab/bin/rpm -Uhv sasl*kol.rpm
/kolab/bin/rpm -Uhv postfix*kol.rpm
/kolab/bin/rpm -Uhv imapd*kol.rpm
/kolab/bin/rpm -Uhv apache*kol.rpm
/kolab/bin/rpm -Uhv proftpd*kol.rpm
/kolab/bin/rpm -Uhv kolab*kol.rpm
/sbin/chkconfig httpd off
/sbin/service httpd stop
# copy some prepared config files
cp kolab.init /etc/init.d/kolab
chmod a+x /etc/init.d/kolab
cp S65.internal.kolab /etc/om-firewall.d
chmod u+x /etc/om-firewall.d/S65.internal.kolab
cp proftpd.conf.template /kolab/etc/kolab
cp kolab.rc /kolab/etc/rc.d
chmod o+rx /kolab/etc/kolab
/kolab/etc/kolab/kolab_bootstrap -b
/kolab/etc/rc.d/rc.kolab start
/etc/init.d/om-firewall restart
/etc/init.d/kolab restart
echo "installing of kolab finished."