ports/57385: [PATCH] ftp/proftpd 1.2.8_1

Martin Matuska martin at tradex.sk
Tue Sep 30 01:50:14 UTC 2003


>Number:         57385
>Category:       ports
>Synopsis:       [PATCH] ftp/proftpd 1.2.8_1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 29 18:50:09 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 4.8-RELEASE-p10 i386
>Organization:
>Environment:
FreeBSD 4.8-RELEASE-p10 i386
>Description:
	This patch adds rc_subr support to the proftpd port.

>How-To-Repeat:
>Fix:
Removed file: files/proftpd.sh.sample

diff -Nbur proftpd.orig/Makefile proftpd/Makefile
--- proftpd.orig/Makefile	Tue Sep 30 03:36:54 2003
+++ proftpd/Makefile	Tue Sep 30 03:37:54 2003
@@ -7,7 +7,7 @@
 
 PORTNAME=	proftpd
 PORTVERSION=	1.2.8
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	ftp
 MASTER_SITES=	ftp://ftp.proftpd.net/distrib/source/ \
 		ftp://ftp.stikman.com/pub/proftpd/source/ \
@@ -29,6 +29,17 @@
 # WANT_AUTOCONF_VER=213
 # USE_AUTOCONF=	yes
 
+SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g'
+
+USE_RC_SUBR=	yes
+RC_DIR=		${PREFIX}/etc/rc.d
+RC_SUFX=	.sh
+SED_SCRIPT+=	-e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
+		-e 's|%%RC_DIR%%|${RC_DIR}|g' \
+		-e 's|%%RC_SUFX%%|${RC_SUFX}|g'
+PLIST_SUB+=	RC_DIR=${RC_DIR} \
+		RC_SUFX=${RC_SUFX}
+
 CONFIGURE_ARGS=	--localstatedir=/var/run \
 		--disable-sendfile
 
@@ -104,6 +115,9 @@
 	@${SED}	-e 's:/usr/bin:${PREFIX}/bin:' \
 		< ${WRKSRC}/utils/ftpcount.1.pre_sed > ${WRKSRC}/utils/ftpcount.1
 
+post-build:
+	@${SED} ${SED_SCRIPT} ${FILESDIR}/proftpd.sh > ${WRKSRC}/proftpd.sh
+
 do-install:
 	@${INSTALL_PROGRAM} ${WRKSRC}/ftpcount ${PREFIX}/bin/ftpcount
 	@${INSTALL_PROGRAM} ${WRKSRC}/ftpwho ${PREFIX}/bin/ftpwho
@@ -122,7 +136,7 @@
 		${INSTALL_DATA} \
 		${WRKSRC}/sample-configurations/basic.conf ${PREFIX}/etc/proftpd.conf; \
 	fi
-	@${SED} -e 's,/usr/local,${PREFIX},g' ${FILESDIR}/proftpd.sh.sample > ${PREFIX}/etc/rc.d/proftpd.sh.sample
+	@${INSTALL_SCRIPT} ${WRKSRC}/proftpd.sh ${PREFIX}/etc/rc.d/proftpd${RC_SUFX}
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${PREFIX}/share/doc/proftpd
 	@${INSTALL_DATA} ${WRKSRC}/doc/Configuration.html ${PREFIX}/share/doc/proftpd
diff -Nbur proftpd.orig/files/proftpd.sh proftpd/files/proftpd.sh
--- proftpd.orig/files/proftpd.sh	Thu Jan  1 01:00:00 1970
+++ proftpd/files/proftpd.sh	Tue Sep 30 03:37:01 2003
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: proftpd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable proftpd:
+#
+#proftpd_enable="YES"
+#
+# See proftpd(8) for flags
+#
+
+. %%RC_SUBR%%
+
+name=proftpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/libexec/proftpd
+pidfile=/var/run/proftpd.pid
+required_files=%%PREFIX%%/etc/proftpd.conf
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+  rm -f $pidfile
+}
+
+# set defaults
+
+proftpd_enable=${proftpd_enable:-"NO"}
+proftpd_flags=${proftpd_flags:-""}
+
+load_rc_config $name
+run_rc_command "$1"
diff -Nbur proftpd.orig/files/proftpd.sh.sample proftpd/files/proftpd.sh.sample
--- proftpd.orig/files/proftpd.sh.sample	Tue Sep 30 03:36:54 2003
+++ proftpd/files/proftpd.sh.sample	Thu Jan  1 01:00:00 1970
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-
-start)
-	/bin/mkdir -p /var/run/proftpd
-	if [ -x /usr/local/libexec/proftpd ]; then
-		/usr/local/libexec/proftpd && echo -n ' proftpd'
-	fi
-	;;
-
-stop)
-	killall proftpd
-	;;
-*)
-	echo "$0 start | stop"
-	;;
-
-esac
diff -Nbur proftpd.orig/pkg-plist proftpd/pkg-plist
--- proftpd.orig/pkg-plist	Tue Sep 30 03:36:54 2003
+++ proftpd/pkg-plist	Tue Sep 30 03:37:01 2003
@@ -3,7 +3,7 @@
 bin/ftptop
 bin/ftpwho
 etc/proftpd.conf.default
-etc/rc.d/proftpd.sh.sample
+etc/rc.d/proftpd%%RC_SUFX%%
 @exec if [ ! -f %D/etc/proftpd.conf ] ; then cp -p %D/%F %B/proftpd.conf; fi
 libexec/proftpd
 sbin/ftpshut
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list