# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem 1.0
name		proftpd
version		1.3.2
categories	net
maintainers	jinhyung.org:jenix
description	Highly configurable ftp-server.	
long_description	ProFTPD is a highly configurable ftp daemon for unix \
			and unix-like operating systems. ProFTPD is designed \
			to be somewhat of a "drop-in" replacement for wu-ftpd \
			with a configuration format like Apache.	
homepage	http://proftpd.linux.co.uk/	
platforms	darwin freebsd
master_sites	ftp://ftp.proftpd.org/distrib/source/
checksums	md5     89f5e31fc3d3e02b66424dfc6cc5892d \
		sha1    b48bfb0acde11bd2a2f7a7c74a1d72d497cca46a \
		rmd160  cefc52ad19bd633a24b28438a2cde12fd99c2a56
use_bzip2	yes

configure.args  --sysconfdir=${prefix}/etc --localstatedir=${prefix}/var/run \
		--mandir=${prefix}/share/man install_user=`id -u` install_group=`id -g`

pre-destroot {
	reinplace "s|nogroup|nobody|g" ${worksrcpath}/sample-configurations/basic.conf 
	xinstall -m 755 -d ${destroot}${prefix}/var/run/proftpd
	system "touch ${destroot}${prefix}/var/run/proftpd/proftpd.scoreboard"
}

variant mysql4 {	
	depends_lib-append      port:mysql4
   	configure.args-append   --with-modules=mod_sql:mod_sql_mysql \
				--with-includes=${prefix}/include/mysql \
				--with-libraries=${prefix}/lib/mysql 
}

variant mysql5 {
    depends_lib-append   port:mysql5
   	configure.args-append   --with-modules=mod_sql:mod_sql_mysql \
				--with-includes=${prefix}/include/mysql5/mysql \
				--with-libraries=${prefix}/lib/mysql5/mysql 
}

startupitem.create	yes
startupitem.start	"${prefix}/sbin/proftpd"
startupitem.restart	"/bin/kill -HUP \$(/bin/cat ${prefix}/var/run/proftpd.pid)"
startupitem.stop	"/bin/kill -15 \$(/bin/cat ${prefix}/var/run/proftpd.pid)"
