From aa40ce41b9cf658055bec6e319edd61f7720066a Mon Sep 17 00:00:00 2001
From: Pav Lucistnik <pav@FreeBSD.org>
Date: Fri, 25 Jun 2004 11:22:19 +0000
Subject: - Update to 1.0.19 - Use OPTIONS - Convert rc script to rcNG

PR:		ports/68240, ports/68289
Submitted by:	Toni Viemero <toni.viemero@iki.fi>, Joerg Pulz <Joerg.Pulz@frm2.tum.de>
Approved by:	maintainer
---
 ftp/pure-ftpd/Makefile                          | 38 +++++++++++++--------
 ftp/pure-ftpd/distinfo                          |  4 +--
 ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c | 11 +++++++
 ftp/pure-ftpd/files/pure-ftpd.sh.sample         | 44 ++++++++++++++-----------
 ftp/pure-ftpd/pkg-plist                         |  3 +-
 5 files changed, 63 insertions(+), 37 deletions(-)
 create mode 100644 ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c

diff --git a/ftp/pure-ftpd/Makefile b/ftp/pure-ftpd/Makefile
index ee7925762d87..8f303a543b5b 100644
--- a/ftp/pure-ftpd/Makefile
+++ b/ftp/pure-ftpd/Makefile
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	pure-ftpd
-PORTVERSION=	1.0.18
-PORTREVISION=	0
+PORTVERSION=	1.0.19
 CATEGORIES=	ftp ipv6
 MASTER_SITES=	ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \
 		ftp://ftp2.fr.pureftpd.org/pub/mirrors/ftp.fr.pureftpd.org/pub/pure-ftpd/releases/ \
@@ -25,6 +24,8 @@ COMMENT=	A small, easy to set up, fast and very secure FTP server
 
 USE_BZIP2=	yes
 USE_REINPLACE=	yes
+USE_PERL5_RUN=	yes
+USE_RC_SUBR=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=		--with-everything \
 			--with-paranoidmsg \
@@ -33,6 +34,18 @@ CONFIGURE_ARGS=		--with-everything \
 			--with-largefile \
 			--sysconfdir=${PREFIX}/etc
 
+MAN8=		pure-ftpd.8 pure-ftpwho.8 pure-mrtginfo.8 pure-statsdecode.8 \
+		pure-uploadscript.8 pure-pw.8 pure-pwconvert.8 pure-quotacheck.8 \
+		pure-authd.8
+
+OPTIONS=	LDAP	"Support for users in LDAP directories" off \
+		MYSQL	"Support for users in MySQL database" off \
+		PGSQL	"Support for users in PostgreSQL database" off \
+		PRIVSEP	"Enable privilege separation" off \
+		PERUSERLIMITS	"Per-user concurrency limits" off
+
+.include <bsd.port.pre.mk>
+
 # language support requested?
 .if defined(WITH_LANG)
 CONFIGURE_ARGS+=	--with-language="${WITH_LANG}"
@@ -62,6 +75,11 @@ CONFIGURE_ARGS+=	--with-pgsql
 CONFIGURE_ARGS+=	--with-privsep
 .endif
 
+# per-user concurrency limits requested?
+.if defined(WITH_PERUSERLIMITS)
+CONFIGURE_ARGS+=	--with-peruserlimits
+.endif
+
 # different certificate file location?
 .if defined(WITH_CERTFILE)
 CONFIGURE_ARGS+=	--with-certfile=${WITH_CERTFILE}
@@ -72,12 +90,6 @@ CONFIGURE_ARGS+=	--with-certfile=${WITH_CERTFILE}
 CONFIGURE_ARGS+=	--with-pam
 .endif
 
-MAN8=		pure-ftpd.8 pure-ftpwho.8 pure-mrtginfo.8 pure-statsdecode.8 \
-		pure-uploadscript.8 pure-pw.8 pure-pwconvert.8 pure-quotacheck.8 \
-		pure-authd.8
-
-.include <bsd.port.pre.mk>
-
 .if ${OSVERSION} > 500000
 PAM_TEMPL?=	${FILESDIR}/pam.conf.5
 .else
@@ -96,14 +108,10 @@ DOCS=		AUTHORS CONTACT COPYING HISTORY NEWS \
 		README.Authentication-Modules THANKS pure-ftpd.png \
 		pureftpd.schema README.TLS
 
-CONTRIB=	xml_python_processors.txt pure-vpopauth.pl
+CONTRIB=	xml_python_processors.txt pure-stat.pl pure-vpopauth.pl
 
 pre-fetch:
 	@${ECHO_MSG} "You can use the following additional options:"
-	@${ECHO_MSG} "WITH_LDAP=1           - Support for users in LDAP directories"
-	@${ECHO_MSG} "WITH_MYSQL=1          - Support for users in MySQL databases"
-	@${ECHO_MSG} "WITH_PGSQL=1          - Support for users in PostgreSQL databases"
-	@${ECHO_MSG} "WITH_PRIVSEP=1        - Enable privilege separation"
 	@${ECHO_MSG} "WITH_CERTFILE=/path   - Set different location of certificate file for TLS"
 	@${ECHO_MSG} "WITH_LANG=lang        - Enable compilation of language support, lang is one of"
 	@${ECHO_MSG} "  english, german, romanian, french, french-funny, polish, spanish,"
