summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2005-05-02 10:40:20 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2005-05-02 10:40:20 +0000
commit1de4043bdf83fccdd544b42582229681909f76dc (patch)
tree97c0e6e220ccef45b80986a713d9adf88f0a5843
parentUpdate to 0.1.6 (diff)
- Add rcNG script option
PR: 79687 Submitted by: Marcus Grando
Notes
Notes: svn path=/head/; revision=134493
-rw-r--r--ftp/vsftpd/Makefile16
-rw-r--r--ftp/vsftpd/files/vsftpd.sh42
-rw-r--r--ftp/vsftpd/pkg-plist1
3 files changed, 59 insertions, 0 deletions
diff --git a/ftp/vsftpd/Makefile b/ftp/vsftpd/Makefile
index 77190dc3d31a..214131f9893a 100644
--- a/ftp/vsftpd/Makefile
+++ b/ftp/vsftpd/Makefile
@@ -23,6 +23,8 @@ DOCFILES= AUDIT BENCHMARKS BUGS Changelog FAQ INSTALL LICENSE \
LDFLAGS+= -lwrap
+OPTIONS= RC_NG "install RC_NG script" off
+
.if !defined(WITHOUT_SSL) && defined(WITH_VSFTPD_SSL)
USE_OPENSSL= yes
CFLAGS+= -I${OPENSSLINC}
@@ -33,7 +35,18 @@ MAKE_ENV+= LDFLAGS="${LDFLAGS}"
.include <bsd.port.pre.mk>
+.if defined(WITH_RC_NG)
+USE_RC_SUBR= yes
+PLIST_SUB+= RC_NG=""
+.else
+PLIST_SUB+= RC_NG="@comment "
+.endif
+
do-configure:
+.if defined(WITH_RC_NG)
+ @${SED} -e 's,%%RC_SUBR%%,${RC_SUBR},g' -e 's,%%PREFIX%%,${PREFIX},g' \
+ ${FILESDIR}/${PORTNAME}.sh >${WRKDIR}/${PORTNAME}.sh
+.endif
${REINPLACE_CMD} -e "s=/etc/vsftpd.conf=${PREFIX}/etc/vsftpd.conf=" \
${WRKSRC}/defs.h
${REINPLACE_CMD} \
@@ -81,5 +94,8 @@ do-install:
${CHMOD} -R -L a+rX,go-w ${DOCSDIR}/${i}/
.endfor
.endif
+.if defined(WITH_RC_NG)
+ @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/etc/rc.d/${PORTNAME}.sh
+.endif
.include <bsd.port.post.mk>
diff --git a/ftp/vsftpd/files/vsftpd.sh b/ftp/vsftpd/files/vsftpd.sh
new file mode 100644
index 000000000000..6f86deae4574
--- /dev/null
+++ b/ftp/vsftpd/files/vsftpd.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: vsftpd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+
+# Add the following line to /etc/rc.conf to enable `vsftpd':
+#
+# vsftpd_enable="YES"
+# vsftpd_flags="/some/path/conf.file" # Not required
+#
+
+. "%%RC_SUBR%%"
+
+name="vsftpd"
+rcvar=`set_rcvar`
+
+load_rc_config "$name"
+: ${vsftpd_enable="NO"}
+: ${vsftpd_flags=""}
+
+command="%%PREFIX%%/libexec/$name ${vsftpd_flags}"
+required_files="%%PREFIX%%/etc/$name.conf"
+
+vsftpd_check()
+{
+ cat ${required_files} | egrep -E "^listen.*=.*YES$" > /dev/null
+ if [ $? = 1 ]; then
+ err 1 "vsftpd script need "listen=YES" on config file"
+ fi
+ cat ${required_files} | egrep -E "^background.*=.*YES$" > /dev/null
+ if [ $? = 1 ]; then
+ err 1 "vsftpd script need "background=YES" on config file"
+ fi
+}
+
+vsftpd_check
+
+run_rc_command "$1"
diff --git a/ftp/vsftpd/pkg-plist b/ftp/vsftpd/pkg-plist
index 9460fe25cea2..27ccc6905277 100644
--- a/ftp/vsftpd/pkg-plist
+++ b/ftp/vsftpd/pkg-plist
@@ -4,6 +4,7 @@ libexec/vsftpd
etc/vsftpd.conf.dist
@exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi
@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
+%%RC_NG%%etc/rc.d/vsftpd.sh
@unexec rmdir /var/ftp 2>/dev/null || true
@dirrm share/vsftpd/empty
@dirrm share/vsftpd