net-ftp/proftpd: CVE-2019-19269 fix, bug #701814
[gentoo.git] / net-ftp / lftp / lftp-4.8.4-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 inherit autotools libtool xdg-utils
6
7 DESCRIPTION="A sophisticated ftp/sftp/http/https/torrent client and file transfer program"
8 HOMEPAGE="https://lftp.tech/"
9 SRC_URI="
10         ${HOMEPAGE}ftp/${P}.tar.xz
11 "
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
16 IUSE="convert-mozilla-cookies +gnutls idn ipv6 libressl nls socks5 +ssl verify-file"
17 RESTRICT="test"
18
19 RDEPEND="
20         >=sys-libs/ncurses-5.1:=
21         >=sys-libs/readline-5.1:=
22         dev-libs/expat
23         sys-libs/zlib
24         convert-mozilla-cookies? ( dev-perl/DBI )
25         idn? ( net-dns/libidn2:= )
26         socks5? (
27                 >=net-proxy/dante-1.1.12
28                 sys-libs/pam
29         )
30         ssl? (
31                 gnutls? ( >=net-libs/gnutls-1.2.3:0= )
32                 !gnutls? (
33                         !libressl? ( dev-libs/openssl:0= )
34                         libressl? ( dev-libs/libressl:0= )
35                 )
36         )
37         verify-file? (
38                 dev-perl/String-CRC32
39                 virtual/perl-Digest-MD5
40         )
41 "
42 DEPEND="
43         ${RDEPEND}
44         =sys-devel/libtool-2*
45         app-arch/xz-utils
46         nls? ( >=sys-devel/gettext-0.19 )
47         virtual/pkgconfig
48 "
49 DOCS=(
50         BUGS ChangeLog FAQ FEATURES MIRRORS NEWS README README.debug-levels
51         README.dnssec README.modules THANKS TODO
52 )
53 PATCHES=(
54         "${FILESDIR}"/${PN}-4.0.2.91-lafile.patch
55         "${FILESDIR}"/${PN}-4.5.5-am_config_header.patch
56         "${FILESDIR}"/${PN}-4.7.0-gettext.patch
57         "${FILESDIR}"/${PN}-4.7.5-libdir-additional.patch
58         "${FILESDIR}"/${PN}-4.7.5-libdir-expat.patch
59         "${FILESDIR}"/${PN}-4.7.5-libdir-readline.patch
60         "${FILESDIR}"/${PN}-4.8.2-libdir-configure.patch
61         "${FILESDIR}"/${PN}-4.8.2-libdir-libidn2.patch
62         "${FILESDIR}"/${PN}-4.8.2-libdir-openssl.patch
63         "${FILESDIR}"/${PN}-4.8.2-libdir-zlib.patch
64 )
65
66 src_prepare() {
67         default
68
69         eautoreconf
70
71         elibtoolize # for Darwin bundles
72
73         # bug #536036
74         printf 'set fish:auto-confirm no\nset sftp:auto-confirm no\n' >> ${PN}.conf || die
75 }
76
77 src_configure() {
78         econf \
79                 $(use_enable ipv6) \
80                 $(use_enable nls) \
81                 $(use_with idn libidn2) \
82                 $(use_with socks5 socksdante "${EPREFIX}"/usr) \
83                 $(usex ssl "$(use_with !gnutls openssl ${EPREFIX}/usr)" '--without-openssl') \
84                 $(usex ssl "$(use_with gnutls)" '--without-gnutls') \
85                 --enable-packager-mode \
86                 --sysconfdir="${EPREFIX}"/etc/${PN} \
87                 --with-modules \
88                 --with-readline="${EPREFIX}"/usr \
89                 --without-included-regex
90 }
91
92 src_install() {
93         default
94
95         local script
96         for script in {convert-mozilla-cookies,verify-file}; do
97                 use ${script} || { rm "${ED}"/usr/share/${PN}/${script} || die ;}
98         done
99 }
100
101 pkg_postinst() {
102         xdg_icon_cache_update
103 }
104
105 pkg_postrm() {
106         xdg_icon_cache_update
107 }