Portfile

# $Id: Portfile 20128 2006-10-22 17:24:50Z pmq@macports.org $

PortSystem 1.0

name vsftpd
version 2.0.5
categories net
platforms darwin
maintainers pmq@macports.org

description Secure FTP server for UNIX systems
long_description vsftpd is an FTP server, or daemon. The 'vs' stands for \
Very Secure. Obviously this is not a guarantee, but a \
reflection that it is written with security in mind, and \
carefully designed to be resilient to attack.

homepage http://vsftpd.beasts.org
master_sites ftp://vsftpd.beasts.org/users/cevans/
checksums sha1 9b6a079699aaeb01219665acf203c093f94faef0 \
rmd160 297c383aae9fd90f75d5d6a62b2ed5e54adf25d4

patchfiles patch-sysdeputil.c.diff \
patch-vsf_findlibs.sh.diff \
patch-vsftpd.conf.diff

use_configure no

build.target {}

pre-build {
reinplace "s|/etc/|${prefix}/etc/|g" \
${worksrcpath}/defs.h \
${worksrcpath}/tunables.c \
${worksrcpath}/vsftpd.8 \
${worksrcpath}/vsftpd.conf
reinplace "s|/var/|${prefix}/var/|g" \
${worksrcpath}/tunables.c \
${worksrcpath}/vsftpd.conf.5 \
${worksrcpath}/vsftpd.conf
reinplace "s|/usr/share/empty|${prefix}/var/empty|g" \
${worksrcpath}/tunables.c
reinplace "s|/usr/share/ssl/|${prefix}/share/ssl/|g" \
${worksrcpath}/tunables.c
reinplace "s|/etc/vsftpd|${prefix}/etc/vsftpd|g" \
${worksrcpath}/vsftpd.conf.5
reinplace "s|#local_enable|local_enable|" \
${worksrcpath}/vsftpd.conf
reinplace "s|anonymous_enable=YES|anonymous_enable=NO|" \
${worksrcpath}/vsftpd.conf
}

build.env CFLAGS="-fno-common"

destroot {
xinstall -d -W ${destroot}${prefix} \
sbin etc var/empty var/log share/man/man5 \
share/man/man8 share/doc/${name}
file copy ${worksrcpath}/vsftpd ${destroot}${prefix}/sbin
file copy ${worksrcpath}/vsftpd.8 ${destroot}${prefix}/share/man/man8
file copy ${worksrcpath}/vsftpd.conf.5 ${destroot}${prefix}/share/man/man5
file copy ${worksrcpath}/vsftpd.conf ${destroot}${prefix}/etc
xinstall -v -m 644 -W ${worksrcpath} \
AUDIT BENCHMARKS BUGS FAQ README README.security TUNING \
${destroot}${prefix}/share/doc/${name}
file copy ${worksrcpath}/EXAMPLE ${destroot}${prefix}/share/doc/${name}
file copy ${worksrcpath}/xinetd.d ${destroot}${prefix}/share/doc/${name}
}

destroot.keepdirs "${destroot}${prefix}/var/empty/" \
"${destroot}${prefix}/var/log/"

# Notify the user how to launch the ftpd
post-install {
ui_msg "\nYou can now start ${name} in 3 ways,"
ui_msg "either via a super-server like xinetd or inetd,"
ui_msg "in standalone mode or if you're using Darwin 8.x"
ui_msg "and above, launchd(8).\n"
ui_msg "By default, ${name} will runs in standalone"
ui_msg "mode.\n"
}

files