[buildout] offline = false extends = ../../stack/slapos.cfg ../../component/git/buildout.cfg ../../component/autoconf/buildout.cfg ../../component/automake/buildout.cfg ../../component/libtool/buildout.cfg ../../component/pkgconfig/buildout.cfg ../../component/bison/buildout.cfg ../../component/flex/buildout.cfg ../../component/unzip/buildout.cfg ../../component/cmake/buildout.cfg ../../component/ncurses/buildout.cfg ../../component/bzip2/buildout.cfg ../../component/pcre/buildout.cfg ../../component/perl/buildout.cfg ../../component/perl-libwww-perl/buildout.cfg ../../component/perl-URI/buildout.cfg ../../component/sqlite3/buildout.cfg ../../component/pax/buildout.cfg ../../component/p7zip/buildout.cfg parts = check-ulimit slapos-cookbook directories jdk jdk-sources jdk-sources-policy jdk-sources-policy2 junit ant autoconf automake libtool pkgconfig bison flex unzip cmake ncurses bzip2 sqlite3 pax-download pax p7zip pcre perl perl-libwww-perl perl-URI zimbra-sources zimbra-sources-search-replace environment sh-environment junixsocket junixsocket-sources zimbra-build develop = /home/marco/src/slapos [check-ulimit] # /etc/security/limits.conf should contain something like: # * hard nofile 32768 # * soft nofile 32768 recipe = plone.recipe.command stop-on-error = true update-command = ${:command} command = ulimit -n 32768 [perl] # We need to build Perl with -fPIC, # in order to compile the Perl backend for openldap. # Using zimbra's provided perl would probably be a better option. configure-command = sh Configure -des \ -Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \ -Dsiteprefix=${:siteprefix} \ -Accflags='-fPIC' \ -Dcflags=-I${gdbm:location}/include \ -Dldflags="-L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib" \ -Ui_db \ -Dnoextensions=ODBM_File \ -Dusethreads [jdk-download] # hack to download java and policy files, bypassing javascript requirement recipe = plone.recipe.command location = ${buildout:parts-directory}/${:_buildout_section_name_} web-dirname = 7u15-b03 filename = jdk-7u15-linux-x64.tar.gz policy-filename = UnlimitedJCEPolicyJDK7.zip stop-on-error = True update = true command = mkdir -p ${:location} wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \ "http://download.oracle.com/otn-pub/java/jdk/${:web-dirname}/${:filename}" \ -O ${:location}/${:filename} wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \ http://download.oracle.com/otn-pub/java/jce/7/${:policy-filename} \ -O ${:location}/${:policy-filename} [jdk] # Uncompress the downloaded JDK recipe = hexagonit.recipe.download url = ${jdk-download:location}/${jdk-download:filename} md5sum = 118a16aab9ff2c3f7c7788658cc77734 strip-top-level-dir = True [jdk-sources] # copy the jdk tarball inside the build tree recipe = plone.recipe.command zimbra-target = ${zimbra-sources:location}/ThirdPartyBuilds/x86_64/java zimbra-filename = jdk1.7.0_15.tgz update-command = ${:command} command = mkdir -p ${:zimbra-target} cp ${jdk-download:location}/${jdk-download:filename} ${:zimbra-target}/${:zimbra-filename} # alternate spelling (the jdk is referenced with two different names) ln -s ${:zimbra-target}/${:zimbra-filename} ${:zimbra-target}/jdk-1.7.0_15.tgz #------------------------ # The policy files are looked for under two different paths. [jdk-sources-policy] # copy the java policy inside the build tree recipe = hexagonit.recipe.download url = ${jdk-download:location}/${jdk-download:policy-filename} destination = ${jdk-sources:zimbra-target}/jce strip-top-level-dir = True [jdk-sources-policy2] # copy the java policy inside the build tree recipe = hexagonit.recipe.download url = ${jdk-download:location}/${jdk-download:policy-filename} destination = ${jdk-sources:zimbra-target}/jce/UnlimitedJCEPolicy7/ strip-top-level-dir = True #------------------------ [junit] recipe = hexagonit.recipe.download filename = junit-4.8.2.jar url = http://zimbra.imladris.sk/download/jars/${:filename} md5sum = 8a498c3d820db50cc7255d8c46c1ebd1 download-only = True destination = ${zimbra-sources:location}/ZimbraCommon/jars [junixsocket] # build the native junixsocket library. the .jar parts are already inside the jars/ folder recipe = hexagonit.recipe.cmmi url = http://junixsocket.googlecode.com/files/junixsocket-1.3-src.tar.bz2 md5sum = fe249aba3bf568d71a5174506cf4ae80 configure-command = /bin/true make-binary = ${ant:location}/bin/ant make-targets = environment-dependency = ${environment:recipe} junit-path = ${junit:destination}/${junit:filename} pre-make-hook = ${:_profile_base_location_}/junixsocket-hooks.py:fix_build_xml post-make-hook = ${:_profile_base_location_}/junixsocket-hooks.py:install_library [junixsocket-sources] # copy the junixsocket library inside the build tree recipe = plone.recipe.command zimbra-target = ${zimbra-sources:location}/ThirdPartyBuilds/x86_64/java update-command = ${:command} command = mkdir -p ${:zimbra-target}/junixsocket cd ${:zimbra-target}/junixsocket tar --extract --bzip2 --file ${junixsocket:location}/junixsocket-1.3-bin.tar.bz2 --wildcards '*.so' --strip-components=2 [ant] recipe = hexagonit.recipe.download # latest releases # url = http://mirrors.linsrv.net/apache//ant/binaries/${:filename} url = http://archive.apache.org/dist/ant/binaries/${:filename} filename = apache-ant-1.9.0-bin.tar.gz md5sum = 8360ecbf5375769241abf7145954b62b strip-top-level-dir = True [zimbra-sources] # checkout the zimbra and thirt party sources. recipe = slapos.recipe.build:gitclone repository = http://git.erp5.org/repos/zimbra.git branch = authbind develop = True git-executable = ${git:location}/bin/git [zimbra-sources-search-replace] recipe = plone.recipe.command ZIMBRA_HOME = ${environment:ZIMBRA_HOME} PERL_BINARY = ${perl:location}/bin/perl stop-on-error = True update-command = ${:command} command = cd ${zimbra-sources:location} find . -name LocalConfig.java -exec sed -i 's#= FS + "opt" + FS + "zimbra"#= "${:ZIMBRA_HOME}"#g' {} \; # sixteen backslashes, yeah. ZIMBRA_HOME_WITH_BACKSLASHES=`echo $ZIMBRA_HOME | sed "s#/#\\\\\\\\\\\\\\\\/#g"` # for most cases: SUB1='s#/opt/zimbra#${:ZIMBRA_HOME}#g' # perl scripts shebang: SUB2='1{s|^#!/usr/bin/perl|#!${:PERL_BINARY}|}' # zmamavisdctl and friends: SUB3="s#\\\\/opt\\\\/zimbra#$ZIMBRA_HOME_WITH_BACKSLASHES#g" GROUP_NAME=`id -gn` USER_NAME=`id -un` # replace all remaining occurrences of /opt/zimbra find . -name '.git' -prune -o -type f -exec sed -i "$SUB1;$SUB2;$SUB3" {} \; # replace occurrences of zimbra users in config files # do not match the beginning of lines because escaping $ is easy to get wrong sed -i "s|daemon_user *= *'zimbra';|daemon_user = '$USER_NAME';|" ZimbraServer/conf/amavisd.conf.in sed -i "s|daemon_group *= *'zimbra';|daemon_group = '$GROUP_NAME';|" ZimbraServer/conf/amavisd.conf.in sed -i "s|UserID *zimbra:zimbra|UserID $USER_NAME:$GROUP_NAME|" ZimbraServer/conf/opendkim.conf.in sed -i "s|User zimbra|User $USER_NAME|" ZimbraServer/conf/clamd.conf.in sed -i "s|Trust zimbra|Trust $USER_NAME|" ZimbraServer/conf/dspam.conf.in sed -i "s|DatabaseOwner zimbra|DatabaseOwner $USER_NAME|" ZimbraServer/conf/freshclam.conf.in [zimbra-build] # run the main build script for zimbra itself and thirt parties as well. recipe = plone.recipe.command command = ${zimbra-sources:location}/ZimbraBuild/buildZCS.sh -t -p --tpoverride update-command = ${:command} stop-on-error = True [environment-base] # provides existing envvars to the [environment] section recipe = collective.recipe.environment [environment] # environment needed for building the applications. recipe = collective.recipe.environment ZIMBRA_HOME = ${directories:zimbra-home} JAVA_HOME = ${jdk:location} ANT_HOME = ${ant:location} PATH = ${perl:location}/bin:/bin:${:JAVA_HOME}/bin:${:ANT_HOME}/bin:${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${pkgconfig:location}/bin:${bison:location}/bin:${flex:location}/bin:${unzip:location}/bin:${cmake:location}/bin:${ncurses:location}/bin:${m4:location}/bin:${bzip2:location}/bin:${pcre:location}/bin:${sqlite3:location}/bin:${pax:location}/bin:${p7zip:location}/bin:/usr/local/bin:/usr/bin LD_LIBRARY_PATH = ${:ZIMBRA_HOME}/bdb/lib:${:ZIMBRA_HOME}/mysql/lib BZIP2_PREFIX = ${bzip2:location} PCRE_PREFIX = ${pcre:location} NCURSES_PREFIX = ${ncurses:location} MAKEARGS=-j2 ZIMBRA_USER=${environment-base:USER} [sh-environment] # environment needed for running/debugging the applications, exported to a shell script to be sourced. recipe = collective.recipe.template output = ${buildout:directory}/environment.sh input = inline: export ZIMBRA_HOME="${environment:ZIMBRA_HOME}" export JAVA_HOME="${environment:JAVA_HOME}" export ANT_HOME="${environment:ANT_HOME}" export PATH="${environment:PATH}:${environment:ZIMBRA_HOME}/bin" export LD_LIBRARY_PATH="${environment:LD_LIBRARY_PATH}" export BZIP2_PREFIX="${environment:BZIP2_PREFIX}" export PCRE_PREFIX="${environment:PCRE_PREFIX}" export NCURSES_PREFIX="${environment:NCURSES_PREFIX}" export MAKEARGS="${environment:MAKEARGS}" export ZIMBRA_USER="${environment:ZIMBRA_USER}" [directories] recipe = slapos.cookbook:mkdirectory zimbra-home = ${buildout:directory}/home [zimbra-deploy-store] # extract binaries and scripts from the .deb packages recipe = cp.recipe.cmd # required to source .bashrc shell = /bin/bash PACKAGE_LIST = zimbra-core zimbra-store ZIMBRA_HOME = ${environment:ZIMBRA_HOME} # attention: reference to the gitcloned part. we don't want it to be updated #PACKAGES = ${zimbra-sources:location}/ZimbraBuild/amd64 PACKAGES = ${buildout:directory}/amd64 update_cmd = ${:install_cmd} install_cmd = rm -rf ${:ZIMBRA_HOME} mkdir ${:ZIMBRA_HOME} cd ${:ZIMBRA_HOME} for pkg_name in ${:PACKAGE_LIST}; do echo "Unpacking $pkg_name..." ar x ${:PACKAGES}/$pkg_name*.deb tar xvf data.tar.gz --strip=5 >/dev/null rm data.tar.gz rm control.tar.gz done ln -sf bdb-* bdb ln -sf curl-* curl ln -sf cyrus-sasl-* cyrus-sasl ln -sf heimdal-* heimdal ln -sf jdk* java ln -sf mysql-* mysql ln -sf openldap-* openldap ln -sf openssl-* openssl ln -sf rsync-* rsync ln -sf tcmalloc-* tcmalloc ln -sf jetty-distribution-* jetty ln -sf jetty-distribution-* mailboxd mkdir -p zimlets-deployed mkdir -p log # only provided with zimbra-store mkdir -p data/tmp chmod 1777 data/tmp mkdir backup ssl .ssh zmstat echo source ${:ZIMBRA_HOME}/.bashrc echo cd ${:ZIMBRA_HOME}\; ZIMBRA_INSTALLED_PKGS=\"${:PACKAGE_LIST}\" ./libexec/zmsetup.pl [zimbra-deploy-ldap] # extract binaries and scripts from the .deb packages recipe = cp.recipe.cmd # required to source .bashrc shell = /bin/bash PACKAGE_LIST = zimbra-core zimbra-ldap ZIMBRA_HOME = ${environment:ZIMBRA_HOME} # attention: reference to the gitcloned part. we don't want it to be updated #PACKAGES = ${zimbra-sources:location}/ZimbraBuild/amd64 PACKAGES = ${buildout:directory}/amd64 update_cmd = ${:install_cmd} install_cmd = rm -rf ${:ZIMBRA_HOME} mkdir ${:ZIMBRA_HOME} cd ${:ZIMBRA_HOME} for pkg_name in ${:PACKAGE_LIST}; do echo "Unpacking $pkg_name..." ar x ${:PACKAGES}/$pkg_name*.deb tar xvf data.tar.gz --strip=5 >/dev/null rm data.tar.gz rm control.tar.gz done ln -sf bdb-* bdb ln -sf curl-* curl ln -sf cyrus-sasl-* cyrus-sasl ln -sf heimdal-* heimdal ln -sf jdk* java ln -sf libtool* libtool ln -sf mysql-* mysql ln -sf openldap-* openldap ln -sf openssl-* openssl ln -sf rsync-* rsync ln -sf tcmalloc-* tcmalloc mkdir -p zimlets-deployed mkdir -p log # only provided with zimbra-store mkdir -p data/tmp chmod 1777 data/tmp mkdir backup ssl .ssh zmstat mkdir -p data/ldap/config mkdir -p data/ldap/mdb/db sudo setcap 'cap_net_bind_service=+ep' ${:ZIMBRA_HOME}/openldap/sbin/slapd # clear credential cache to spot commands in zmsetup.pl that would require sudo sudo -k echo source ${:ZIMBRA_HOME}/.bashrc echo cd ${:ZIMBRA_HOME}\; ZIMBRA_INSTALLED_PKGS=\"${:PACKAGE_LIST}\" ./libexec/zmsetup.pl [zimbra-deploy-mta] # extract binaries and scripts from the .deb packages recipe = cp.recipe.cmd # required to source .bashrc shell = /bin/bash PACKAGE_LIST = zimbra-core zimbra-mta ZIMBRA_HOME = ${environment:ZIMBRA_HOME} # attention: reference to the gitcloned part. we don't want it to be updated #PACKAGES = ${zimbra-sources:location}/ZimbraBuild/amd64 PACKAGES = ${buildout:directory}/amd64 update_cmd = ${:install_cmd} install_cmd = rm -rf ${:ZIMBRA_HOME} mkdir ${:ZIMBRA_HOME} cd ${:ZIMBRA_HOME} for pkg_name in ${:PACKAGE_LIST}; do echo "Unpacking $pkg_name..." ar x ${:PACKAGES}/$pkg_name*.deb tar xvf data.tar.gz --strip=5 >/dev/null rm data.tar.gz rm control.tar.gz done ln -sf altermime-* altermime ln -sf amavisd-* amavisd ln -sf bdb-* bdb ln -sf cbpolicyd-* cbpolicyd ln -sf clamav-* clamav ln -sf curl-* curl ln -sf cyrus-sasl-* cyrus-sasl ln -sf dspam* dspam ln -sf heimdal-* heimdal ln -sf libmemcached* libmemcached ln -sf mysql-* mysql ln -sf opendkim* opendkim ln -sf openldap-* openldap ln -sf openssl-* openssl ln -sf postfix* postfix ln -sf rsync-* rsync ln -sf tcmalloc-* tcmalloc ln -sf jdk* java ln -sf zeromq* zeromq mkdir -p data/amavisd/db mkdir -p data/amavisd/tmp mkdir -p data/amavisd/var mkdir -p data/amavisd/quarantine mkdir -p data/clamav/db mkdir -p data/postfix/spool/pid mkdir -p conf/sa mkdir -p logger/db/data mkdir -p zimlets-deployed mkdir -p log # only provided with zimbra-store mkdir -p data/tmp chmod 1777 data/tmp touch ${:ZIMBRA_HOME}/postfix/conf/main.cf cd ${:ZIMBRA_HOME}/mta ln -sf mysql-* mysql # allow executables to bind low ports sudo setcap 'cap_net_bind_service=+ep' ${:ZIMBRA_HOME}/postfix/libexec/master # allow executables to call chroot - appearently not needed ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/qmgr ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/pickup ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/showq # clear credential cache to spot commands in zmsetup.pl that would require sudo sudo -k # disable TLS for opendkim -> ldap connection sed -i 's#LDAPUseTLS.*#LDAPUseTLS 0#g' ${:ZIMBRA_HOME}/conf/opendkim.conf.in echo source ${:ZIMBRA_HOME}/.bashrc echo cd ${:ZIMBRA_HOME}\; ZIMBRA_INSTALLED_PKGS=\"${:PACKAGE_LIST}\" ./libexec/zmsetup.pl [zimbra-deploy-all] # extract binaries and scripts from the .deb packages recipe = cp.recipe.cmd # required to source .bashrc shell = /bin/bash PACKAGE_LIST = zimbra-core zimbra-ldap zimbra-mta zimbra-store ZIMBRA_HOME = ${environment:ZIMBRA_HOME} # attention: reference to the gitcloned part. we don't want it to be updated #PACKAGES = ${zimbra-sources:location}/ZimbraBuild/amd64 PACKAGES = ${buildout:directory}/amd64 update_cmd = ${:install_cmd} install_cmd = rm -rf ${:ZIMBRA_HOME} mkdir ${:ZIMBRA_HOME} cd ${:ZIMBRA_HOME} for pkg_name in ${:PACKAGE_LIST}; do echo "Unpacking $pkg_name..." ar x ${:PACKAGES}/$pkg_name*.deb tar xvf data.tar.gz --strip=5 >/dev/null rm data.tar.gz rm control.tar.gz done ln -sf altermime-* altermime ln -sf amavisd-* amavisd ln -sf bdb-* bdb ln -sf cbpolicyd-* cbpolicyd ln -sf clamav-* clamav ln -sf curl-* curl ln -sf cyrus-sasl-* cyrus-sasl ln -sf dspam* dspam ln -sf heimdal-* heimdal ln -sf jdk* java ln -sf libtool* libtool ln -sf libmemcached* libmemcached ln -sf mysql* mysql ln -sf opendkim* opendkim ln -sf openldap-* openldap ln -sf openssl-* openssl ln -sf postfix* postfix ln -sf rsync-* rsync ln -sf tcmalloc-* tcmalloc ln -sf jetty-distribution-* jetty ln -sf jetty-distribution-* mailboxd ln -sf zeromq* zeromq mkdir -p data/ldap/config mkdir -p data/ldap/mdb/db mkdir -p data/amavisd/db mkdir -p data/amavisd/tmp mkdir -p data/amavisd/var mkdir -p data/amavisd/quarantine mkdir -p data/clamav/db mkdir -p data/postfix/spool/pid mkdir -p conf/sa mkdir -p logger/db/data mkdir -p zimlets-deployed mkdir -p log # only provided with zimbra-store mkdir -p data/tmp chmod 1777 data/tmp touch ${:ZIMBRA_HOME}/postfix/conf/main.cf mkdir backup ssl .ssh zmstat cd ${:ZIMBRA_HOME}/mta ln -sf mysql-* mysql # allow executables to bind low ports sudo setcap 'cap_net_bind_service=+ep' ${:ZIMBRA_HOME}/openldap/sbin/slapd sudo setcap 'cap_net_bind_service=+ep' ${:ZIMBRA_HOME}/postfix/libexec/master # allow executables to call chroot - appearently not needed ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/qmgr ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/pickup ## sudo setcap 'cap_sys_chroot+ep' ${:ZIMBRA_HOME}/postfix/libexec/showq # clear credential cache to spot commands in zmsetup.pl that would require sudo sudo -k # disable TLS for opendkim -> ldap connection sed -i 's#LDAPUseTLS.*#LDAPUseTLS 0#g' ${:ZIMBRA_HOME}/conf/opendkim.conf.in echo source ${:ZIMBRA_HOME}/.bashrc echo cd ${:ZIMBRA_HOME}\; ZIMBRA_INSTALLED_PKGS=\"${:PACKAGE_LIST}\" ./libexec/zmsetup.pl [versions] slapos.cookbook = inotifyx = 0.2.0 netifaces = 0.8 # ----------------------- automatically picked ----------------------- Jinja2 = 2.7 MarkupSafe = 0.18 Werkzeug = 0.9.1 buildout-versions = 1.7 cliff = 1.4 cmd2 = 0.6.5.1 collective.recipe.environment = 0.2.0 collective.recipe.template = 1.10 hexagonit.recipe.cmmi = 2.0 itsdangerous = 0.21 meld3 = 0.6.10 plone.recipe.command = 1.1 prettytable = 0.7.2 requests = 1.2.3 slapos.libnetworkcache = 0.13.4 slapos.recipe.build = 0.11.6 slapos.recipe.cmmi = 0.1.1 # Required by: # slapos.core==0.35.1 Flask = 0.10.1 # Required by: # slapos.cookbook==0.78.2.dev lock-file = 2.0 # Required by: # slapos.cookbook==0.78.2.dev # slapos.core==0.35.1 # xml-marshaller==0.9.7 lxml = 3.2.1 # Required by: # slapos.cookbook==0.78.2.dev netaddr = 0.7.10 # Required by: # slapos.core==0.35.1 pyflakes = 0.7.3 # Required by: # slapos.cookbook==0.78.2.dev pytz = 2013b # Required by: # slapos.cookbook==0.78.2.dev # slapos.core==0.35.1 # zc.buildout==1.6.0-dev-SlapOS-010 # zc.recipe.egg==1.3.2 setuptools = 0.7.7 # Required by: # slapos.cookbook==0.78.2.dev slapos.core = 0.35.1 # Required by: # slapos.core==0.35.1 supervisor = 3.0b2 # Required by: # slapos.core==0.35.1 unittest2 = 0.5.1 # Required by: # slapos.cookbook==0.78.2.dev xml-marshaller = 0.9.7 # Required by: # slapos.core==0.35.1 zope.interface = 4.0.5