summaryrefslogtreecommitdiff
blob: 1f8d067d54f6f124f6d6ac209a991e2f44659882 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=4

inherit eutils webapp

MY_PN=eGroupware

DESCRIPTION="Web-based GroupWare suite"
HOMEPAGE="http://www.egroupware.org/"
SRC_URI="mirror://sourceforge/${PN}/${MY_PN}-${PV}.tar.bz2
	mirror://sourceforge/${PN}/${MY_PN}-egw-pear-${PV}.tar.bz2
	gallery? ( mirror://sourceforge/${PN}/${MY_PN}-gallery-${PV}.tar.bz2 )"

LICENSE="GPL-2"
KEYWORDS="amd64 hppa ppc ~sparc x86"
IUSE="+jpgraph ldap mysql postgres gallery"

# php deps taken from rpm spec
# you can use pdo to access almost anything but sqlite is specifically required
# for the calendar module
# jpgraph is only needed for the projectmanager module
RDEPEND="jpgraph? ( dev-php/jpgraph )
	dev-php/pear
	dev-php/PEAR-Auth_SASL
	virtual/httpd-php
	dev-lang/php[gd,imap,pdo,posix,session,sqlite,ssl,unicode,xml,zip,zlib,ldap?,mysql?,postgres?]
	virtual/cron"

REQUIRED_USE="|| ( mysql postgres )"

need_httpd_cgi

S=${WORKDIR}/${PN}

src_prepare() {
	esvn_clean

	if use jpgraph; then
		einfo "Fixing jpgraph location"
		MY_JPGRAPH_VERSION="$(best_version dev-php/jpgraph)"
		MY_JPGRAPH_VERSION="${MY_JPGRAPH_VERSION/'dev-php/jpgraph-'/}"
		sed -i "s|EGW_SERVER_ROOT . '/../jpgraph/src/jpgraph.php'|'/usr/share/php/jpgraph/jpgraph.php'|" \
			projectmanager/inc/class.projectmanager_ganttchart.inc.php || die "sed jpgraph failed"
		sed -i "s|EGW_SERVER_ROOT . '/../jpgraph/src/jpgraph_gantt.php'|'/usr/share/php/jpgraph/jpgraph_gantt.php'|" \
			projectmanager/inc/class.projectmanager_ganttchart.inc.php || die "sed jpgraph failed"
		sed -i "s|$jpgraph_path .= SEP.'jpgraph';|$jpgraph_path = dirname('/usr/share/php/jpgraph/jpgraph.php');|" \
			setup/check_install.php || die "sed jpgraph failed"
		sed -i "s|'unknown';|'${MY_JPGRAPH_VERSION}';\n         \$available = version_compare(\$version,\$min_version,'>=');|" \
			setup/check_install.php || die "sed jpgraph failed"
	fi
}

src_install() {
	webapp_src_preinst

	dodoc doc/rpm-build/egroupware.cron

	insinto "${MY_HTDOCSDIR}"
	doins -r .

	webapp_serverowned "${MY_HTDOCSDIR}/phpgwapi/images"

	webapp_postinst_txt en "${FILESDIR}/postinstall-en-1.2.txt"
	webapp_src_install
}

pkg_postinst() {
	if use ldap; then
		elog "If you are using LDAP contacts/addressbook, please read the upgrade instructions at"
		elog "http://www.egroupware.org/index.php?page_name=wiki&wikipage=ManualSetupUpdate"
		elog "before running the egroupware setup"
	fi

	elog "A cronjob to run eGroupware's async services is available at"
	elog "/usr/share/doc/${P}"

	webapp_pkg_postinst
}