net-analyzer/wapiti: 3.0.2 bump
[gentoo.git] / gnustep-apps / sogo / sogo-3.2.10.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit gnustep-2 user vcs-snapshot
7
8 DESCRIPTION="Groupware server built around OpenGroupware.org and the SOPE application server"
9 HOMEPAGE="http://www.sogo.nu"
10 SRC_URI="https://github.com/inverse-inc/sogo/archive/SOGo-${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="gnutls libressl +ssl"
16
17 RDEPEND="
18         dev-libs/libmemcached
19         net-misc/curl
20         net-misc/memcached
21         >=gnustep-libs/sope-${PV}[ldap]
22         gnutls? ( net-libs/gnutls:= )
23         !gnutls? (
24                 !libressl? ( dev-libs/openssl:0= )
25                 libressl? ( dev-libs/libressl:= )
26         )
27 "
28 DEPEND="${RDEPEND}
29         >=gnustep-base/gnustep-make-2.6.3"
30
31 pkg_pretend() {
32         if use ssl && use gnutls && use libressl ; then
33                 ewarn "You have enabled both gnutls and libressl, but only"
34                 ewarn "one provider can be active. Using gnutls!"
35         fi
36 }
37
38 pkg_setup() {
39         enewuser sogo -1 /bin/bash /var/lib/sogo
40 }
41
42 src_prepare() {
43         gnustep-base_src_prepare
44         sed -e "s/validateArgs$//" -i configure \
45                 || die "GNUstep.conf sed failed"
46
47         default
48 }
49
50 src_configure() {
51         local ssl_provider
52         if use ssl ; then
53                 if use gnutls ; then
54                         ssl_provider=gnutls
55                 else
56                         ssl_provider=ssl
57                 fi
58         else
59                 ssl_provider=none
60         fi
61
62         egnustep_env
63
64         ./configure \
65                 --disable-strip \
66                 --prefix=/usr \
67                 --with-ssl="${ssl_provider}" \
68                 $(use_enable debug) \
69                 || die "configure failed"
70 }
71
72 src_install() {
73         gnustep-base_src_install
74
75         newconfd "${FILESDIR}"/sogod.confd sogod
76         newinitd "${FILESDIR}"/sogod.initd sogod
77
78         insinto /etc/logrotate.d
79         newins Scripts/logrotate sogo
80         newdoc Apache/SOGo.conf SOGo-Apache.conf
81
82         insinto /etc/sogo
83         doins Scripts/sogo.conf
84
85         insinto /etc/cron.d
86         newins Scripts/sogo.cron sogo
87         keepdir /var/log/sogo
88
89         fowners sogo:sogo /var/log/sogo
90         fowners -R root:sogo /etc/sogo
91 }
92
93 pkg_postinst() {
94         gnustep-base_pkg_postinst
95         elog "SOGo documentation is available online at:"
96         elog "http://www.sogo.nu/downloads/documentation.html"
97         elog
98         elog "Apache sample configuration file is available in:"
99         elog "/usr/share/doc/${PF}"
100 }