# $Id: Portfile,v 1.27 2006/03/31 18:48:40 matt Exp $

PortSystem 1.0
name			pureftpd
version			1.0.21
categories		net
platforms		darwin
maintainers		darwinports@opendarwin.org
homepage		http://pureftpd.org/
description		A fast and standard-conformant FTP server

long_description	Pure-FTPd is a fast, production-quality, standard-conformant FTP server, \
			based upon Troll-FTPd. \
			Unlike other popular FTP servers, it's designed to be secure in default \
			configuration, has no known buffer overflow, it is really trivial to set \
			up and it is especially designed for modern kernels. \
			Features include chroot()ed and/or virtual chroot()ed home directories, \
			virtual domains, built-in 'ls', anti-warez system, bounded ports for \
			passive downloads, FXP protocol, bandwidth throttling, ratios, \
			LDAP / MySQL / PostgreSQL-based authentication, fortune files, Apache-like \
			log files, fast standalone mode, text / HTML / XML real-time status report, \
			virtual users, virtual quotas and more.

master_sites		ftp://ftp.pureftpd.org/pure-ftpd/releases/ \
			ftp://ftp.fr.pureftpd.org/pure-ftpd/releases/

distname                pure-ftpd-${version}
use_bzip2		yes

checksums		md5 ca8a8dbec0cd9c8ea92fc4c37ea9c410 \
			sha1 1405ff2b9b9c3616c4e390eb99779884173a3347 \
			rmd160 1ad61243c1f8a8d1055ee839eec0d9117681cf20

patchfiles		patch-pam_pureftpd.diff

configure.args 		--with-everything \
			--with-virtualchroot \
			--with-paranoidmsg \
			--with-pam \
			--with-rendezvous \
			--without-capabilities \
			--mandir=${prefix}/share/man \
			--infodir=${prefix}/share/info

destroot.destdir	prefix=${destroot}${prefix} \
			mandir=${destroot}${prefix}/share/man

post-destroot {		file mkdir ${destroot}${prefix}/share/doc/${name}
			xinstall -m 644 -v -W ${worksrcpath} \
				AUTHORS CONTACT FAQ HISTORY NEWS README \
				README.Authentication-Modules README.Configuration-File \
				README.LDAP README.MacOS-X README.MySQL README.PGSQL \
				README.TLS README.Virtual-Users	pureftpd-ldap.conf \
				pureftpd-mysql.conf pureftpd-pgsql.conf THANKS \
				${destroot}${prefix}/share/doc/${name}
			file copy ${worksrcpath}/pam/pure-ftpd \
				${destroot}${prefix}/share/doc/${name}
			}

# Notify the user how to launch the ftpd
post-install {		ui_msg "\nYou can now start PureFTPd in 3 ways,"
			ui_msg "either via xinetd, in standalone mode, or"
			ui_msg "if you're using Mac OS X 10.4 / Darwin 8.x"
			ui_msg "via launchd(8).\n"
			ui_msg "If you're under Mac OS X 10.3 or Mac OS X 10.4,"
			ui_msg "you have to copy ${prefix}/share/doc/${name}/pure-ftpd"
			ui_msg "to /etc/pam.d and use the '-lpam' flag when"
			ui_msg "launching pure-ftpd to have PAM working.\n"
			}
			
platform darwin 6	{ configure.args-delete --with-pam }

variant tls {		depends_lib		lib:libssl.0.9:openssl
			configure.args-append	--with-tls \
						--with-certfile=${prefix}/etc/ssl/private/pure-ftpd.pem
			}

variant nobanner	{ configure.args-append --without-banner }

variant french		{ configure.args-append --with-language=french }

variant french-funny	{ configure.args-append --with-language=french-funny }

variant german		{ configure.args-append --with-language=german }

variant spanish		{ configure.args-append --with-language=spanish }

variant italian		{ configure.args-append --with-language=italian }

variant polish		{ configure.args-append --with-language=polish }

variant danish		{ configure.args-append --with-language=danish }

variant romanian	{ configure.args-append --with-language=romanian }

variant brazilian	{ configure.args-append --with-language=brazilian }

variant slovak		{ configure.args-append --with-language=slovak }

variant dutch		{ configure.args-append --with-language=dutch }

variant korean		{ configure.args-append --with-language=korean }

variant swedish		{ configure.args-append --with-language=swedish }

variant norwegian	{ configure.args-append --with-language=norwegian }

variant russian		{ configure.args-append --with-language=russian }

variant czech		{ configure.args-append --with-language=czech }

variant traditional-chinese	{ configure.args-append --with-language=traditional-chinese }       

variant simplified-chinese	{ configure.args-append --with-language=simplified-chinese }