@@ -128,7 +136,9 @@ post-install:
 	@${MKDIR} ${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
 .endif
-	${INSTALL_SCRIPT} ${FILESDIR}/pure-ftpd.sh.sample ${PREFIX}/etc/rc.d/
+	@${SED} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%RC_SUBR%%|${RC_SUBR}|g" \
+		< ${FILESDIR}/pure-ftpd.sh.sample > ${WRKDIR}/pure-ftpd.sh
+	${INSTALL_SCRIPT} ${WRKDIR}/pure-ftpd.sh ${PREFIX}/etc/rc.d
 .if defined(PAM_TEMPL)
 	${MKDIR} ${PAM_DIR}
 	${INSTALL_DATA} ${PAM_TEMPL} ${PAM_DIR}/${PAM_TARGET}
diff --git a/ftp/pure-ftpd/distinfo b/ftp/pure-ftpd/distinfo
index 32671f992455..f12dc2500a46 100644
--- a/ftp/pure-ftpd/distinfo
+++ b/ftp/pure-ftpd/distinfo
@@ -1,2 +1,2 @@
-MD5 (pure-ftpd-1.0.18.tar.bz2) = 56925bb7a35b07ca70e5453af731acba
-SIZE (pure-ftpd-1.0.18.tar.bz2) = 458995
+MD5 (pure-ftpd-1.0.19.tar.bz2) = 1ff9e9215d3b1fdad36571e892a726d1
+SIZE (pure-ftpd-1.0.19.tar.bz2) = 460292
diff --git a/ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c b/ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c
new file mode 100644
index 000000000000..236a27cde851
--- /dev/null
+++ b/ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c
@@ -0,0 +1,11 @@
+--- src/bsd-getopt_long.c.orig  Sun Jun 20 19:29:34 2004
++++ src/bsd-getopt_long.c       Tue Jun 22 15:21:09 2004
+@@ -472,6 +472,8 @@
+                      *nargv[pure_optind + 1] != '-') {
+                      pure_optarg = nargv[++pure_optind];
+                  }
++            } else {
++                    pure_optarg = nargv[pure_optind];       
+             }
+         }
+         pure_place = EMSG;
diff --git a/ftp/pure-ftpd/files/pure-ftpd.sh.sample b/ftp/pure-ftpd/files/pure-ftpd.sh.sample
index 21739a8e9014..ddcbee1942ae 100644
--- a/ftp/pure-ftpd/files/pure-ftpd.sh.sample
+++ b/ftp/pure-ftpd/files/pure-ftpd.sh.sample
@@ -1,25 +1,29 @@
 #!/bin/sh
 
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
+# PROVIDE: pureftpd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
 
+#
+# Add the following lines to /etc/rc.conf to enable pure-ftpd:
+#
+# pureftpd_enable="YES"
+#
 
-case "$1" in
-start)
-	[ -r ${PREFIX}/etc/pure-ftpd.conf ] && \
-	${PREFIX}/sbin/pure-config.pl ${PREFIX}/etc/pure-ftpd.conf > /dev/null && \
-	echo -n ' pure-ftp'
-	;;
-stop)
-	[ -r /var/run/pure-ftpd.pid ] && \
-	kill `cat /var/run/pure-ftpd.pid` > /dev/null && \
-	echo -n ' pure-ftp'
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
+. %%RC_SUBR%%
 
-exit 0
+name=pureftpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/pure-config.pl
+pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"}
+required_files=${pureftpd_config}
+pidfile=/var/run/pure-ftpd.pid
+procname=pure-ftpd
+
+pureftpd_enable=${pureftpd_enable:-"NO"}
+command_args=${pureftpd_config}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/ftp/pure-ftpd/pkg-plist b/ftp/pure-ftpd/pkg-plist
index 5458395e7882..893595d9d2f9 100644
--- a/ftp/pure-ftpd/pkg-plist
+++ b/ftp/pure-ftpd/pkg-plist
@@ -5,7 +5,7 @@ etc/pure-ftpd.conf.sample
 etc/pureftpd-ldap.conf.sample
 etc/pureftpd-mysql.conf.sample
 etc/pureftpd-pgsql.conf.sample
-etc/rc.d/pure-ftpd.sh.sample
+etc/rc.d/pure-ftpd.sh
 sbin/pure-authd
 sbin/pure-config.pl
 sbin/pure-ftpd
@@ -32,6 +32,7 @@ sbin/pure-uploadscript
 %%PORTDOCS%%%%DOCSDIR%%/pure-ftpd.png
 %%PORTDOCS%%%%DOCSDIR%%/pureftpd.schema
 %%EXAMPLESDIR%%/pam/pure-ftpd
+%%EXAMPLESDIR%%/pure-stat.pl
 %%EXAMPLESDIR%%/pure-vpopauth.pl
 %%EXAMPLESDIR%%/xml_python_processors.txt
 @dirrm %%EXAMPLESDIR%%/pam
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0