net-mail/rss2email: x86 stable wrt bug #715048
[gentoo.git] / net-mail / tpop3d / tpop3d-1.5.5.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit eutils flag-o-matic autotools
7
8 DESCRIPTION="An extensible POP3 server with vmail-sql/MySQL support"
9 HOMEPAGE="https://savannah.nongnu.org/projects/tpop3d/"
10 SRC_URI="mirror://nongnu/tpop3d/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 x86"
15 IUSE="authexternal debug flatfile gdbm ldap maildir mbox mysql offensive
16         pam passwd perl postgres +sha1 shadow ssl tcpd"
17
18 RDEPEND="sha1?          ( >=dev-libs/openssl-0.9.6 )
19         ssl?            ( >=dev-libs/openssl-0.9.6 )
20         ldap?           ( >=net-nds/openldap-2.0.7 )
21         mysql?          ( virtual/mysql )
22         postgres?       ( dev-db/postgresql[server] )
23         perl?           ( >=dev-lang/perl-5.6.1 )
24         pam?            ( sys-libs/pam
25                                   >=net-mail/mailbase-0.00-r8 )
26         tcpd?           ( >=sys-apps/tcp-wrappers-7.6 )"
27
28 DEPEND="${RDEPEND}"
29
30 src_prepare() {
31         epatch "${FILESDIR}/${PN}-1.5.4-gold.patch"
32         eautoreconf
33 }
34
35 src_configure() {
36         local myconf=""
37         local noauth=0
38
39         # Various authentication methods
40         use authexternal && myconf="${myconf} --enable-auth-other"
41         use flatfile    && myconf="${myconf} --enable-auth-flatfile"
42         use gdbm                && myconf="${myconf} --enable-auth-gdbm"
43         use ldap                && myconf="${myconf} --enable-auth-ldap"
44         use mysql               && myconf="${myconf} --enable-auth-mysql"
45         use pam                 || myconf="${myconf} --disable-auth-pam"
46         use passwd              && myconf="${myconf} --enable-auth-passwd"
47         use perl                && myconf="${myconf} --enable-auth-perl"
48         use postgres    && myconf="${myconf} --enable-auth-pgsql"
49         use shadow              && myconf="${myconf} --enable-auth-passwd --enable-shadow-passwords"
50
51         use authexternal || use flatfile || use gdbm || use ldap || use mysql ||
52                 use     pam || use passwd || use perl || use postgres || use shadow ||
53                 noauth=1
54
55         if [[ ${noauth} -eq 1 ]]; then
56                 ewarn "None of tpop3d's authentication mechanism USE flags are set."
57                 ewarn "As a result tpop3d will be built with /etc/passwd authentication only."
58                 myconf="${myconf} --enable-auth-passwd"
59         fi
60
61         # Other optional features
62         use debug               && myconf="${myconf} --enable-backtrace"
63         use maildir             && myconf="${myconf} --enable-mbox-maildir"
64         use mbox                || myconf="${myconf} --disable-mbox-bsd"
65         use offensive   || myconf="${myconf} --disable-snide-comments"
66         use sha1                || myconf="${myconf} --disable-sha1-passwords"
67         use ssl                 && myconf="${myconf} --enable-tls"
68         use tcpd                && myconf="${myconf} --enable-tcp-wrappers"
69
70         econf ${myconf}
71
72         # Causes crash with "stack smashing attack" on connect, because of bug in
73         # SSP (bug #115285)
74         filter-flags -fstack-protector
75 }
76
77 src_install() {
78         emake DESTDIR="${D}" install
79         dodir /etc/tpop3d
80
81         if use pam ; then
82                 dodir /etc/pam.d
83                 dosym /etc/pam.d/pop3 /etc/pam.d/tpop3d
84         fi
85
86         newinitd "${FILESDIR}/${PN}-1.5.4.init" tpop3d
87 }
88
89 pkg_postinst() {
90         elog "Read the tpop3d.conf manpage"
91         elog "Please create /etc/tpop3d/tpop3d.conf to fit your configuration"
92 }