#!/bin/bash #DEP:php5 #DEP:libvmime #DEP:libical ##DEP:clucene ##DEP:google_perftools #DEP:util_linux #DEP:e2fsprogs #DEP:boost ##DEP:kyotocabinet #DEP:icu4c #DEP:python #DEP:mysql56 #DEP:gsoap #DEP:swig #DEP:openssl #DEP:mit_kerberos #NEED:linuxdoc_tools #NEED:libxslt #DEP:openldap #DEP:ncurses #DEP:zlib #DEP:libxml2 #DEP:curl #DEP:Linux_PAM #DEP:cyrus_sasl #Download from: #http://download.zarafa.com/community/final/7.1/7.1.7-42779/sourcecode/zcp-7.1.7.tar.gz #######Essential package info. #Change these if autodetection fails. #Name of the Syn-3 package that we are going to create NAME=`basename $0|sed 's/.SlackBuild//'` #Archive of the sourcefiles to unpack SRC_ARC=`ls *.tar.*` #SRC_ARC="zarafa-6.20.6" #Version of the sourcefiles VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` #Directory of the sourcefiles to build (after optional unpacking) SRC_DIR=`echo zcp-$VER| sed 's/\.tar\..*$//g'` #Architecture that the created binaries run on. #Use noarch for scripts. ARCH=`uname -m` CWD=`pwd` ########Build and create the pacakge. #Uncomment the stuff that you dont want or need #Unpack source #(uncomment if not needed) syn3_unpack $SRC_ARC || exit 1 #fix webaccess #mkdir -p /tmp/pkg/var/www/htdocs/syn3 #mv $SRC_DIR/php-webclient-ajax /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1 #mv $SRC_DIR/php-mobile-webaccess /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1 #remove configs, if they are there. (they should be in the zarafa_conf package) #rm /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/config.php || true #rm /tmp/pkg/var/www/htdocs/syn3/zarafa/config.php || true #remove debug shizzle #rm /tmp/pkg/var/www/htdocs/syn3/zarafa*/debug.php || exit 1 #change permissions of stuff #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp || exit 1 #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp || exit 1 #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c || exit 1 #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache || exit 1 #webportal files er in #cp $CWD/zarafa/* /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1 #cp $CWD/zarafa-mobile/* /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1 #branding #cp $CWD/zarafa_top_logo.gif /tmp/pkg/var/www/htdocs/syn3/zarafa/client/layout/img/ || exit 1 #compile language files for PO in `find /tmp/pkg -name '*.po'`; do MO=`echo "$PO" | sed 's/.po$/.mo/'` msgfmt "$PO" -o "$MO" || exit 1 #we dont need the 'sources' in our 'binary' package ;) rm "$PO" done #end webaccess #apply patches #patch -F3 -p1 -d $SRC_DIR < Datux-spamhook.patch || exit 1 #patch -p1 -d $SRC_DIR < Datux-sendas.patch || exit 1 #a hack to allow mysql>=5.0 to function: #DONT DO THIS IN ZARAFA 6.30.x+! #sed 's/.*SET max_allowed_packet.*//' -i $SRC_DIR/provider/libserver/ECDatabaseMySQL.cpp || exit 1 #build and install sourcefiles #./configure optiones: #options for all make commands: export MAKE_OPTS=" -j10" #skip testing: export NOTEST=1 #extra optiones for the make install command, use with INSTALL_BASE for example: export INSTALL_OPTS="" export PATH=$PATH:/usr/php5/bin #AUTOMAKE: Configure #Some usefull stuff you sometimes need to set: #export LDFLAGS="-L/usr/lib/mysql/" #export LD_LIBRARY_PATH=/usr/lib/mysql #export VPATH=$LD_LIBRARY_PATH pushd $SRC_DIR MAKE_OPTS="" export CFLAGS="-Wno-error" ./configure --with-mapi-configdir=/etc/mapi --sbindir=/usr/bin --enable-swig --prefix=/usr --disable-testtools --enable-release --disable-static --enable-unicode --disable-perl --with-userscript-prefix=/etc/zarafa/userscripts --with-quotatemplate-prefix=/etc/zarafa/quotamail --enable-python || exit 1 #AUTOMAKE: Compile make $MAKE_OPTS || exit 1 make check || exit 1 #install bug workaround mkdir -p /tmp/pkg//usr/share/doc/zarafa/example-config cp ./installer/linux/archiver.cfg /tmp/pkg//usr/share/doc/zarafa/example-config #AUTOMAKE: Install mkdir -p /tmp/pkg &>/dev/null #somehow these are missing in 7.1.9? touch doc/zarafa-ws.cfg.5 doc/zarafa-ws.1 doc/zarafa-ws.5 make $MAKE_OPTS install || exit 1 make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install >/dev/null || exit 1 popd # postinstaller mkdir -p /tmp/pkg/etc/postinst.d cp post.zarafa /tmp/pkg/etc/postinst.d || exit 1 chmod +x /tmp/pkg/etc/postinst.d/* #this endsup there somehow.. rm -r /tmp/pkg/tmp 2>/dev/null #we provide our own preconfigured etc stuff in a seperate package mv /tmp/pkg/usr/etc /tmp #fix a php compile error: find /tmp/pkg/usr/share/php/mapi -name '*.php' -exec sed 's/