]> Pileus Git - ~andy/sunrise/blob - net-ftp/vsftpd-devnet/vsftpd-devnet-2.1.2_p1.ebuild
sunrise/ app-portage/elog-list/elog-list-0.0.6.ebuild: Update headers for 2010
[~andy/sunrise] / net-ftp / vsftpd-devnet / vsftpd-devnet-2.1.2_p1.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="Very Secure FTP Daemon with devnet patchset"
8 HOMEPAGE="http://vsftpd.devnet.ru/"
9 SRC_URI="http://vsftpd.devnet.ru/files/${PV%_p*}/ext.${PV#*_p}/${PN%-*}-${PV%_p*}-ext${PV#*_p}.tgz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="caps pam tcpd ssl selinux xinetd"
15
16 DEPEND="caps? ( sys-libs/libcap )
17         pam? ( virtual/pam )
18         tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
19         ssl? ( >=dev-libs/openssl-0.9.7d )"
20 RDEPEND="${DEPEND}
21         !net-ftp/vsftpd
22         net-ftp/ftpbase
23         selinux? ( sec-policy/selinux-ftpd )
24         xinetd? ( sys-apps/xinetd )"
25
26 S=${WORKDIR}/${PN%-*}-${PV%_p*}-ext.${PV#*_p}
27
28 src_unpack() {
29         unpack ${A}
30         cd "${S}"
31
32         # Patch the source, config and the manpage to use /etc/vsftpd/
33         epatch "${FILESDIR}/${PN}-2.1.0-gentoo.patch"
34
35         # Configure vsftpd build defaults
36         use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
37         use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
38         use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
39
40         # Ensure that we don't link against libcap unless asked
41         if ! use caps ; then
42                 sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c
43                 epatch "${FILESDIR}"/${PN}-2.1.0-dont-link-caps.patch
44         fi
45
46         # Let portage control stripping
47         sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile
48         # disabling background by default 
49         sed -i 's/background = 1/background = 0/' tunables.c
50 }
51
52 src_compile() {
53         emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" || die
54 }
55
56 src_install() {
57         doman vsftpd.conf.5 vsftpd.8 || die
58         dosbin vsftpd || die
59
60         dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
61                 README README.security REWARD SIZE \
62                 SPEED TODO TUNING || die
63         newdoc vsftpd.conf vsftpd.conf.example || die
64
65         docinto security
66         dodoc SECURITY/* || die
67
68         insinto "/usr/share/doc/${PF}/examples"
69         doins -r EXAMPLE/* || die
70
71         insinto /etc/vsftpd
72         newins vsftpd.conf vsftpd.conf.example || die
73
74         insinto /etc/logrotate.d
75         newins "${FILESDIR}/vsftpd.logrotate" vsftpd || die
76
77         if use xinetd ; then
78                 insinto /etc/xinetd.d
79                 newins "${FILESDIR}/vsftpd.xinetd" vsftpd || die
80         fi
81
82         newinitd "${FILESDIR}/vsftpd.init" vsftpd || die
83
84         keepdir /usr/share/vsftpd/empty
85 }
86
87 pkg_postinst() {
88         # If we use xinetd, then we comment out listen=YES
89         # so that our default config works under xinetd - fixes #78347
90         if use xinetd ; then
91                 sed -i '/\listen=YES/s/^/#/g' "${D}"/etc/vsftpd/vsftpd.conf.example
92         fi
93
94         einfo "vsftpd init script can now be multiplexed."
95         einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
96         einfo "If you symlink the init script to another one, say vsftpd.foo"
97         einfo "then that uses /etc/vsftpd/foo.conf instead."
98         einfo
99         einfo "Example:"
100         einfo "   cd /etc/init.d"
101         einfo "   ln -s vsftpd vsftpd.foo"
102         einfo "You can now treat vsftpd.foo like any other service"
103 }