diff options
author | vs <vs@FreeBSD.org> | 2005-02-17 16:43:02 +0000 |
---|---|---|
committer | vs <vs@FreeBSD.org> | 2005-02-17 16:43:02 +0000 |
commit | eea6282671230ba95ad90017ea4605d2b6b97d8f (patch) | |
tree | 7a33ea18c6c365b2abbf4e042750b9fe45370ea9 /www/privoxy | |
parent | 4bf99512fff5cd5a65a6b9dba730a76453696654 (diff) | |
download | FreeBSD-ports-eea6282671230ba95ad90017ea4605d2b6b97d8f.zip FreeBSD-ports-eea6282671230ba95ad90017ea4605d2b6b97d8f.tar.gz |
Add rc_subr startup script
PR: ports/74210
Submitted by: "solsTiCe d'Hiver"
Approved by: maintainer timeout
Diffstat (limited to 'www/privoxy')
-rw-r--r-- | www/privoxy/Makefile | 8 | ||||
-rw-r--r-- | www/privoxy/files/privoxy.sh.in | 50 | ||||
-rw-r--r-- | www/privoxy/pkg-plist | 1 |
3 files changed, 59 insertions, 0 deletions
diff --git a/www/privoxy/Makefile b/www/privoxy/Makefile index 7d8ec089..44e48f0 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 0000000..8afe39d --- /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 8ba4d14..8cda0a6 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 |