summaryrefslogtreecommitdiff
blob: 8827b2a83ac3b6e59056347bc7111839a9ef1a89 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2
inherit depend.apache gnustep-base

MY_PN="SOGo"
MY_PV="${PV/_/}"

DESCRIPTION="groupware server built around OpenGroupware.org and the SOPE application server"
HOMEPAGE="http://sogo.opengroupware.org/"
SRC_URI="http://www.inverse.ca/downloads/${MY_PN}/Sources/${MY_PN}-${MY_PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

DEPEND="gnustep-libs/sope[postgres]"
RDEPEND="${DEPEND}
	dev-db/postgresql"
need_apache2

S=${WORKDIR}/${MY_PN}-${MY_PV}

src_configure() {
	# Do not use standard src_compile, as ./configure is not standard
	egnustep_env
	./configure
}

src_install() {
	gnustep-base_src_install

	# Apache configuration file
	dodir "${APACHE_MODULES_CONFDIR}"
	cat <<EOF >"${D}/${APACHE_MODULES_CONFDIR}"/47_sogo.conf
<IfDefine SOPE>
LoadModule ngobjweb_module modules/mod_ngobjweb.so

Alias /sogo.woa/WebServerResources/ \
	${GNUSTEP_SYSTEM_LIBRARY}/SOGo/WebServerResources/
Alias /SOGo.woa/WebServerResources/ \
	${GNUSTEP_SYSTEM_LIBRARY}/SOGo/WebServerResources/
Alias /SOGO.woa/WebServerResources/ \
	${GNUSTEP_SYSTEM_LIBRARY}/SOGo/WebServerResources/

AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
	${GNUSTEP_SYSTEM_LIBRARY}/SOGo/\$1.SOGo/Resources/\$2

<LocationMatch "^/SOGo*">
	AddDefaultCharset UTF-8
	SetHandler ngobjweb-adaptor
	SetAppPort 20000
	Allow from 127.0.0.1
</LocationMatch>

<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*png">
	SetHandler default-handler
</LocationMatch>

<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*gif">
	SetHandler default-handler
</LocationMatch>

<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*css">
	SetHandler default-handler
</LocationMatch>

<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*js">
	SetHandler default-handler
</LocationMatch>

</IfDefine>
EOF

	# Init script
	newinitd "${FILESDIR}"/sogo.initd sogo \
		|| die "Init script installation failed"
}

pkg_preinst() {
	enewuser sogo -1 /bin/bash /var/lib/sogo
}

pkg_postinst() {
	gnustep-base_pkg_postinst

	elog "Do not forget to enable the sope module in /etc/apache2/httpd.conf"
	elog "Now follow the steps from the SOGo documentation, Configuration section:"
	elog "http://www.inverse.ca/contributions/sogo/documentation.html#c803"
	elog "The default port configured for sogo is 20000 (from 47_sogo.conf)"
	elog "The sogo user home directory is /var/lib/sogo"
	elog ""
	elog "Then you can start/stop sogo with /etc/init.d/sogo"
}