# $Id: Portfile,v 1.12 2006/04/24 05:25:05 mww Exp $

PortSystem 1.0
name		proftpd
version		1.3.0
categories	net
maintainers	darwinports@opendarwin.org
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	sha1 d117134035a3d8d130c5aa44d6b1788683a33410
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 
}

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)"

platform darwin 8 {
	configure.env	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}
