zarafa/net-mail/zarafa/zarafa-7.0.10.37482.ebuild

274 lines
9.6 KiB
Bash

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="2"
PHP_EXT_NAME="mapi"
PHP_EXT_INI="yes"
PHP_EXT_ZENDEXT="no"
USE_PHP="php5-3 php5-4"
inherit php-ext-source-r2 eutils autotools versionator rpm5
MY_PV=$(replace_version_separator 3 '-' )
MY_PVV=$(replace_version_separator 3 'beta' $MY_PV )
MY_PVM=$(get_version_component_range 1-2 )
MY_PVR=$(get_version_component_range 1-3 )
DESCRIPTION="Open Source Groupware Solution"
HOMEPAGE="http://zarafa.com/"
SRC_URI="http://download.zarafa.com/community/final/${MY_PVM}/${MY_PV}/sourcecode/zcp-${MY_PVR}.tar.gz
amd64? ( licensed? ( http://download.zarafa.com/community/final/${MY_PVM}/${MY_PV}/zcp-${MY_PV}-sles-11-x86_64-free.tar.gz ) )
x86? ( licensed? ( http://download.zarafa.com/community/final/${MY_PVM}/${MY_PV}/zcp-${MY_PV}-sles-11-i586-free.tar.gz ) )
bash-completion? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=434 -> ${PN}-bash-completion-${PV}.zip )
smime? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=554 -> ${PN}-webaccess-plugin-smime-${PV}.zip )
dspam? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=125 -> ${PN}-webaccess-plugin-dspam-${PV}.tar.gz )
google-maps? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=123 -> ${PN}-webaccess-plugin-google-maps-${PV}.zip )
mobile-device? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=152 -> ${PN}-webaccess-plugin-mobile-device-${PV}.zip )
archive? ( http://community.zarafa.com/mod/community_plugins/download.php?release_guid=140 -> ${PN}-webaccess-plugin-z-merge-archive-${PV}.zip )
themes? (
http://community.zarafa.com/mod/community_plugins/download.php?release_guid=164 -> ${PN}-webaccess-theme-dark-${PV}.tar.gz
http://community.zarafa.com/mod/community_plugins/download.php?release_guid=162 -> ${PN}-webaccess-theme-orange-${PV}.tar.gz
)
"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64 ~arm"
RESTRICT=""
IUSE="debug epoll ldap logrotate licensed static swig tcmalloc testtools perl pic profiling python kerberos sparsehash bash-completion smime dspam google-maps themes mobile-device archive icu unicode"
RDEPEND=">=dev-libs/libical-0.44
dev-cpp/libvmime:0
app-text/catdoc
app-text/poppler
dev-cpp/clucene
dev-db/mysql
dev-libs/libxml2
dev-libs/openssl
net-misc/curl
sys-libs/e2fsprogs-libs
sys-libs/zlib
sys-libs/ncurses
sys-libs/pam
dev-libs/boost
sys-apps/util-linux
app-text/catdoc
kerberos? ( || ( app-crypt/mit-krb5 app-crypt/heimdal ) )
ldap? ( net-nds/openldap )
logrotate? ( app-admin/logrotate )
tcmalloc? ( dev-util/google-perftools )
sparsehash? ( dev-cpp/sparsehash )
perl? ( dev-lang/perl )
python? ( dev-lang/python )
swig? ( dev-lang/swig )
testtools? ( dev-python/testtools )
licensed? (
dev-libs/icu:4.0
dev-libs/openssl:0.9.8
dev-libs/boost:1.36
>=sys-libs/zlib-1.2.4 )
bash-completion? ( app-shells/bash-completion )"
S="${WORKDIR}"/zarafa-${MY_PVR}/
DEPEND="${RDEPEND}
dev-util/pkgconfig
sys-devel/gettext
dev-lang/php
app-arch/unzip"
QA_PRESTRIPPED="
usr/bin/zarafa-restore
usr/bin/zarafa-report
usr/bin/zarafa-backup
usr/bin/zarafa-licensed
usr/lib/zarafa/ldapmsplugin.so
usr/lib64/zarafa/ldapmsplugin.so"
QA_DT_HASH="
usr/bin/zarafa-restore
usr/bin/zarafa-report
usr/bin/zarafa-backup
usr/bin/zarafa-licensed
usr/lib/zarafa/ldapmsplugin.so
usr/lib64/zarafa/ldapmsplugin.so"
src_unpack() {
unpack ${A}
if use licensed; then
cd "${WORKDIR}"
mkdir licensed
cd licensed
rpm5_unpack $(find ./../ -name "zarafa-licensed*.rpm")
cd "${S}"
fi
}
src_prepare() {
EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
edos2unix php-webclient-ajax/config.php.dist
AT_M4DIR="autoconf" eautoreconf
if use licensed; then
# binary crap ahhh... what a hack
# sed -i "s/libboost_filesystem.so.1.42.0/libboost_filesystem-1_42.so /g" "${WORKDIR}"/licensed/usr/bin/zarafa-licensed || die "sed failed"
# sed -i "s/libboost_system.so.1.42.0/libboost_system-1_42.so /g" "${WORKDIR}"/licensed/usr/bin/zarafa-licensed || die "sed failed"
# not a hack just correct a script
sed -i "s!/etc/default/zarafa-ssm!/etc/conf.d/zarafa-ssm!g" "${WORKDIR}"/licensed/usr/bin/zarafa-ssm || die "sed failed"
fi
}
src_configure() {
if use licensed; then
myconf="--with-boost=/usr/include/boost-1_36/"
else
myconf=""
fi
econf \
--enable-oss \
--disable-testtools \
--enable-release \
--with-userscript-prefix=/etc/zarafa/userscripts \
--with-quotatemplate-prefix=/etc/zarafa/quotamails \
--with-indexerscripts-prefix=/etc/zarafa/indexerscripts \
$(use_with pic) \
$(use_enable perl) \
$(use_enable python) \
$(use_enable profiling) \
$(use_enable static) \
$(use_enable swig) \
$(use_enable sparsehash) \
$(use_enable tcmalloc) \
$(use_enable testtools) \
$(use_enable debug) \
$(use_enable icu) \
$(use_enable unicode) \
${myconf}
}
src_install() {
make DESTDIR="${D}" install || die "make install failed"
make DESTDIR="${D}" install-ajax-webaccess || die "make install-ajax-webaccess failed"
make DESTDIR="${D}" install-mobile-webaccess || die "make install-mobile-webaccess failed"
insinto /etc/apache2/modules.d
newins "${FILESDIR}/50_zarafa-webaccess-mobile.conf" 50_zarafa-webaccess-mobile.conf || die "Failed to install apache config files"
newins "${FILESDIR}/50_zarafa-webaccess.conf" 50_zarafa-webaccess.conf || die "Failed to install apache config files"
rm "${D}"/usr/share/zarafa-webaccess/*.conf || die "Failed to remove apache config files"
rm "${D}"/usr/share/zarafa-webaccess-mobile/*.conf || die "Failed to remove apache config files"
# Use only some parts of PHP eclass
php-ext-source-r2_buildinilist php${slot}
php-ext-source-r2_addextension "${PHP_EXT_NAME}.so"
# Symlink the <ext>.ini files from ext/ to ext-active/
for inifile in ${PHPINIFILELIST} ; do
inidir="${inifile/${PHP_EXT_NAME}.ini/}"
inidir="${inidir/ext/ext-active}"
dodir "/${inidir}"
dosym "/${inifile}" "/${inifile/ext/ext-active}"
done
# Install PHP module
php-ext-source-r2_addtoinifiles ";mapi.cache_max_sessions" "128"
php-ext-source-r2_addtoinifiles ";mapi.cache_lifetime" "300"
if use logrotate; then
insinto /etc/logrotate.d
newins "${FILESDIR}"/zarafa.logrotate zarafa || die "Failed to install logrotate"
fi
# install ldap files
if use ldap; then
insinto /etc/openldap/schema
doins installer/ldap/zarafa.* || die "Failed to install ldap schema files"
fi
insinto /etc/zarafa
doins installer/linux/*.cfg || die "Failed to install config files"
exeinto /etc/zarafa/userscripts/
newexe "${FILESDIR}"/junklearn.dspam junklearn
dodir /var/log/zarafa
keepdir /var/log/zarafa
if [[ "${ARCH}" == "x86" || "${ARCH}" == "amd64" ]]; then
if use licensed; then
dobin "${WORKDIR}"/licensed/usr/bin/* || die "Failed to install licensed binaries"
# exeinto /usr/$(get_libdir)/zarafa/
# doexe "${WORKDIR}"/licensed/usr/$(get_libdir)/zarafa/*.so || die "Failed to install licensed lib"
doman "${WORKDIR}"/licensed/usr/share/man/*/*.gz || die "Failed to install man files"
#exeinto /usr/share/zarafa/zarafa-backup-helpers/
#doexe "${WORKDIR}"/licensed/usr/share/zarafa/zarafa-backup-helpers/* || die "Failed to install helper scripts"
dodoc "${WORKDIR}"/licensed/usr/share/doc/zarafa-licensed/* || die "Failed to install docs"
insinto /etc/zarafa
doins -r "${WORKDIR}"/licensed/etc/zarafa/* || die "Failed to install config files"
insinto /etc/cron.d
doins "${WORKDIR}"/licensed/etc/cron.d/* || die "Failed to install cron files"
# insinto /usr/share/zarafa-webaccess/
# doins -r "${WORKDIR}"/licensed/usr/share/zarafa-webaccess/* || die "Failed to install webapp files"
doconfd "${WORKDIR}"/licensed/etc/default/zarafa-ssm || die "Failed to install sysconfig files"
newinitd "${FILESDIR}"/zarafa-licensed.rc6 zarafa-licensed || die "Failed to install init.d files"
fi
fi
if use bash-completion; then
insinto /usr/share/bash-completion
doins "${WORKDIR}"/zarafa
fi
if use smime; then
insinto /var/lib/zarafa-webaccess/plugins
doins -r "${WORKDIR}"/smime
dodoc "${WORKDIR}"/*.pdf
fi
if use dspam; then
newdoc "${WORKDIR}"/dspam/README README.dspam
newdoc "${WORKDIR}"/dspam/INSTALL INSTALL.dspam
newdoc "${WORKDIR}"/dspam/CHANGELOG CHANGELOG.dspam
rm "${WORKDIR}"/dspam/README "${WORKDIR}"/dspam/INSTALL "${WORKDIR}"/dspam/CHANGELOG
insinto /var/lib/zarafa-webaccess/plugins
doins -r "${WORKDIR}"/dspam
fi
if use google-maps; then
insinto /var/lib/zarafa-webaccess/plugins
doins -r "${WORKDIR}"/contactgmap
doins -r "${WORKDIR}"/gmap
fi
if use mobile-device; then
insinto /var/lib/zarafa-webaccess/plugins
doins -r "${WORKDIR}"/mdm
fi
if use archive; then
insinto /var/lib/zarafa-webaccess/plugins
doins -r "${WORKDIR}"/zma
fi
if use themes; then
insinto /usr/share/zarafa-webaccess/client/layout/themes
doins -r "${WORKDIR}"/dark
insinto /usr/share/zarafa-webaccess/client/layout/themes/orange
doins -r "${WORKDIR}"/zarafa-orange-theme/*
fi
newinitd "${FILESDIR}"/zarafa-gateway.rc6 zarafa-gateway || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-ical.rc6 zarafa-ical || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-indexer.rc6 zarafa-indexer || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-monitor.rc6 zarafa-monitor || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-server.rc6 zarafa-server || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-spooler.rc6 zarafa-spooler || die "Failed to install init.d files"
newinitd "${FILESDIR}"/zarafa-dagent.rc6 zarafa-dagent || die "Failed to install init.d files"
}