net-mail/tnef: security cleanup (bug #701816)
[gentoo.git] / net-mail / fetchmail / fetchmail-6.4.1-r3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python2_7 )
6 PYTHON_REQ_USE="tk"
7
8 inherit python-single-r1 systemd toolchain-funcs autotools
9
10 DESCRIPTION="the legendary remote-mail retrieval and forwarding utility"
11 HOMEPAGE="http://www.fetchmail.info/"
12 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
13
14 LICENSE="GPL-2 public-domain"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
17 IUSE="ssl nls kerberos tk socks libressl"
18 REQUIRED_USE="tk? ( ${PYTHON_REQUIRED_USE} )"
19
20 RDEPEND="acct-user/fetchmail
21         ssl? (
22                 !libressl? ( >=dev-libs/openssl-1.0.2:= )
23                 libressl?  ( dev-libs/libressl:= )
24         )
25         kerberos? (
26                 virtual/krb5
27                 !libressl? ( >=dev-libs/openssl-1.0.2:= )
28                 libressl?  ( dev-libs/libressl:= )
29         )
30         nls? ( virtual/libintl )
31         !elibc_glibc? ( sys-libs/e2fsprogs-libs )
32         socks? ( net-proxy/dante )
33         tk? ( ${PYTHON_DEPS} )"
34 DEPEND="${RDEPEND}
35         app-arch/xz-utils
36         sys-devel/flex
37         nls? ( sys-devel/gettext )"
38
39 DOCS="FAQ FEATURES NEWS NOTES README README.NTLM README.SSL* TODO"
40 HTML_DOCS="*.html"
41 PATCHES=(
42         "${FILESDIR}"/${PN}-6.3.26-python-optional.patch
43 )
44 S=${WORKDIR}/${P/_/.}
45
46 pkg_setup() {
47         use tk && python-single-r1_pkg_setup
48 }
49
50 src_prepare() {
51         default
52         # don't compile during src_install
53         use tk && : > "${S}"/py-compile
54         eautoreconf
55 }
56
57 src_configure() {
58         use tk || export PYTHON=:
59
60         econf \
61                 --enable-RPA \
62                 --enable-NTLM \
63                 --enable-SDPS \
64                 $(use_enable nls) \
65                 $(use_with ssl ssl "${EPREFIX}/usr") \
66                 $(use kerberos && echo "--with-ssl=${EPREFIX}/usr") \
67                 $(use_with kerberos gssapi) \
68                 $(use_with kerberos kerberos5) \
69                 --without-hesiod \
70                 $(use_with socks)
71 }
72
73 src_compile() {
74         emake AR="$(tc-getAR)"
75 }
76
77 src_install() {
78         default
79
80         newinitd "${FILESDIR}"/fetchmail.initd fetchmail
81         newconfd "${FILESDIR}"/fetchmail.confd fetchmail
82
83         systemd_dounit  "${FILESDIR}"/${PN}.service
84         systemd_newunit "${FILESDIR}"/${PN}_at.service "${PN}@.service"
85         systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
86
87         docinto contrib
88         local f
89         for f in contrib/* ; do
90                 [ -f "${f}" ] && dodoc "${f}"
91         done
92
93         use tk && python_optimize
94 }
95
96 pkg_postinst() {
97         if [[ -z ${REPLACING_VERSIONS} ]]; then
98                 elog "Please see /etc/conf.d/fetchmail if you want to adjust"
99                 elog "the polling delay used by the fetchmail init script."
100         fi
101 }