diff options
author | pav <pav@FreeBSD.org> | 2005-11-14 16:37:29 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2005-11-14 16:37:29 +0800 |
commit | 6d0c2fc0ae5e5b76a03613d9ee95957469eb930a (patch) | |
tree | 855c83dedb3853bd542a036c8adac67a4c61b5b2 | |
parent | 09f730105f92333f80dd9c48688450d774cce73d (diff) | |
download | freebsd-ports-gnome-6d0c2fc0ae5e5b76a03613d9ee95957469eb930a.tar.gz freebsd-ports-gnome-6d0c2fc0ae5e5b76a03613d9ee95957469eb930a.tar.zst freebsd-ports-gnome-6d0c2fc0ae5e5b76a03613d9ee95957469eb930a.zip |
- Run privoxy under user 'privoxy'
- Modernize rc script, pkg-message and SHA256 while here
PR: ports/88602
Submitted by: aeonflux <aeonflux@aeonflux.no-ip.com>
Approved by: John Von Essen <john@essenz.com> (maintainer)
-rw-r--r-- | www/privoxy/Makefile | 24 | ||||
-rw-r--r-- | www/privoxy/distinfo | 1 | ||||
-rw-r--r-- | www/privoxy/files/pkg-message.in (renamed from www/privoxy/pkg-message.in) | 0 | ||||
-rw-r--r-- | www/privoxy/files/privoxy.sh.in | 2 | ||||
-rw-r--r-- | www/privoxy/pkg-install | 33 | ||||
-rw-r--r-- | www/privoxy/pkg-plist | 1 |
6 files changed, 47 insertions, 14 deletions
diff --git a/www/privoxy/Makefile b/www/privoxy/Makefile index 44e48f07a12c..03cf4d7074ab 100644 --- a/www/privoxy/Makefile +++ b/www/privoxy/Makefile @@ -7,7 +7,7 @@ PORTNAME= privoxy PORTVERSION= 3.0.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ijbswa @@ -18,22 +18,17 @@ COMMENT= Privoxy is a web proxy with advanced filtering capabilities 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 +USE_RC_SUBR= privoxy.sh +SUB_FILES= pkg-message + 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,' \ @@ -46,8 +41,8 @@ pre-configure: @cd ${WRKSRC}; ${AUTOHEADER} pre-install: - @${SED} -e 's,%%PREFIX%%,${PREFIX},g' \ - ${PKGDIR}/pkg-message.in > ${PKGMESSAGE} + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \ + ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: @${MKDIR} ${PREFIX}/etc/privoxy/templates @@ -65,7 +60,12 @@ do-install: .endif post-install: - ${INSTALL_SCRIPT} ${WRKSRC}/privoxy.sh ${PREFIX}/etc/rc.d/ + ${TOUCH} /var/log/privoxy + ${CHOWN} privoxy:privoxy /var/log/privoxy + ${CHMOD} 0640 /var/log/privoxy + ${TOUCH} /var/log/jarfile + ${CHOWN} privoxy:privoxy /var/log/jarfile + ${CHMOD} 0600 /var/log/jarfile @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/www/privoxy/distinfo b/www/privoxy/distinfo index 1d01bde79ce1..e037cf1f90af 100644 --- a/www/privoxy/distinfo +++ b/www/privoxy/distinfo @@ -1,2 +1,3 @@ MD5 (privoxy-3.0.3-stable-src.tar.gz) = b0710be8af09409bfb03f52523a17010 +SHA256 (privoxy-3.0.3-stable-src.tar.gz) = 4dab0049049c1ae6cfb00faea606d981535d0f0a65aab17e3179cc3d75de9f84 SIZE (privoxy-3.0.3-stable-src.tar.gz) = 1561072 diff --git a/www/privoxy/pkg-message.in b/www/privoxy/files/pkg-message.in index 7b127e5e7aa3..7b127e5e7aa3 100644 --- a/www/privoxy/pkg-message.in +++ b/www/privoxy/files/pkg-message.in diff --git a/www/privoxy/files/privoxy.sh.in b/www/privoxy/files/privoxy.sh.in index 8afe39dda4a7..3080acb75218 100644 --- a/www/privoxy/files/privoxy.sh.in +++ b/www/privoxy/files/privoxy.sh.in @@ -30,7 +30,7 @@ privoxy_start() echo "${name} is already running" else echo "Starting ${name}." - ${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile} \ + su -m privoxy -c '${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile}' \ 1>/dev/null 2>&1 fi } diff --git a/www/privoxy/pkg-install b/www/privoxy/pkg-install new file mode 100644 index 000000000000..a00abc6690e6 --- /dev/null +++ b/www/privoxy/pkg-install @@ -0,0 +1,33 @@ +#!/bin/sh + +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +PW=/usr/sbin/pw +ECHO=echo +USER=privoxy +GROUP=${USER} +UIDGID=201 + +if ! ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then + if ${PW} groupadd ${GROUP} -g ${UIDGID}; then + ${ECHO} "Added group \"${GROUP}\"." + else + ${ECHO} "Adding group \"${GROUP}\" failed..." + exit 1 + fi +fi + +if ! ${PW} usershow "${USER}" 2>/dev/null 1>&2; then + if ${PW} useradd ${USER} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "privoxy pseudo-user" -u ${UIDGID}; \ + then + ${ECHO} "Added user \"${USER}\"." + else + ${ECHO} "Adding user \"${USER}\" failed..." + exit 1 + fi +fi +exit 0 diff --git a/www/privoxy/pkg-plist b/www/privoxy/pkg-plist index 8cda0a635e28..8ba4d147f950 100644 --- a/www/privoxy/pkg-plist +++ b/www/privoxy/pkg-plist @@ -36,7 +36,6 @@ 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 |