net-mail/rss2email: x86 stable wrt bug #715048
[gentoo.git] / net-mail / tpop3d / tpop3d-1.5.5-r1.ebuild
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 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:0= )
19         ssl?            ( >=dev-libs/openssl-0.9.6:0= )
20         ldap?           ( >=net-nds/openldap-2.0.7 )
21         mysql?          ( dev-db/mysql-connector-c:0= )
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 PATCHES=( "${FILESDIR}/${PN}-1.5.4-gold.patch" )
31
32 src_prepare() {
33         default
34         eautoreconf
35 }
36
37 src_configure() {
38         local myconf=""
39         local noauth=0
40
41         # Various authentication methods
42         use authexternal && myconf="${myconf} --enable-auth-other"
43         use flatfile    && myconf="${myconf} --enable-auth-flatfile"
44         use gdbm                && myconf="${myconf} --enable-auth-gdbm"
45         use ldap                && myconf="${myconf} --enable-auth-ldap"
46         use mysql               && myconf="${myconf} --enable-auth-mysql --with-mysql-lib-dir=$(mysql_config --variable=pkglibdir)"
47         use pam                 || myconf="${myconf} --disable-auth-pam"
48         use passwd              && myconf="${myconf} --enable-auth-passwd"
49         use perl                && myconf="${myconf} --enable-auth-perl"
50         use postgres    && myconf="${myconf} --enable-auth-pgsql"
51         use shadow              && myconf="${myconf} --enable-auth-passwd --enable-shadow-passwords"
52
53         use authexternal || use flatfile || use gdbm || use ldap || use mysql ||
54                 use     pam || use passwd || use perl || use postgres || use shadow ||
55                 noauth=1
56
57         if [[ ${noauth} -eq 1 ]]; then
58                 ewarn "None of tpop3d's authentication mechanism USE flags are set."
59                 ewarn "As a result tpop3d will be built with /etc/passwd authentication only."
60                 myconf="${myconf} --enable-auth-passwd"
61         fi
62
63         # Other optional features
64         use debug               && myconf="${myconf} --enable-backtrace"
65         use maildir             && myconf="${myconf} --enable-mbox-maildir"
66         use mbox                || myconf="${myconf} --disable-mbox-bsd"
67         use offensive   || myconf="${myconf} --disable-snide-comments"
68         use sha1                || myconf="${myconf} --disable-sha1-passwords"
69         use ssl                 && myconf="${myconf} --enable-tls"
70         use tcpd                && myconf="${myconf} --enable-tcp-wrappers"
71
72         econf ${myconf}
73
74         # Causes crash with "stack smashing attack" on connect, because of bug in
75         # SSP (bug #115285)
76         filter-flags -fstack-protector
77 }
78
79 src_install() {
80         default
81         dodir /etc/tpop3d
82
83         if use pam ; then
84                 dodir /etc/pam.d
85                 dosym pop3 /etc/pam.d/tpop3d
86         fi
87
88         newinitd "${FILESDIR}/${PN}-1.5.4.init" tpop3d
89 }
90
91 pkg_postinst() {
92         elog "Read the tpop3d.conf manpage"
93         elog "Please create /etc/tpop3d/tpop3d.conf to fit your configuration"
94 }