aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclement <clement@FreeBSD.org>2004-06-12 05:42:16 +0800
committerclement <clement@FreeBSD.org>2004-06-12 05:42:16 +0800
commitbe87b3195515274a38ecd465c8e2c5c3cdb0acd4 (patch)
tree46b2d24ab1cfd18ffb6fd3c2ef76d99515b41597
parentd877d5c7bec2d378a4d8938bed9668a5a68d90f9 (diff)
downloadfreebsd-ports-gnome-be87b3195515274a38ecd465c8e2c5c3cdb0acd4.tar.gz
freebsd-ports-gnome-be87b3195515274a38ecd465c8e2c5c3cdb0acd4.tar.zst
freebsd-ports-gnome-be87b3195515274a38ecd465c8e2c5c3cdb0acd4.zip
- Add RCng startup script
-rw-r--r--ftp/moftpd/Makefile11
-rw-r--r--ftp/moftpd/files/moftpd.sh41
2 files changed, 52 insertions, 0 deletions
diff --git a/ftp/moftpd/Makefile b/ftp/moftpd/Makefile
index aba61efae4ec..7ca3f6082271 100644
--- a/ftp/moftpd/Makefile
+++ b/ftp/moftpd/Makefile
@@ -18,10 +18,14 @@ COMMENT= A powerful FTP server supporting IPv6, TLS, and much more
GNU_CONFIGURE= yes
USE_OPENSSL= yes
USE_GMAKE= yes
+USE_RC_SUBR= yes
USE_PERL5_BUILD=yes
CONFIGURE_ENV+= LIBS="${LIBS}"
+CONFIGURE_ARGS= --localstatedir=/var
+
MAN8= moftpd.8 moftpadmin.8
LIBS+= -lcrypt
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
.if defined(WITH_MYSQL)
CFLAGS+= -I${LOCALBASE}/include
@@ -30,4 +34,11 @@ LIBS+= -L${LOCALBASE}/lib/mysql
CONFIGURE_ARGS+= --without-sql
.endif
+post-patch:
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/moftpd.sh > ${WRKDIR}/moftpd.sh
+
+post-install:
+ @${INSTALL_SCRIPT} ${WRKDIR}/moftpd.sh ${PREFIX}/etc/rc.d/
+
.include <bsd.port.mk>
diff --git a/ftp/moftpd/files/moftpd.sh b/ftp/moftpd/files/moftpd.sh
new file mode 100644
index 000000000000..eaa61d6520a4
--- /dev/null
+++ b/ftp/moftpd/files/moftpd.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: moftpd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable moftpd:
+# moftpd_enable (bool): Set to "NO" by default.
+# moftpdlimits_enable (bool):Set to "NO" by default.
+# Set it to yes to run `limits $limits_args`
+# just before moftpd starts.
+# moftpd_flags (str): Set to "" by default.
+# Extra flags passed to start command
+# moftpdlimits_args (str): Default to "-e -C daemon"
+# Arguments of pre-start limits run.
+#
+. %%RC_SUBR%%
+
+name="moftpd"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/moftpd"
+pidfile="/var/run/moftpd.pid"
+required_files=%%PREFIX%%/etc/moftpd.conf
+
+[ -z "$moftpd_enable" ] && moftpd_enable="NO"
+[ -z "$moftpd_flags" ] && moftpd_flags=""
+[ -z "$moftpdlimits_enable" ] && moftpdlimits_enable="NO"
+[ -z "$moftpdlimits_args" ] && moftpdlimits_args="-e -C daemon"
+
+load_rc_config $name
+
+checkyesno moftpdlimits_enable && \
+ start_precmd="eval `/usr/bin/limits ${moftpdlimits_args}` 2>/dev/null"
+
+run_rc_command "$1"