Add rc_subr startup script
PR: ports/74210 Submitted by: "solsTiCe d'Hiver" Approved by: maintainer timeout
This commit is contained in:
parent
7ca2a9fe6c
commit
19521c2ce9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=129098
@ -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>
|
||||
|
50
www/privoxy/files/privoxy.sh.in
Normal file
50
www/privoxy/files/privoxy.sh.in
Normal file
@ -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"
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user