aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/swatch/Makefile11
-rw-r--r--security/swatch/files/patch-swatch11
-rw-r--r--security/swatch/files/swatch.sh38
-rw-r--r--security/swatch/pkg-plist1
4 files changed, 61 insertions, 0 deletions
diff --git a/security/swatch/Makefile b/security/swatch/Makefile
index 31131a8afaae..b2b2c68b09ed 100644
--- a/security/swatch/Makefile
+++ b/security/swatch/Makefile
@@ -7,6 +7,7 @@
PORTNAME= swatch
PORTVERSION= 3.1.1
+PORTREVISION= 1
CATEGORIES= security sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= swatch
@@ -21,10 +22,20 @@ BUILD_DEPENDS= ${BUILD_DEPENDS_56} \
PERL_CONFIGURE= yes
CONFIGURE_ARGS= INSTALLMAN1DIR=${PREFIX}/man/man1
+USE_RC_SUBR= yes
MAN1= swatch.1
MAN3= Swatch::Actions.3 Swatch::Throttle.3
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
+post-patch:
+ ${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/swatch.sh > ${WRKSRC}/swatch.sh
+
+post-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/swatch.sh ${PREFIX}/etc/rc.d
+
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500800
diff --git a/security/swatch/files/patch-swatch b/security/swatch/files/patch-swatch
new file mode 100644
index 000000000000..9b10f78e15f7
--- /dev/null
+++ b/security/swatch/files/patch-swatch
@@ -0,0 +1,11 @@
+--- swatch.orig Fri Nov 5 12:06:30 2004
++++ swatch Fri Nov 5 12:06:46 2004
+@@ -396,7 +396,7 @@
+ my $Now = 0; # The current time in Unix seconds. Gets set when set_restart_time is called
+ my $thCounter = 0;
+ my $tail_cmd_name = ''; # We'll try to find it in the PATH later
+-my $tail_cmd_args = '-n 0 -f';
++my $tail_cmd_args = '-n 0 -F';
+ $awk_field_syntax = 0;
+
+ my $USAGE = qq/
diff --git a/security/swatch/files/swatch.sh b/security/swatch/files/swatch.sh
new file mode 100644
index 000000000000..b42c989989fd
--- /dev/null
+++ b/security/swatch/files/swatch.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: swatch
+# REQUIRE: DAEMON
+#
+# To enable multiple instance of swatch, add lines like below to
+# /etc/rc.conf.
+#
+# swatch_enable="YES"
+# swatch_rules="1 2 3"
+# swatch_1_flags="--config-file=/rc --tail-file=/log --daemon --pid-file=/pid"
+# swatch_1_user="nobody"
+# swatch_1_chdir="/var/tmp"
+# swatch_1_pidfile="/pid"
+# swatch_2_flags="blah, blah"
+# swatch_3_flags="blah, blah"
+
+. %%RC_SUBR%%
+
+name=swatch
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/swatch
+sig_stop=SIGTERM
+
+load_rc_config ${name}
+
+if [ -n "${swatch_rules}" ]; then
+ for i in ${swatch_rules}; do
+ eval swatch_flags=\$swatch_${i}_flags
+ eval swatch_user=\$swatch_${i}_user
+ eval swatch_chdir=\$swatch_${i}_chdir
+ eval pidfile=\$swatch_${i}_pidfile
+ run_rc_command "$1"
+ done
+fi
diff --git a/security/swatch/pkg-plist b/security/swatch/pkg-plist
index b97417031b82..e43a74c6bb26 100644
--- a/security/swatch/pkg-plist
+++ b/security/swatch/pkg-plist
@@ -1,4 +1,5 @@
bin/swatch
+etc/rc.d/swatch.sh
%%SITE_PERL%%/Swatch/Actions.pm
%%SITE_PERL%%/Swatch/Throttle.pm
%%SITE_PERL%%/auto/Swatch/Actions/autosplit.ix