|
| 1 | +# Copyright 1999-2019 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=7 |
| 5 | + |
| 6 | +inherit gnustep-2 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="activesync gnutls libressl +ssl" |
| 16 | + |
| 17 | +RDEPEND=" |
| 18 | + acct-user/sogo |
| 19 | + dev-libs/libmemcached |
| 20 | + net-misc/curl |
| 21 | + net-misc/memcached |
| 22 | + >=gnustep-libs/sope-${PV}[ldap] |
| 23 | + activesync? ( dev-libs/libwbxml ) |
| 24 | + gnutls? ( net-libs/gnutls:= ) |
| 25 | + !gnutls? ( |
| 26 | + !libressl? ( dev-libs/openssl:0= ) |
| 27 | + libressl? ( dev-libs/libressl:= ) |
| 28 | + ) |
| 29 | +" |
| 30 | +DEPEND="${RDEPEND} |
| 31 | + >=gnustep-base/gnustep-make-2.6.3" |
| 32 | + |
| 33 | +pkg_pretend() { |
| 34 | + if use ssl && use gnutls && use libressl ; then |
| 35 | + ewarn "You have enabled both gnutls and libressl, but only" |
| 36 | + ewarn "one provider can be active. Using gnutls!" |
| 37 | + fi |
| 38 | +} |
| 39 | + |
| 40 | +src_prepare() { |
| 41 | + gnustep-base_src_prepare |
| 42 | + sed -e "s/validateArgs$//" -i configure \ |
| 43 | + || die |
| 44 | + if use activesync; then |
| 45 | + sed -e 's/Tests\/Unit/ActiveSync &/g' \ |
| 46 | + -i GNUmakefile || die |
| 47 | + fi |
| 48 | + |
| 49 | + default |
| 50 | +} |
| 51 | + |
| 52 | +src_configure() { |
| 53 | + local ssl_provider |
| 54 | + if use ssl ; then |
| 55 | + if use gnutls ; then |
| 56 | + ssl_provider=gnutls |
| 57 | + else |
| 58 | + ssl_provider=ssl |
| 59 | + fi |
| 60 | + else |
| 61 | + ssl_provider=none |
| 62 | + fi |
| 63 | + |
| 64 | + egnustep_env |
| 65 | + |
| 66 | + ./configure \ |
| 67 | + --disable-strip \ |
| 68 | + --prefix=/usr \ |
| 69 | + --with-ssl="${ssl_provider}" \ |
| 70 | + $(use_enable debug) \ |
| 71 | + || die "configure failed" |
| 72 | +} |
| 73 | + |
| 74 | +src_install() { |
| 75 | + gnustep-base_src_install |
| 76 | + |
| 77 | + newconfd "${FILESDIR}"/sogod.confd sogod |
| 78 | + newinitd "${FILESDIR}"/sogod.initd sogod |
| 79 | + |
| 80 | + insinto /etc/logrotate.d |
| 81 | + newins Scripts/logrotate sogo |
| 82 | + newdoc Apache/SOGo.conf SOGo-Apache.conf |
| 83 | + |
| 84 | + insinto /etc/sogo |
| 85 | + doins Scripts/sogo.conf |
| 86 | + |
| 87 | + insinto /etc/cron.d |
| 88 | + newins Scripts/sogo.cron sogo |
| 89 | + keepdir /var/log/sogo |
| 90 | + |
| 91 | + fowners sogo:sogo /var/log/sogo |
| 92 | + fowners -R root:sogo /etc/sogo |
| 93 | +} |
| 94 | + |
| 95 | +pkg_postinst() { |
| 96 | + gnustep-base_pkg_postinst |
| 97 | + elog "SOGo documentation is available online at:" |
| 98 | + elog "http://www.sogo.nu/downloads/documentation.html" |
| 99 | + elog |
| 100 | + elog "Apache sample configuration file is available in:" |
| 101 | + elog "/usr/share/doc/${PF}" |
| 102 | + if use activesync; then |
| 103 | + ewarn "In order to use the SOGo ActiveSync support code in production environments," |
| 104 | + ewarn "you need to get a proper usage license. Check the documentation for details." |
| 105 | + fi |
| 106 | +} |
0 commit comments