summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2009-02-17 13:12:04 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2009-02-17 13:12:04 +0000
commit2b359ad88e96e4fc1fda921e08312aaf219ed7f1 (patch)
treed706efe454b34597df7bce9f160279e3f27af434 /net-ftp
parentVersion bump (diff)
downloadhistorical-2b359ad88e96e4fc1fda921e08312aaf219ed7f1.tar.gz
historical-2b359ad88e96e4fc1fda921e08312aaf219ed7f1.tar.bz2
historical-2b359ad88e96e4fc1fda921e08312aaf219ed7f1.zip
Version bump for security bug #258450, minimal changes from 1.3.2_rc2 ebuild for security stabling
Package-Manager: portage-2.2_rc23/cvs/Linux x86_64
Diffstat (limited to 'net-ftp')
-rw-r--r--net-ftp/proftpd/ChangeLog11
-rw-r--r--net-ftp/proftpd/Manifest18
-rw-r--r--net-ftp/proftpd/files/proftpd-1.3.2-upstream-bug-3183.patch101
-rw-r--r--net-ftp/proftpd/proftpd-1.3.2.ebuild251
4 files changed, 368 insertions, 13 deletions
diff --git a/net-ftp/proftpd/ChangeLog b/net-ftp/proftpd/ChangeLog
index 69eef4c4d940..187922dea77d 100644
--- a/net-ftp/proftpd/ChangeLog
+++ b/net-ftp/proftpd/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-ftp/proftpd
-# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/ChangeLog,v 1.186 2008/11/15 10:35:18 maekke Exp $
+# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/ChangeLog,v 1.187 2009/02/17 13:12:04 voyageur Exp $
+
+*proftpd-1.3.2 (17 Feb 2009)
+
+ 17 Feb 2009; Bernard Cafarelli <voyageur@gentoo.org>
+ +files/proftpd-1.3.2-upstream-bug-3183.patch, +proftpd-1.3.2.ebuild:
+ Version bump for security bug #258450, minimal changes from 1.3.2_rc2
+ ebuild for security stabling
15 Nov 2008; Markus Meier <maekke@gentoo.org> proftpd-1.3.2_rc2-r2.ebuild:
amd64/x86 stable, bug #238762
diff --git a/net-ftp/proftpd/Manifest b/net-ftp/proftpd/Manifest
index 1d757fbc83ee..1496a5a7efdf 100644
--- a/net-ftp/proftpd/Manifest
+++ b/net-ftp/proftpd/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX proftpd-1.3.1-CVE-2008-4242.patch 5186 RMD160 1da8efc5d06ae9f8cac7d2bc78df2e76a5f36f75 SHA1 bdb766d56fe10b0a26fcefc6163a5ba6065037b0 SHA256 cfdf5af3c674f3c87f04e421a75013c0562470bcb32dacb8a863018b81696a75
AUX proftpd-1.3.1-bug208840.patch 1000 RMD160 f8cc6aadf4496c3d88a2968d18479f021d40abb8 SHA1 4de215408ec6be835133c41db3015f4dd24a7774 SHA256 b0c0d16ffaeb12e118c929e535e5d8297b8265894ee80b4c8ea32c8c0f0fbb5e
AUX proftpd-1.3.1-bug218850.patch 482 RMD160 934f1a9efdae189df9b30390d1b579a96a7ed99e SHA1 6a4c5225de5a15958868eca42cc44e034e5b28df SHA256 383c1146f40d57845532147e0c28f8df4b116603e6d089d46c5b4c5691f62be4
@@ -9,6 +6,7 @@ AUX proftpd-1.3.1_rc2-bug167003.patch 316 RMD160 7fcade6de378727081d0a14775b2e24
AUX proftpd-1.3.1_rc2-bug175082.patch 9671 RMD160 ab5144464b0b0c618ed51d1907694a56f2f72f5c SHA1 65ea3a861dc493439a8b2e2d3271dba57825bbac SHA256 018077db323cb370dd68fb30c284090316a041f53e02e07478cb1e07e22f30dc
AUX proftpd-1.3.1_rc2-bug178866.patch 1731 RMD160 11d06f7d5ea2ad4678ff989514daaa10d1b92c2c SHA1 7b15937e55b13985ece4a6275cae4c6487b834cb SHA256 658f2e71e1e062e94e8437b10443576432fbc4dd342d297473aef603c6b450aa
AUX proftpd-1.3.1_rc2-bug181712.patch 1098 RMD160 1c4a77dfb401c6d888fabc259e21f5022828335b SHA1 387e079c66df054909a2c7d94485189aa1b09afc SHA256 bdb1364ae5a518f5d50b8a232e94bd83b2d3f846d51566c7ed63550ac3858698
+AUX proftpd-1.3.2-upstream-bug-3183.patch 3032 RMD160 b3acacfadca5a0a8f35a3ca7f16561bc4271f27b SHA1 a967187a682a955369715782409cfd1de2e057bd SHA256 b2f16611b753e4c5d7874d544462217b2e44dc308b45d6a127bb17566c264403
AUX proftpd-1.3.2_rc2-CVE-2008-4242.patch 5522 RMD160 a0f73525f1b6b9f06fd6b6ff0b5eb6112a8abe5b SHA1 6f51a0653ce994c6a0f4e447f152b5676b213a19 SHA256 4d77366e9bc08058f906d7e93c9ec8427fb5d36ba85db9cec74c510ca40ba728
AUX proftpd.conf 1671 RMD160 1242c9c20e21e4832e5771e5fd57085cc5312066 SHA1 91cadfcbd1034f744f6513492258efa3b95fa9e6 SHA256 d289078ee6c5764b16979e7b720d99bcccf4d87176eecd6108dc9dc37949f0dd
AUX proftpd.rc6 1202 RMD160 03e4bd127d379bdc9c62640dea0e6f65b9defda7 SHA1 f674f0871052d7a031b4ee9886b33d6a041d635d SHA256 0ab218ccb323cbcbd53598e93c3565f00245380a9ee1374cc22c2c1db88f7a37
@@ -19,25 +17,23 @@ DIST mod_clamav_new.c 7399 RMD160 ae4de6385245a3c79d3c54bb7af9d2fe45a59feb SHA1
DIST mod_clamav_new.html 4645 RMD160 bc853541e6859e7929c0ed9b01b8f220e09b8ca2 SHA1 58479f3aae082effad3636026a27c09ddb232905 SHA256 ac0ab5f44cfc6c8118664c2a7300450486f52fb3bcde332b4bb9c506dd765a1e
DIST proftpd-1.3.1.tar.bz2 2243888 RMD160 ed47f7a7c446b01c3d00d2d25d89573c787da905 SHA1 0b54286492967172c5355e2f489f9665b46591e5 SHA256 03bc023e5b7b1c04d8eb2d5dca53b931b3e02cc7aba7dd8f629b0878535dc91b
DIST proftpd-1.3.1rc2.tar.bz2 1516464 RMD160 aa928315880cf1e9d1980850ce2bb07193d2ac46 SHA1 7db6435707983fe8e865064661cedb159ebc1cf6 SHA256 7494ea061ef28efc7afa63ffe0a80d598a55909d06dede9254e955c67e6440da
+DIST proftpd-1.3.2.tar.bz2 2457498 RMD160 cefc52ad19bd633a24b28438a2cde12fd99c2a56 SHA1 b48bfb0acde11bd2a2f7a7c74a1d72d497cca46a SHA256 1cadcaf9bb0ff8a2fddcc20fc93844568cf52db872a3aea9f90ab22efa7baf1e
DIST proftpd-1.3.2rc2.tar.bz2 2356053 RMD160 4048327e14ce4e03075bbfdb6de4adb4d5e23f61 SHA1 94c5e71a7be7e65ae04d97df62c8b3675398c3b6 SHA256 1fb46b8b0d1ac11ed80a3106e261e15fd4c0b3bc83c198ab9620a852d31f96b7
DIST proftpd-mod-case-0.3.tar.gz 4781 RMD160 99f46a2cfb88ec2f3070d632dbc17d89d12ec30b SHA1 c8ea2c4604ab2ffa5853284d0696b1dfe518ae84 SHA256 a9affd47558020b2b3f369c9a945ac91d22b45368734d839404b76e0fbdaaf7c
+DIST proftpd-mod-deflate-0.3.1.tar.gz 7934 RMD160 680aeec6be2b99e2d7ed188ab9a7f3dd7a6ad663 SHA1 ba00a242f9b915eb9f7d56655e5ba8e275469933 SHA256 e23f77a4fea5888777fbe466452b830c9f0a2bd8c7246eef72aaa5849b2eb7de
DIST proftpd-mod-deflate-0.3.tar.gz 7704 RMD160 dd51a966942642b2a5ae1cd1c3b3b6f47721637c SHA1 9d08a32da1c1e7e8b126e1fdbc172aa6889bccbc SHA256 dd6650e1cb69ee118319c19bbaa9dbe277b92675ab26e9c70a93e1e93f724adb
DIST proftpd-mod-shaper-0.6.2.tar.gz 19002 RMD160 3d1fdb82596672c9177009ebb30459a017e74c53 SHA1 930d6dc6b8785da48dc7102db5f1eb20546ccd75 SHA256 59f39bca40462c3bba20feb7be031d7453c366adb4b7fa6d8f50974eb45ae99e
DIST proftpd-mod-shaper-0.6.3.tar.gz 19040 RMD160 9978fda37d0099c48d755e53132482506c948c05 SHA1 a5c9a1889c441b9290f2c571ad7fc06bebaf9326 SHA256 a6947836461872adca53dab2708b1e140fa6ce7a8b93ccbe2dafbc3ca63fde67
DIST proftpd-mod-shaper-0.6.4.tar.gz 19172 RMD160 867829eaeb47a737382f14cca19ffdb319df329c SHA1 e4751801b5210562c6ac6274174f71057c0f42e4 SHA256 0d06d58dd5cbabb5ece68a67e9851cc46b7cf61e6f39155bead6f77f65f18a3c
+DIST proftpd-mod-shaper-0.6.5.tar.gz 19175 RMD160 233f399c08c18514b0f23dcc3b0fd0d0670dca42 SHA1 7c841543e7ac3005c914b0f77670c94dc7a8d51f SHA256 dc69e352b0ffd7d76f4d08cad631b6401ed9a67447995f3ce47752e4fc69e935
DIST proftpd-mod-vroot-0.7.2.tar.gz 6071 RMD160 b152162b3714910d5b9378611313041c3e7e17d4 SHA1 3fc4c5874deba4bbe989b0bd54a7478a47f3d876 SHA256 cab5a42390eac4e0b8bdcbe1e6d15804c8029d51da9ad3bd428b46a80cd69d5a
+DIST proftpd-mod-vroot-0.8.3.tar.gz 6999 RMD160 7a8d5a29e7c2754b774cebe649f8a28fc4bf9f85 SHA1 c5448ca0a7c2f1a73093ae6834f6516092cd1508 SHA256 ed3031d8330467e4c1ccb7a395b41a1d5628a89f4fcde80e3bb7ed62e987d85a
EBUILD proftpd-1.3.1-r1.ebuild 7268 RMD160 325241cc3f68e24e73c8f627daee64b42490ca7b SHA1 cea90842c97883ed1804db2ae0502430fe98ca89 SHA256 45305301330d44ba4796d40e72d29b56d00679f0942b0d1e9172c1b25dfba7b7
EBUILD proftpd-1.3.1.ebuild 6951 RMD160 f2d030f82d5c73d2312d413aa9ba2f9f8174219d SHA1 69618caa7299ec3a9b4ae935aa71b0096b937b62 SHA256 f8b1ba70aba8cbb6c5b296731e0ed748c7659eac3935ffe2758df0c3363dab1f
EBUILD proftpd-1.3.1_rc2-r3.ebuild 6338 RMD160 5af01205da38a4e4cdf4ad4ddfbb8f979b42cfdc SHA1 993a40f69700583842aa7c1d1527ee97f7292cc3 SHA256 5977e86165767799cd4123e14bd391b04cbd14f29c563ecc6081d014f9fadbb2
+EBUILD proftpd-1.3.2.ebuild 7201 RMD160 086002839d7119029c2192292edac109dc447e1e SHA1 30061a0de67829b29a4f3cc6e814feca5ac0f183 SHA256 14ea9bdf300072ff91b4f7867f6456d19ccb8c3301c1249ddbb2e746e8d48d01
EBUILD proftpd-1.3.2_rc2-r1.ebuild 6866 RMD160 957abaf1d215e283cf6fba9596c99b38bc0f280b SHA1 7c383e52874c514a07949a103b6492b9379909c5 SHA256 9bd1c563370a5238f7ec4e76bfd35ec62b7ee4bda75e197b058d8a4a58391a63
EBUILD proftpd-1.3.2_rc2-r2.ebuild 7140 RMD160 4dfff1c4625569484d79c6e6f94e09443d1a65ee SHA1 db8a58e69ac73990534b03775a04a3d60fb0c932 SHA256 2243bba7f96ef569c67598885a0585642c6d4cd87337a2d3f1c3ef33942fa30e
EBUILD proftpd-1.3.2_rc2.ebuild 6117 RMD160 cc531c8dd2e471301b60968cb8d20dfa90790e1c SHA1 7eabe46dc93f9cbaf850b4c31c1dc7cd17b5cb84 SHA256 76600e594fb69342e0f30f4ea636a3c47020cb3c8268fc2ea96685b587f58039
-MISC ChangeLog 30856 RMD160 f7bb4832fe20e6d53adf7cd11bcda40c5d4f1a30 SHA1 ddff96b74abf8b560cb8bbea7bce8c279ddc61c3 SHA256 756608586e0e086dafcac8572190651acd30cb726c2ab0bf229fb9f5b92f9c97
+MISC ChangeLog 31118 RMD160 ec5a41a6dcdb3764e67843563679b08b537a8e94 SHA1 27b992c58454f4132f4e34c6ad81fd9e67404687 SHA256 830d34be22bd15b3592f3516da66ff89b09aca5fe2c49453d5e2f9e1beafd026
MISC metadata.xml 1266 RMD160 2eb6ab3b7a7c68eca09e193daaea833a2dc08362 SHA1 86bf2fc8f6b6c944bf384e97e9bcdec7d7ec8d77 SHA256 ffe716530aba4cf0ec4069d86c2b09f9a4dbfca541d7f467c579f871cf78c0de
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.9 (GNU/Linux)
-
-iEYEARECAAYFAkkepfcACgkQkKaRLQcq0GJhWgCdFpqc3gJiAi3CTDHQ+ZPJVlJC
-LxAAnjj89VBclc2qjVCpjJmfRT2JCTnw
-=9Ndj
------END PGP SIGNATURE-----
diff --git a/net-ftp/proftpd/files/proftpd-1.3.2-upstream-bug-3183.patch b/net-ftp/proftpd/files/proftpd-1.3.2-upstream-bug-3183.patch
new file mode 100644
index 000000000000..8f7c1267f2dc
--- /dev/null
+++ b/net-ftp/proftpd/files/proftpd-1.3.2-upstream-bug-3183.patch
@@ -0,0 +1,101 @@
+Index: modules/mod_auth.c
+===================================================================
+RCS file: /cvsroot/proftp/proftpd/modules/mod_auth.c,v
+retrieving revision 1.252
+diff -u -r1.252 mod_auth.c
+--- modules/mod_auth.c 11 Feb 2009 06:56:43 -0000 1.252
++++ modules/mod_auth.c 12 Feb 2009 18:48:16 -0000
+@@ -1074,11 +1074,13 @@
+ * through with the login process. Oh well.
+ */
+
++ memset(sess_ttyname, '\0', sizeof(sess_ttyname));
+ #if (defined(BSD) && (BSD >= 199103))
+ snprintf(sess_ttyname, sizeof(sess_ttyname), "ftp%ld", (long) getpid());
+ #else
+ snprintf(sess_ttyname, sizeof(sess_ttyname), "ftpd%d", (int) getpid());
+ #endif
++ sess_ttyname[sizeof(sess_ttyname)-1] = '\0';
+
+ /* Perform wtmp logging only if not turned off in <Anonymous>
+ * or the current server
+Index: src/main.c
+===================================================================
+RCS file: /cvsroot/proftp/proftpd/src/main.c,v
+retrieving revision 1.361
+diff -u -r1.361 main.c
+--- src/main.c 11 Feb 2009 05:57:12 -0000 1.361
++++ src/main.c 12 Feb 2009 18:48:16 -0000
+@@ -92,8 +92,6 @@
+
+ static unsigned char have_dead_child = FALSE;
+
+-static char sbuf[PR_TUNABLE_BUFFER_SIZE] = {'\0'};
+-
+ #define PR_DEFAULT_CMD_BUFSZ 512
+
+ /* From mod_auth_unix.c */
+@@ -108,7 +106,16 @@
+ static int syntax_check = 0;
+
+ static const char *protocol_name = "FTP";
++
++/* This protocol_name_lc variable is used only by WtmpLog logging. Newer
++ * BSD variants require a name of "ftp" while other, non-BSD variants
++ * prefer "ftpd".
++ */
++#if (defined(BSD) && (BSD >= 199103))
+ static const char *protocol_name_lc = "ftp";
++#else
++static const char *protocol_name_lc = "ftpd";
++#endif
+
+ /* Command handling */
+ static void cmd_loop(server_rec *, conn_t *);
+@@ -185,6 +192,7 @@
+ }
+
+ static void end_login_noexit(void) {
++ char wtmp_buf[PR_TUNABLE_BUFFER_SIZE];
+
+ /* Clear the scoreboard entry. */
+ if (ServerType == SERVER_STANDALONE) {
+@@ -206,20 +214,25 @@
+ strerror(errno));
+ }
+
++ if (session.wtmp_log) {
++ memset(wtmp_buf, '\0', sizeof(wtmp_buf));
++ }
++
+ /* If session.user is set, we have a valid login */
+ if (session.user) {
+ #if (defined(BSD) && (BSD >= 199103))
+- snprintf(sbuf, sizeof(sbuf), "%s%ld", protocol_name_lc,
++ snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%ld", protocol_name_lc,
+ (long) (session.pid ? session.pid : getpid()));
+ #else
+- snprintf(sbuf, sizeof(sbuf), "%s%d", protocol_name_lc,
++ snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%d", protocol_name_lc,
+ (int) (session.pid ? session.pid : getpid()));
+ #endif
+- sbuf[sizeof(sbuf) - 1] = '\0';
++ wtmp_buf[sizeof(wtmp_buf) - 1] = '\0';
+
+- if (session.wtmp_log)
+- log_wtmp(sbuf, "", pr_netaddr_get_sess_remote_name(),
++ if (session.wtmp_log) {
++ log_wtmp(wtmp_buf, "", pr_netaddr_get_sess_remote_name(),
+ pr_netaddr_get_sess_remote_addr());
++ }
+ }
+
+ /* These are necessary in order that cleanups associated with these pools
+@@ -573,7 +586,6 @@
+ }
+
+ protocol_name_lc = lc;
+-
+ return 0;
+ }
+
diff --git a/net-ftp/proftpd/proftpd-1.3.2.ebuild b/net-ftp/proftpd/proftpd-1.3.2.ebuild
new file mode 100644
index 000000000000..57022e88ec81
--- /dev/null
+++ b/net-ftp/proftpd/proftpd-1.3.2.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/proftpd-1.3.2.ebuild,v 1.1 2009/02/17 13:12:04 voyageur Exp $
+
+inherit eutils flag-o-matic toolchain-funcs autotools
+
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+
+IUSE="acl authfile ban case clamav deflate hardened ifsession ipv6 ldap mysql ncurses nls noauthunix opensslcrypt pam postgres radius rewrite selinux shaper sitemisc softquota ssl tcpd vroot xinetd"
+
+CASE_VER="0.3"
+CLAMAV_VER="0.10"
+DEFLATE_VER="0.3.1"
+SHAPER_VER="0.6.5"
+VROOT_VER="0.8.3"
+
+DESCRIPTION="An advanced and very configurable FTP server."
+
+SRC_URI="ftp://ftp.proftpd.org/distrib/source/${P/_/}.tar.bz2
+ case? ( http://www.castaglia.org/${PN}/modules/${PN}-mod-case-${CASE_VER}.tar.gz )
+ clamav? ( http://www.thrallingpenguin.com/resources/mod_clamav-${CLAMAV_VER}.tar.gz )
+ deflate? ( http://www.castaglia.org/${PN}/modules/${PN}-mod-deflate-${DEFLATE_VER}.tar.gz )
+ shaper? ( http://www.castaglia.org/${PN}/modules/${PN}-mod-shaper-${SHAPER_VER}.tar.gz )
+ vroot? ( http://www.castaglia.org/${PN}/modules/${PN}-mod-vroot-${VROOT_VER}.tar.gz )"
+
+HOMEPAGE="http://www.proftpd.org/
+ http://www.castaglia.org/proftpd/
+ http://www.thrallingpenguin.com/resources/mod_clamav.htm"
+
+SLOT="0"
+LICENSE="GPL-2"
+
+DEPEND="acl? ( sys-apps/acl sys-apps/attr )
+ clamav? ( app-antivirus/clamav )
+ ldap? ( >=net-nds/openldap-1.2.11 )
+ mysql? ( virtual/mysql )
+ ncurses? ( sys-libs/ncurses )
+ opensslcrypt? ( >=dev-libs/openssl-0.9.6f )
+ pam? ( virtual/pam )
+ postgres? ( virtual/postgresql-base )
+ ssl? ( >=dev-libs/openssl-0.9.6f )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6-r3 )
+ xinetd? ( virtual/inetd )"
+
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftpd )"
+
+S="${WORKDIR}/${P/_/}"
+
+pkg_setup() {
+ # Add the proftpd user to make the default config
+ # work out-of-the-box
+ enewgroup proftpd
+ enewuser proftpd -1 -1 -1 proftpd
+}
+
+src_unpack() {
+ unpack ${P/_/}.tar.bz2
+
+ cd "${S}"
+
+ # Fix upstream bug 3183 (incorrect logging to wtmp)
+ epatch "${FILESDIR}/${P}-upstream-bug-3183.patch"
+
+ # Fix stripping of files
+ sed -e "s| @INSTALL_STRIP@||g" -i Make*
+
+ if use case ; then
+ unpack ${PN}-mod-case-${CASE_VER}.tar.gz
+ cp -f mod_case/mod_case.c contrib/
+ cp -f mod_case/mod_case.html doc/
+ fi
+
+ if use clamav ; then
+ unpack mod_clamav-${CLAMAV_VER}.tar.gz
+ cp -f mod_clamav-${CLAMAV_VER}/mod_clamav.* contrib/
+ epatch mod_clamav-${CLAMAV_VER}/${PN}.patch
+ fi
+
+ if use deflate ; then
+ unpack ${PN}-mod-deflate-${DEFLATE_VER}.tar.gz
+ cp -f mod_deflate/mod_deflate.c contrib/
+ cp -f mod_deflate/mod_deflate.html doc/
+ fi
+
+ if use shaper ; then
+ unpack ${PN}-mod-shaper-${SHAPER_VER}.tar.gz
+ cp -f mod_shaper/mod_shaper.c contrib/
+ cp -f mod_shaper/mod_shaper.html doc/
+ fi
+
+ if use vroot ; then
+ unpack ${PN}-mod-vroot-${VROOT_VER}.tar.gz
+ cp -f mod_vroot/mod_vroot.c contrib/
+ cp -f mod_vroot/mod_vroot.html doc/
+ fi
+
+ # Fix bug #221275
+ # extract custom PR_ macros from aclocal.m4 to acinclude.m4
+ # and delete the provided aclocal.m4 before running autoreconf
+ elog "Extract custom m4 macros from aclocal.m4..."
+ sed -e '/libtool\.m4/q' aclocal.m4 > acinclude.m4
+ rm -f aclocal.m4
+
+ eautoreconf
+}
+
+src_compile() {
+ addpredict /etc/krb5.conf
+ local modules myconf
+
+ modules="mod_ratio:mod_readme"
+ use acl && modules="${modules}:mod_facl"
+ use ban && modules="${modules}:mod_ban"
+ use case && modules="${modules}:mod_case"
+ use clamav && modules="${modules}:mod_clamav"
+ use deflate && modules="${modules}:mod_deflate"
+ use pam && modules="${modules}:mod_auth_pam"
+ use radius && modules="${modules}:mod_radius"
+ use rewrite && modules="${modules}:mod_rewrite"
+ use shaper && modules="${modules}:mod_shaper"
+ use sitemisc && modules="${modules}:mod_site_misc"
+ use ssl && modules="${modules}:mod_tls"
+ use tcpd && modules="${modules}:mod_wrap"
+ use vroot && modules="${modules}:mod_vroot"
+
+ # pam needs to be explicitely disabled
+ use pam || myconf="${myconf} --enable-auth-pam=no"
+
+ if use ldap ; then
+ modules="${modules}:mod_ldap"
+ append-ldflags "-lresolv"
+ if use ssl ; then
+ CFLAGS="${CFLAGS} -DUSE_LDAP_TLS"
+ fi
+ fi
+
+ if use opensslcrypt ; then
+ myconf="${myconf} --enable-openssl --with-includes=/usr/include/openssl"
+ append-ldflags "-lcrypto"
+ CFLAGS="${CFLAGS} -DHAVE_OPENSSL"
+ fi
+
+ if use nls ; then
+ myconf="${myconf} --enable-nls"
+ fi
+
+ if use mysql && use postgres ; then
+ ewarn "ProFTPD only supports either the MySQL or PostgreSQL modules."
+ ewarn "Presently this ebuild defaults to mysql. If you would like to"
+ ewarn "change the default behaviour, merge ProFTPD with:"
+ ewarn "USE='-mysql postgres' emerge proftpd"
+ epause 5
+ fi
+
+ if use mysql ; then
+ modules="${modules}:mod_sql:mod_sql_mysql"
+ myconf="${myconf} --with-includes=/usr/include/mysql"
+ elif use postgres ; then
+ modules="${modules}:mod_sql:mod_sql_postgres"
+ myconf="${myconf} --with-includes=/usr/include/postgresql"
+ fi
+
+ if use softquota ; then
+ modules="${modules}:mod_quotatab"
+ if use mysql || use postgres ; then
+ modules="${modules}:mod_quotatab_sql"
+ fi
+ if use radius ; then
+ modules="${modules}:mod_quotatab_radius"
+ fi
+ if use ldap ; then
+ modules="${modules}:mod_quotatab_file:mod_quotatab_ldap"
+ else
+ modules="${modules}:mod_quotatab_file"
+ fi
+ fi
+
+ # mod_ifsession should be the last module in the --with-modules list
+ # see http://www.castaglia.org/proftpd/modules/mod_ifsession.html#Installation
+ use ifsession && modules="${modules}:mod_ifsession"
+
+ # bug #30359
+ use hardened && echo > lib/libcap/cap_sys.c
+ gcc-specs-pie && echo > lib/libcap/cap_sys.c
+
+ if use noauthunix ; then
+ myconf="${myconf} --disable-auth-unix"
+ else
+ myconf="${myconf} --enable-auth-unix"
+ fi
+
+ econf \
+ --sbindir=/usr/sbin \
+ --localstatedir=/var/run \
+ --sysconfdir=/etc/proftpd \
+ --enable-shadow \
+ --enable-autoshadow \
+ --enable-ctrls \
+ --with-modules=${modules} \
+ $(use_enable acl facl) \
+ $(use_enable authfile auth-file) \
+ $(use_enable ipv6) \
+ $(use_enable ncurses) \
+ ${myconf} || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ keepdir /var/run/proftpd
+
+ dodoc "${FILESDIR}/proftpd.conf" \
+ COPYING CREDITS ChangeLog NEWS README* \
+ doc/license.txt
+ dohtml doc/*.html
+ dohtml doc/howto/*.html
+
+ docinto rfc
+ dodoc doc/rfc/*.txt
+
+ mv -f "${D}/etc/proftpd/proftpd.conf" "${D}/etc/proftpd/proftpd.conf.distrib"
+
+ insinto /etc/proftpd
+ newins "${FILESDIR}/proftpd.conf" proftpd.conf.sample
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/proftpd.xinetd" proftpd
+ fi
+
+ newinitd "${FILESDIR}/proftpd.rc6" proftpd
+}
+
+pkg_postinst() {
+ elog
+ elog "You can find the config files in /etc/proftpd"
+ elog
+ ewarn "With the introduction of net-ftp/ftpbase the ftp user is now ftp."
+ ewarn "Remember to change that in the configuration file."
+ ewarn
+ if use clamav ; then
+ ewarn "mod_clamav was updated to a new version, which uses Clamd"
+ ewarn "only for virus scanning, so you'll have to set Clamd up"
+ ewarn "and start it, also re-check the mod_clamav docs."
+ ewarn
+ fi
+}