[Kolab-devel] Kolab Build Scripts

Maarten Stolte maarten.stolte at papuaos.org
Wed May 28 13:34:57 CEST 2003


Hello,

Would it be possible to facilitate the Redhat specific things inhere
like the LANG settings?

Maarten

On Wed, 2003-05-28 at 13:59, Stephan Buys wrote:

> Hi,
> 
> After a couple of hours of hacking and testing I am pleased to release the 
> following scripts to the list.
> 
> buildkolab.sh
> ---------------
> 
> This script now supports fetching the necesarry files from OpenPKG ftp and
> anonymous CVS (via getpackages.sh). It then proceeds to build and install
> the packages as well as bootstraps the server.
> 
> This was tested once with my Gentoo box this morning so I expect a lot of
> improvements as well as bugs.
> 
> getpackages.sh
> -----------------
> 
> This script will retrieve the latest files that we are interested in from CVS
> and OpenPKG. 
> 
> 
> Adminstrative:
> 1) In order for the whole system to build as stated above I need to commit the
> changes below to CVS. 
> 2) I need to add getpackages.sh to CVS, can I go ahead and do this?
> 3) What about a tools folder in CVS or something similar so that we can keep
> all the utility scripts together?
> 
> Regards,
> Stephan 
> 
> 
> 
> 
> cvs server: Diffing .
> cvs server: Diffing apache
> Index: apache/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/apache/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 Makefile
> --- apache/Makefile     27 May 2003 14:38:40 -0000      1.5
> +++ apache/Makefile     28 May 2003 10:02:45 -0000
> @@ -1,12 +1,19 @@
> -
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
> 
>  all:
> 
> -       rpm -ihv $(KOLABPKGURI)/apache-1.3.27-20030516.src.rpm --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'
> -       rpm -ba apache.spec
> +       rpm -ihv $(KOLABPKGURI)/apache-1.3.27-20030516.src.rpm
> +       cd $(KOLABRPMSRC)/apache && rpm -ba apache.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'
> +
> 
>  clean:
>         rm -rf /kolab/RPM/TMP/apache* apache* mod* php* rc*
> cvs server: Diffing db
> Index: db/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/db/Makefile,v
> retrieving revision 1.2
> diff -u -p -u -r1.2 Makefile
> --- db/Makefile 27 May 2003 14:38:41 -0000      1.2
> +++ db/Makefile 28 May 2003 10:02:45 -0000
> @@ -1,11 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> 
>  all:
>         rpm -i $(KOLABPKGURI)/db-4.1.25.1-20030323.src.rpm
> -       patch < kolab.patch
> -       rpm -bb db.spec
> +       cd $(KOLABRPMSRC)/db && patch < $(KOLABCVSDIR)/server/db/kolab.patch && rpm -bb db.spec
> 
>  clean:
>         rm -rf /kolab/RPM/TMP/db* db* patch.*
> cvs server: Diffing doc
> Index: doc/buildkolab.sh
> ===================================================================
> RCS file: /kolabrepository/server/doc/buildkolab.sh,v
> retrieving revision 1.8
> diff -u -p -u -r1.8 buildkolab.sh
> --- doc/buildkolab.sh   26 May 2003 20:34:46 -0000      1.8
> +++ doc/buildkolab.sh   28 May 2003 10:02:45 -0000
> @@ -6,37 +6,60 @@
>  #
>  # There is currently no support for a $prefix other than /kolab
>  #
> -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.
> +
> +#Setup defaults
> +KOLABDIR=/kolab
> +scriptdir=$PWD
> +
> +echo Kolab Bootstrap Script...
>  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 and the install steps must be as root.
> +echo Target: $KOLABDIR
> +echo Name  : `hostname -f`
>  echo
> -echo Continue \? \(yes/no\)
> 
> -read answer
> -if [ "x$answer" != "xyes" ]; then exit 1; fi
> -
> -# abfrage wget !!!
> +if [ "$EUID" != "0" ]; then
> +   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 and the install steps must be as root.
> +   exit 1;
> +fi
> 
> -echo in which directory can we temporarily download openpkg files \? [$PWD]
> +#Do some basic checks
> 
> +# abfrage wget !!!
> +echo Please specify your source directory: [$PWD]
>  read sourcedir
> 
>  if [ "x$sourcedir" = "x" ]; then sourcedir=$PWD; fi
>  echo sourcedir: $sourcedir
> 
> +echo "Please specify your local CVS directory (If empty sourcecode will be checked out anonymously): [$PWD]"
> +read cvsdir
> +
> +if [ "x$cvsdir" = "x" ]; then cvsdir=$PWD; fi
> +echo cvsdir: $cvsdir
> +
> +#set up environment for Makefiles
> +export KOLABPKGURI=$sourcedir
> +export KOLABRPMSRC=/kolab/RPM/SRC
> +export KOLABCVSDIR=$cvsdir
> +
>  cd $sourcedir
> -wget -nv -c ftp://ftp.openpkg.org/current/SRC/openpkg-*.src.sh
> +
> +#Fetch all files:
> +if [ ! -f "$scriptdir/getpackages.sh" ]; then
> +  echo "getpackages.sh script missing from $scriptdir! continue? (y/n)"
> +  read ans
> +  if [ "x$ans" != "xy" ]; then exit 1; fi
> +else
> +  $scriptdir/getpackages.sh
> +fi
> +
>  OPKG=`ls openpkg-*.src.sh`
> 
>  OPKGSH=`ls openpkg-*-kol.sh`
> 
> +#Build the Kolab bootstrap script
>  if [ ! -f "$OPKGSH" ]; then
>      mycmd="sh $OPKG --prefix=/kolab --user=kolab --group=kolab"
>      echo $mycmd
> @@ -45,13 +68,26 @@ else
>      echo "there is already an openpkg installation script, continue..."
>  fi
> 
> +#Install the bootstrap script
>  if [ ! -d /kolab ]; then
>      echo installing openpkg into /kolab...
>      mycmd="sh $OPKGSH"
>      echo $mycmd
>      $mycmd
>  else
> -    echo "there is already an openpkg installation under /kolab, continue..."
> +    #If the directory exists check if it is empty.
> +    #This will allow more flexibility for people who want to use binding
> +    #and symlinks
> +    listing=`ls /kolab/*`
> +    echo $listing
> +    if [ "x$listing" = "x" ]; then
> +       #Directory is empty
> +       mycmd="sh $OPKGSH"
> +       echo $mycmd
> +       $mycmd
> +    else
> +      echo "there is already an openpkg installation under /kolab, continue..."
> +    fi
>  fi
> 
>  echo starting building the rpms...
> @@ -59,16 +95,15 @@ echo starting building the rpms...
>  for prog in make patch binutils gcc procmail zlib expat readline libiconv \
>         perl perl-openpkg 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 m4 bison flex pcre fsl gdbm db mm ncurses sed imap gettext ; do
> +       perl-www m4 bison flex pcre fsl gdbm mm ncurses sed imap gettext perl-ldap; do
>      exists=`/kolab/bin/rpm -q $prog | grep -v "not installed"`
>      echo exists: $exists
> 
>      PATH=/kolab/bin:$PATH
> 
>      if [ "x$exists" = "x" ]; then
> -        wget -P /kolab/RPM/PKG -nv -c ftp://ftp.openpkg.org/current/SRC/$prog-[0-9]*.src.rpm
>          echo building the program $prog ...
> -        mycmd="/kolab/bin/rpm --rebuild /kolab/RPM/PKG/$prog-[0-9]*.src.rpm"
> +        mycmd="/kolab/bin/rpm --rebuild $sourcedir/$prog-[0-9]*.src.rpm"
>          echo $mycmd
>          $mycmd || exit 1
>      #install it
> @@ -83,40 +118,43 @@ for prog in make patch binutils gcc proc
>  done
>  echo openpkg is now bootstrapped !
> 
> -exit
> +#exit
> +
> +cd $cvsdir
> +for prog in db openldap sasl postfix proftpd imapd apache kolab; do
> +    exists=`/kolab/bin/rpm -q $prog | grep -v "not installed"`
> +    echo exists: $exists
> 
> -cd /kolab/RPM/SRC
> -CVSROOT=:pserver:anonymous at intevation.de:/home/kroupware/jail/kolabrepository
> -for prog in openldap sasl postfix proftpd imapd apache monit kolab; do
> -    cvs co -d $prog server/$prog
> -    cd $prog && make
> -    cd -
> -    /kolab/bin/rpm -Uhv /kolab/RPM/PKG/$prog-[0-9]*-kol.rpm
> +    if [ "x$exists" = "x" ]; then
> +      cd server/$prog && make || exit 1
> +      cd -
> +      /kolab/bin/rpm -Uhv /kolab/RPM/PKG/$prog-[0-9]*-kol.rpm || exit 1
> +    else
> +      echo "PROGRAM $prog is already installed!"
> +    fi
>  done
> 
> -cd $sourcedir
> -wget -P /kolab/RPM/PKG -nv -c ftp://ftp.openpkg.org/current/SRC/perl-ldap-[0-9]*.src.rpm
> -echo building the program perl-ldap ...
> -mycmd="/kolab/bin/rpm --rebuild /kolab/RPM/PKG/perl-ldap-[0-9]*.src.rpm"
> -echo $mycmd
> -$mycmd || exit 1
> +#cd $sourcedir
> +#echo building the program perl-ldap ...
> +#mycmd="/kolab/bin/rpm --rebuild $sourcedir/perl-ldap-[0-9]*.src.rpm"
> +#echo $mycmd
> +#$mycmd || exit 1
>  #install it
> -mycmd="/kolab/bin/rpm -Uhv /kolab/RPM/PKG/perl-ldap-[0-9]*-kol.rpm"
> -echo $mycmd
> -$mycmd || exit 1
> +#mycmd="/kolab/bin/rpm -Uhv /kolab/RPM/PKG/perl-ldap-[0-9]*-kol.rpm"
> +#echo $mycmd
> +#$mycmd || exit 1
>  #delete tmp files
>  rm -rf /kolab/RPM/TMP/*
> 
>  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 Starting the bootstrap script...
> +cmd="/kolab/etc/kolab/kolab_bootstrap -b"
> +echo "($cmd)"
> +$cmd
>  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
> cvs server: Diffing doc/administration
> cvs server: Diffing doc/technical
> cvs server: Diffing imapd
> Index: imapd/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/imapd/Makefile,v
> retrieving revision 1.7
> diff -u -p -u -r1.7 Makefile
> --- imapd/Makefile      27 May 2003 14:38:41 -0000      1.7
> +++ imapd/Makefile      28 May 2003 10:02:45 -0000
> @@ -1,11 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> -
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
>  all:
>         rpm -ihv $(KOLABPKGURI)/imapd-2.1.13-20030502.src.rpm
> -       patch < kolab.patch
> -       rpm -ba imapd.spec --define 'with_groupfile_hack yes' --define 'with_vhost_hack yes'
> +       cd $(KOLABRPMSRC)/imapd && patch < $(KOLABCVSDIR)/server/imapd/kolab.patch && rpm -ba imapd.spec --define 'with_groupfile_hack yes' --define 'with_vhost_hack yes'
> 
>  clean:
>         rm -rf /kolab/RPM/TMP/cyrus-imapd* cyrus* imapd* rc.imapd vhosthack.patch fsl.imapd groupfile.patch
> cvs server: Diffing kolab
> Index: kolab/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/kolab/Makefile,v
> retrieving revision 1.7
> diff -u -p -u -r1.7 Makefile
> --- kolab/Makefile      18 May 2003 15:49:14 -0000      1.7
> +++ kolab/Makefile      28 May 2003 10:02:45 -0000
> @@ -1,6 +1,13 @@
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +
>  all:
> -       cd kolab && tar cvzf ../kolab-1.0.tar.gz *
> -       rpm -ba kolab.spec
> +       #test -d $(KOLABRPMSRC)/kolab && mkdir $(KOLABRPMSRC)/kolab
> +       test -d $(KOLABRPMSRC)/kolab || mkdir $(KOLABRPMSRC)/kolab
> +       cd kolab && tar cvzf $(KOLABRPMSRC)/kolab/kolab-1.0.tar.gz *
> +       cp Makefile rc.kolab kolab.spec $(KOLABRPMSRC)/kolab/
> +       cd $(KOLABRPMSRC)/kolab && rpm -ba kolab.spec
>  binary:
>         rpm -bB kolab.spec
> 
> cvs server: Diffing kolab/kolab
> cvs server: Diffing kolab/kolab/admin
> cvs server: Diffing kolab/kolab/admin/addressbook
> cvs server: Diffing kolab/kolab/admin/administrator
> cvs server: Diffing kolab/kolab/admin/expert
> cvs server: Diffing kolab/kolab/admin/include
> cvs server: Diffing kolab/kolab/admin/kolab
> cvs server: Diffing kolab/kolab/admin/login
> cvs server: Diffing kolab/kolab/admin/maintainer
> cvs server: Diffing kolab/kolab/admin/pics
> cvs server: Diffing kolab/kolab/admin/server
> cvs server: Diffing kolab/kolab/admin/service
> cvs server: Diffing kolab/kolab/admin/sharedfolder
> cvs server: Diffing kolab/kolab/admin/statistics
> cvs server: Diffing kolab/kolab/admin/user
> cvs server: Diffing kolab/tools
> cvs server: Diffing monit
> cvs server: Diffing openldap
> Index: openldap/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/openldap/Makefile,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 Makefile
> --- openldap/Makefile   27 May 2003 14:38:40 -0000      1.6
> +++ openldap/Makefile   28 May 2003 10:02:46 -0000
> @@ -1,10 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> -
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
>  all:
>         rpm -ihv $(KOLABPKGURI)/openldap-2.1.20-20030520.src.rpm
> -       rpm -ba openldap.spec --define 'with_sasl no'
> +       cd $(KOLABRPMSRC)/openldap && rpm -ba openldap.spec --define 'with_sasl no'
> 
>  clean:
>         rm -rf /kolab/RPM/TMP/openldap* openldap* rc.openldap
> cvs server: Diffing postfix
> Index: postfix/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/postfix/Makefile,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 Makefile
> --- postfix/Makefile    27 May 2003 14:38:41 -0000      1.6
> +++ postfix/Makefile    28 May 2003 10:02:46 -0000
> @@ -1,10 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> -
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
>  all:
>         rpm -ihv $(KOLABPKGURI)/postfix-2.0.10-20030524.src.rpm
> -       rpm -ba postfix.spec --define 'with_sasl yes' --define 'with_tls yes' --define 'with_ldap yes'
> +       cd $(KOLABRPMSRC)/postfix && rpm -ba postfix.spec --define 'with_sasl yes' --define 'with_tls yes' --define 'with_ldap yes'
>  clean:
>         rm -rf /kolab/RPM/TMP/postfix* etc.tar fsl.postfix pfixtls*.tar.gz pflogsum* postfix-*.patch postfix-*.tar.gz postfix.patch postfix.spec rc.postfix
> 
> cvs server: Diffing proftpd
> Index: proftpd/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/proftpd/Makefile,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 Makefile
> --- proftpd/Makefile    27 May 2003 14:38:41 -0000      1.6
> +++ proftpd/Makefile    28 May 2003 10:02:46 -0000
> @@ -1,11 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> -
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
>  all:
>         rpm -ihv $(KOLABPKGURI)/proftpd-1.2.8-20030328.src.rpm
> -       patch < kolab.patch
> -       rpm -ba proftpd.spec --define 'with_ldap yes'
> +       cd $(KOLABRPMSRC)/proftpd && patch < $(KOLABCVSDIR)/server/proftpd/kolab.patch && rpm -ba proftpd.spec --define 'with_ldap yes'
> 
>  clean:
>         rm -rf proftpd* rc.proftpd /kolab/RPM/TMP/proftpd* mod_ldap.patch
> cvs server: Diffing sasl
> Index: sasl/Makefile
> ===================================================================
> RCS file: /kolabrepository/server/sasl/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 Makefile
> --- sasl/Makefile       27 May 2003 14:38:41 -0000      1.5
> +++ sasl/Makefile       28 May 2003 10:02:46 -0000
> @@ -1,10 +1,16 @@
>  ifeq "x$(KOLABPKGURI)" "x"
>    KOLABPKGURI = ftp://ftp.openpkg.org/current/SRC
>  endif
> -
> +ifeq "x$(KOLABRPMSRC)" "x"
> +  KOLABRPMSRC = /kolab/RPM/SRC
> +endif
> +ifeq "x$(KOLABCVSDIR)" "x"
> +  KOLABCVSDIR = $(CURDIR)
> +endif
> +
>  all:
>         rpm -ihv $(KOLABPKGURI)/sasl-2.1.13-20030417.src.rpm
> -       rpm -ba sasl.spec --define 'with_ldap yes'
> +       cd $(KOLABRPMSRC)/sasl && rpm -ba sasl.spec --define 'with_ldap yes'
> 
>  clean:
>         rm -rf cyrus*.tar.gz fsl.sasl rc.sasl sasl.patch sasl.spec saslauthd.conf /kolab/RPM/TMP/cyrus-sasl*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kolab.org/pipermail/devel/attachments/20030528/f2243eea/attachment.html>


More information about the devel mailing list