aboutsummaryrefslogtreecommitdiff
path: root/www/privoxy
diff options
context:
space:
mode:
authorVolker Stolz <vs@FreeBSD.org>2005-02-17 16:43:02 +0000
committerVolker Stolz <vs@FreeBSD.org>2005-02-17 16:43:02 +0000
commit19521c2ce9d50344d4e8bbf43c5dbae9006af531 (patch)
tree9a32c79d335ab20a4ca89f52a8e408a72a6f90ca /www/privoxy
parent7ca2a9fe6c692278d58f5b001f10e022f4ea493f (diff)
downloadports-19521c2ce9d50344d4e8bbf43c5dbae9006af531.tar.gz
ports-19521c2ce9d50344d4e8bbf43c5dbae9006af531.zip
Notes
Diffstat (limited to 'www/privoxy')
-rw-r--r--www/privoxy/Makefile8
-rw-r--r--www/privoxy/files/privoxy.sh.in50
-rw-r--r--www/privoxy/pkg-plist1
3 files changed, 59 insertions, 0 deletions
diff --git a/www/privoxy/Makefile b/www/privoxy/Makefile
index 7d8ec089c640..44e48f07a12c 100644
--- a/www/privoxy/Makefile
+++ b/www/privoxy/Makefile
@@ -7,6 +7,7 @@
PORTNAME= privoxy
PORTVERSION= 3.0.3
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ijbswa
@@ -19,6 +20,8 @@ WRKSRC= ${WRKDIR}/privoxy-${PORTVERSION}-stable
PKGMESSAGE= ${WRKDIR}/pkg-message
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} # stolen from net/nylon
USE_GMAKE= yes
USE_AUTOCONF_VER= 253
USE_REINPLACE= yes
@@ -27,6 +30,10 @@ MAKEFILE= GNUmakefile
MAN1= privoxy.1
+post-extract:
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/privoxy.sh.in > ${WRKSRC}/privoxy.sh
+
post-patch:
${REINPLACE_CMD} \
-e 's,^\(confdir\) \.,\1 ${PREFIX}/etc/privoxy,' \
@@ -58,6 +65,7 @@ do-install:
.endif
post-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/privoxy.sh ${PREFIX}/etc/rc.d/
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/www/privoxy/files/privoxy.sh.in b/www/privoxy/files/privoxy.sh.in
new file mode 100644
index 000000000000..8afe39dda4a7
--- /dev/null
+++ b/www/privoxy/files/privoxy.sh.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+#
+
+# PROVIDE: privoxy
+# REQUIRE: NETWORKING
+
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+# SET THEM IN THE /etc/rc.conf FILE
+#
+privoxy_enable=${privoxy_enable-"NO"}
+privoxy_flags=${privoxy_flags-""}
+privoxy_pidfile=${privoxy_pidfile-"/var/run/privoxy.pid"}
+
+. %%RC_SUBR%%
+
+name="privoxy"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/privoxy"
+stop_cmd="privoxy_stop"
+start_cmd="privoxy_start"
+
+pidfile="${privoxy_pidfile}"
+configfile=%%PREFIX%%/etc/privoxy/config
+
+privoxy_start()
+{
+ if [ -f ${pidfile} ] ;then
+ echo "${name} is already running"
+ else
+ echo "Starting ${name}."
+ ${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile} \
+ 1>/dev/null 2>&1
+ fi
+}
+
+privoxy_stop()
+{
+ if [ ! -f ${pidfile} ] ;then
+ echo "${name} is not running"
+ else
+ kill -9 `cat ${pidfile}`
+ rm -f ${pidfile}
+ echo "${name} stopped"
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/www/privoxy/pkg-plist b/www/privoxy/pkg-plist
index 8ba4d147f950..8cda0a635e28 100644
--- a/www/privoxy/pkg-plist
+++ b/www/privoxy/pkg-plist
@@ -36,6 +36,7 @@ etc/privoxy/templates/show-version
etc/privoxy/templates/toggle
etc/privoxy/templates/toggle-mini
etc/privoxy/templates/untrusted
+etc/rc.d/privoxy.sh
%%PORTDOCS%%share/doc/privoxy-manual/actions-file.html
%%PORTDOCS%%share/doc/privoxy-manual/configuration.html
%%PORTDOCS%%share/doc/privoxy-manual/filter-file.html