aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorehaupt <ehaupt@FreeBSD.org>2009-04-02 01:47:22 +0800
committerehaupt <ehaupt@FreeBSD.org>2009-04-02 01:47:22 +0800
commit1ab79679457e6866e0d137cb74e4236e1ef5d5dc (patch)
treed71d15da9fbf6ec18c8f5268203713fdb2e4c1c2 /sysutils
parent34bcf606eb9307b8b76726fe7fa484f0d3f8e54f (diff)
downloadfreebsd-ports-gnome-1ab79679457e6866e0d137cb74e4236e1ef5d5dc.tar.gz
freebsd-ports-gnome-1ab79679457e6866e0d137cb74e4236e1ef5d5dc.tar.zst
freebsd-ports-gnome-1ab79679457e6866e0d137cb74e4236e1ef5d5dc.zip
Provide an rc_subr script
PR: 133267 Submitted by: Alexander Logvinov <ports@logvinov.com>
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/watchfolder/Makefile2
-rw-r--r--sysutils/watchfolder/files/watchd.in29
2 files changed, 31 insertions, 0 deletions
diff --git a/sysutils/watchfolder/Makefile b/sysutils/watchfolder/Makefile
index ca4659a9d292..71e4f7df4a90 100644
--- a/sysutils/watchfolder/Makefile
+++ b/sysutils/watchfolder/Makefile
@@ -7,6 +7,7 @@
PORTNAME= watchfolder
PORTVERSION= 0.3.3
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://dstunrea.sdf-eu.org/files/ \
CRITICAL
@@ -17,6 +18,7 @@ COMMENT= Watch folders for new files and process them
MAKE_JOBS_SAFE= yes
WRKSRC= ${WRKDIR}/watchd-${PORTVERSION}
+USE_RC_SUBR= watchd
post-patch:
@${REINPLACE_CMD} -e 's|gcc $$(OPT)|${CC} ${CFLAGS}|' \
diff --git a/sysutils/watchfolder/files/watchd.in b/sysutils/watchfolder/files/watchd.in
new file mode 100644
index 000000000000..b8c0156d44d7
--- /dev/null
+++ b/sysutils/watchfolder/files/watchd.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: watchd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf[.local] to enable watchd
+#
+# watchd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable watchd.
+
+. %%RC_SUBR%%
+
+name="watchd"
+rcvar=${name}_enable
+
+load_rc_config $name
+
+: ${watchd_enable="NO"}
+: ${watchd_config="%%PREFIX%%/etc/watchd.conf"}
+: ${watchd_log="/var/log/watchd.log"}
+
+command="%%PREFIX%%/bin/watchd"
+command_args="${watchd_config} >> ${watchd_log}"
+required_files="${watchd_config}"
+
+run_rc_command "$1"