summaryrefslogtreecommitdiff
blob: 2e904abfe7ac491120eab13176d4264f1cf40497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Copyright 1999-2011 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"

inherit versionator php-ext-source-r2 eutils

ZARAFA_MAJOR=$(get_version_component_range 1 ${PV})
ZARAFA_MINOR=$(get_version_component_range 2 ${PV})
ZARAFA_MICRO=$(get_version_component_range 3 ${PV})
ZARAFA_REV=30778

DESCRIPTION="Open Source Groupware Solution"
HOMEPAGE="http://zarafa.com/"
SRC_URI="http://download.zarafa.com/community/final/${ZARAFA_MAJOR}.${ZARAFA_MINOR}/${PV}-${ZARAFA_REV}/sourcecode/zcp-${PV}.tar.gz"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="debug ldap +logrotate static"

RDEPEND=">=dev-libs/libical-0.44
	=dev-cpp/libvmime-0.7.1
	>=dev-lang/php-5.2.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
	dev-libs/boost
	ldap? ( net-nds/openldap )
	logrotate? ( app-admin/logrotate )"
DEPEND="${RDEPEND}
	dev-util/pkgconfig
	sys-devel/gettext"

#src_unpack() {
#	unpack ${P}.tar.bz2
#}

src_prepare() {
	# Fixes zarafa-server linking
	epatch "${FILESDIR}"/"${PN}"-6.40.1-uuid-link.patch

	# Don't install php ini file, as installation doesn't
	# respect Gentoo way of handling SAPIs
	epatch "${FILESDIR}"/"${PN}"-6.40.1-no-php-conf.patch
}

src_configure() {
	econf \
		--enable-oss \
		--disable-perl \
		--disable-testtools \
		--with-userscript-prefix=/etc/zarafa/userscripts \
		--with-quotatemplate-prefix=/etc/zarafa/quotamails \
		--with-indexerscripts-prefix=/etc/zarafa/indexerscripts \
		$(use_enable static) \
		$(use_enable debug)
}

src_compile() {
	emake || die "Compilation failed"
}

src_install() {

	emake DESTDIR="${D}" install || die "Installation failed"

	# 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

	insinto /etc/zarafa
	doins "${S}"/installer/linux/*.cfg || die "Failed to install config files"

	dodir /var/log/zarafa
	keepdir /var/log/zarafa

	newinitd "${FILESDIR}"/zarafa-gateway.rc6 zarafa-gateway
	newinitd "${FILESDIR}"/zarafa-ical.rc6 zarafa-ical
	newinitd "${FILESDIR}"/zarafa-indexer.rc6 zarafa-indexer
	newinitd "${FILESDIR}"/zarafa-monitor.rc6 zarafa-monitor
	newinitd "${FILESDIR}"/zarafa-server.rc6 zarafa-server
	newinitd "${FILESDIR}"/zarafa-spooler.rc6 zarafa-spooler

}