[Kroupware] build script for kolab server available

Holger Schröder kroupware@mail.kde.org
Sat, 29 Mar 2003 19:23:48 +0100


--Boundary-00=_0Seh+wSUbeqPwmm
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

i created a kolab build script, because i think the kolab installation is 
still too much work.

it does more or less what is mentioned in the QIM. it works for me on a gentoo 
linux system.

when you want to use this script, place it in the same directory as your 
downloaded sources, make it executable, and as root execute it with

./buildkolab.sh

for the script to work, the /kolab directory must not exist already, otherwise 
it does not reinstall the stuff, that is already there, and that can mess 
things up.

when you want to put it up on the kolab website, so that installation will 
become easier for the users, feel free to do so.

comments and suggestions are welcome.

Holger
 
--Boundary-00=_0Seh+wSUbeqPwmm
Content-Type: application/x-shellscript;
  name="buildkolab.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="buildkolab.sh"

#!/bin/bash

echo Hi, this is a kolab build script...
echo
echo this script will install the server into the 
echo /kolab directory. make sure that this directory does not
echo exist already, as that can interfere with the 
echo installation.
echo
echo this script must be run as root, if you do not trust it,
echo read the script and do exactly what it does by hand.
echo the compile steps can be done by normal users, only the
echo install steps must be done as root...
echo
echo Continue \? \(yes/no\)

read answer
if [ "x$answer" != "xyes" ]; then exit 1; fi

echo in which directory are the source files \? [$PWD]

read sourcedir

if [ "x$sourcedir" = "x" ]; then sourcedir=$PWD; fi
echo sourcedir: $sourcedir

if [ ! -f $sourcedir/openpkg-1.2.0-1.2.0.src.sh ]; then
    echo openpkg-1.2.0-1.2.0.src.sh not found, exiting...
    exit 1
fi

cd $sourcedir

if [ ! -f "$sourcedir/openpkg-1.2.0-1.2.0.ix86-linux2.4-kol.sh" ]; then
    mycmd="sh openpkg-1.2.0-1.2.0.src.sh \
	--prefix=/kolab --user=kolab --group=kolab"
    echo $mycmd
    $mycmd
fi

if [ ! -d /kolab ]; then
    echo installing openpkg into /kolab...
    mycmd="bash $sourcedir/openpkg-1.2.0-1.2.0.ix86-linux2.4-kol.sh"
    echo $mycmd
    $mycmd
    
fi

echo starting building the rpms...

for prog in make patch binutils gcc procmail zlib expat readline \
	perl perl-ds perl-time perl-xml perl-term perl-crypto \
	perl-conv openssl perl-ssl perl-sys perl-util perl-mail perl-net \
	perl-www perl-ldap m4 bison flex pcre fsl gdbm db mm \
	openldap sasl postfix imapd apache proftpd monit kolab ; do
    exists=`/kolab/bin/rpm -q $prog | grep -v "not installed"`
    echo exists: $exists
    
    PATH=/kolab/bin:$PATH
    
    if [ "x$exists" = "x" ]; then
        echo installing the $prog program sources...
        mycmd="/kolab/bin/rpm -ivh $sourcedir/$prog*.src.rpm"
        echo $mycmd
        $mycmd || exit 1
        cd /kolab/RPM/SRC/$prog
	if [ "$prog" = "apache" ]; then
##            mycmd="/kolab/bin/rpm -ba $prog.spec  \
##		    --define 'with_mod_ssl yes' \
##		    --define 'with_mod_php yes' \
##	            --define 'with_mod_dav yes' \
##		    --define 'with_mod_auth_ldap yes' \
##		    --define 'with_mod_php_openldap yes' "

## some problems with quoting or so, but this way
## works...
	    /kolab/bin/rpm -ba $prog.spec  \
		    --define 'with_mod_ssl yes' \
		    --define 'with_mod_php yes' \
	            --define 'with_mod_dav yes' \
		    --define 'with_mod_auth_ldap yes' \
		    --define 'with_mod_php_openldap yes' || exit 1
	    ##echo $mycmd
	else
            mycmd="/kolab/bin/rpm -bb $prog.spec"
            echo $mycmd
            $mycmd || exit 1
	fi
    #install it
        mycmd="/kolab/bin/rpm -Uhv /kolab/RPM/PKG/$prog*.ix86-linux2.4-kol.rpm"
        echo $mycmd
        $mycmd || exit 1
    #delete tmp files
	rm -r /kolab/RPM/TMP/*
    fi

done
echo
echo the kolab server should be installed successfully now...
echo to start the server execute 
echo /kolab/etc/rc.d/rc.monit start
echo
echo of course no other servers should be running, which already
echo use the ports for mail or http or so...
echo
echo then you can connect to the monitoring process on 
echo http://localhost:2812 with user kolab and password monit
echo
echo to connect to the administration server connect to
echo https://localhost/ with username manager. the password is
echo in the file /kolab/etc/kolab/kolab.conf in the line beginning
echo with bind_pw.
echo
cat /kolab/etc/kolab/kolab.conf |grep bind_pw
echo
echo Enjoy !


--Boundary-00=_0Seh+wSUbeqPwmm--