1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic autotools
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"
15 IUSE="authexternal debug flatfile gdbm ldap maildir mbox mysql offensive
16 pam passwd perl postgres +sha1 shadow ssl tcpd"
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 )
25 >=net-mail/mailbase-0.00-r8 )
26 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
31 epatch "${FILESDIR}/${PN}-1.5.4-gold.patch"
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"
51 use authexternal || use flatfile || use gdbm || use ldap || use mysql ||
52 use pam || use passwd || use perl || use postgres || use shadow ||
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"
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"
72 # Causes crash with "stack smashing attack" on connect, because of bug in
74 filter-flags -fstack-protector
78 emake DESTDIR="${D}" install
83 dosym /etc/pam.d/pop3 /etc/pam.d/tpop3d
86 newinitd "${FILESDIR}/${PN}-1.5.4.init" tpop3d
90 elog "Read the tpop3d.conf manpage"
91 elog "Please create /etc/tpop3d/tpop3d.conf to fit your configuration"