--- proftpd-1.2.9_rc1.ebuild 2003-09-13 17:52:26.000000000 +0000 +++ proftpd-1.2.9_rc1_dt.ebuild 2003-09-13 17:40:03.000000000 +0000 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-x86/net-ftp/proftpd/proftpd-1.2.9_rc1.ebuild,v 1.6 2003/09/07 00:12:23 msterret Exp $ -IUSE="ldap pam postgres mysql ssl tcpd" +IUSE="ldap pam postgres mysql ssl tcpd daemontools" MY_P=${P/_/} S=${WORKDIR}/${MY_P} @@ -14,6 +14,7 @@ LICENSE="GPL-2" KEYWORDS="x86 sparc hppa alpha ppc" +RDEPEND="daemontools? ( >=sys-apps/daemontools-0.76 )" DEPEND="net-libs/libpcap pam? ( >=sys-libs/pam-0.75 ) mysql? ( >=dev-db/mysql-3.23.26 ) @@ -22,6 +23,18 @@ ssl? ( >=dev-libs/openssl-0.9.6f ) tcpd? ( >=sys-apps/tcp-wrappers-7.6-r3 )" +pkg_setup() { + if use daemontools ; then + if ! grep -q ^ftplog /etc/group ; then + groupadd ftplog || die "Failed to add group: ftplog" + fi + + if ! grep -q ^ftplog /etc/passwd ; then + useradd -g ftplog -d /dev/null -s /dev/null ftplog || die "Failed to add user: ftplog" + fi + fi +} + src_unpack() { unpack ${MY_P}.tar.bz2 cd ${S} @@ -107,6 +120,19 @@ newins ${FILESDIR}/proftpd.xinetd proftpd exeinto /etc/init.d ; newexe ${FILESDIR}/proftpd.rc6 proftpd + + if use daemontools && [ ! -d /etc/proftpd/supervise ] ; then + diropts -m 755 -o root + dodir /etc/proftpd/supervise /etc/proftpd/supervise/log + exeinto /etc/proftpd/supervise + newexe ${FILESDIR}/proftpd.supervise.run run + exeinto /etc/proftpd/supervise/log + newexe ${FILESDIR}/proftpd.supervise.log run + + diropts -m 755 -o ftplog -g ftplog + dodir /var/log/ftpd + keepdir /var/log/ftpd + fi } pkg_postinst() {