[Kroupware] build & install script for Kolab 1.0

Bernhard Erdmann be at berdmann.de
Sun Jul 27 11:53:05 CEST 2003


Hi,

here's a script (build-install-kolab) for building and installing Kolab 1.0.

It uses sudo to execute /kolab/bin/rpm as user root:

/etc/sudoers:
kolab   ALL=(ALL)       NOPASSWD: /kolab/bin/rpm

The QIM 
(ftp://ftp.kde.org/pub/kde/unstable/server/kolab/kolab-1.0/src/QIM) has 
some errors:

Some required packages are missing:
perl-openpkg
sed
libiconv
gettext
imap

One "-" is missing:
rpm -ba postfix.spec --define 'with_sasl yes' \
	 -define 'with_tls yes' --define 'with_ldap yes'

In the subdir imapd is no file kolab.patch and "//" is no comment in bash:
patch < kolab.patch // patch for imapd.spec file and groupfile
rpm -ba imapd.spec --define 'with_groupfile_hack yes' \
	--define 'with_vhost_hack yes'

-------------- next part --------------
#!/bin/sh

cd /kolab/RPM/SRC || exit 1
(cat << EOF
make
patch
binutils
gcc
procmail
zlib
expat
readline
perl
perl-openpkg
perl-ds
perl-time
perl-xml
perl-term
perl-crypto
perl-conv
perl-ssl
perl-sys
perl-util
perl-mail
perl-net
perl-www
perl-ldap 
openssl
m4
bison
flex
pcre
fsl
gdbm
db
mm
sed
libiconv
gettext
imap
EOF
) | \
while read package; do
    if [ ! -f /kolab/RPM/PKG/${package}-[0-9]*.rpm ]; then
	(cd $package && rpm -bb ${package}.spec) && \
	sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}-[0-9]*.rpm
	retval=$?
	[ $retval -ne 0 ] && exit $retval
    else
	echo skipping $package
    fi
done

package=openldap
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd openldap && rpm -ba ${package}.spec --define 'with_sasl no') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=sasl
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd sasl && rpm -ba ${package}.spec --define 'with_ldap yes') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=postfix
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd postfix && rpm -ba ${package}.spec --define 'with_sasl yes' \
	--define 'with_tls yes' --define 'with_ldap yes') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=imapd
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd imapd && rpm -ba ${package}.spec --define 'with_groupfile_hack yes' \
	--define 'with_vhost_hack yes') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=apache
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd gdbm && tar xzf gdbm-1.8.3.tar.gz && \
     cp /kolab/RPM/SRC/gdbm/gdbm-1.8.3/ndbm.h /kolab/include) && \
    (cd apache && rpm -ba ${package}.spec --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') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=proftpd
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd proftpd && rpm -ba ${package}.spec --define 'with_ldap yes') && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi

package=kolab
if [ ! -f /kolab/RPM/PKG/${package}*kol.rpm ]; then
    (cd kolab && rpm -ba ${package}.spec) && \
    sudo /kolab/bin/rpm -Uhv /kolab/RPM/PKG/${package}*kol.rpm
    retval=$?
    [ $retval -ne 0 ] && exit $retval
else
    echo skipping $package
fi


More information about the Kroupware mailing list