# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	www/privoxy
#	www/privoxy/Makefile
#	www/privoxy/distinfo
#	www/privoxy/pkg-descr
#	www/privoxy/pkg-plist
#	www/privoxy/files
#	www/privoxy/files/privoxy.in
#	www/privoxy/files/pkg-message.in
#	www/privoxy/pkg-install
#
echo c - www/privoxy
mkdir -p www/privoxy > /dev/null 2>&1
echo x - www/privoxy/Makefile
sed 's/^X//' >www/privoxy/Makefile << 'END-of-www/privoxy/Makefile'
X# New ports collection makefile for:	privoxy
X# Date created:				21 November 2002
X# Whom:					John von Essen
X#
X# $FreeBSD$
X#
X
XPORTNAME=	privoxy
XPORTVERSION=	3.0.6
XCATEGORIES=	www
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	ijbswa
XDISTNAME=	privoxy-${PORTVERSION}-stable-src
X
XMAINTAINER=	fk@fabiankeil.de
XCOMMENT=	Privoxy is a web proxy with advanced filtering capabilities
X
XWRKSRC=		${WRKDIR}/privoxy-${PORTVERSION}-stable
X
XUSE_GMAKE=	yes
XUSE_AUTOTOOLS=	autoconf:253
X
XUSE_RC_SUBR=	privoxy
XSUB_FILES=	pkg-message
X
XMAKEFILE=	GNUmakefile
X
X# privoxy-devel is the development release available at the Privoxy website.
X# It's not (yet) part of the FreeBSD port's collection.
XCONFLICTS=	privoxy-devel-[0-9]*
X
XMAN1=		privoxy.1
X
XOPTIONS=	FORCE "Allows to optionally bypass blocks" On \
X		TOGGLE "Support for remote toggling" On \
X		EDITOR "Enable webbased action editor" On \
X		DEBUG "Build with debugging symbols" Off
X
X.include <bsd.port.pre.mk>
X
X.if defined(WITHOUT_FORCE)
XCONFIGURE_ARGS+=        --disable-force
X.endif
X
X.if defined(WITHOUT_TOGGLE)
XCONFIGURE_ARGS+=        --disable-toggle
X.endif
X
X.if defined(WITHOUT_EDITOR)
XCONFIGURE_ARGS+=        --disable-editor
X.endif
X
X.if defined(WITH_DEBUG)
XCONFIGURE_ARGS+=        --with-debug
X.endif
X
Xpost-patch:
X	${REINPLACE_CMD} \
X		-e 's,^\(confdir\) \.,\1 ${PREFIX}/etc/privoxy,' \
X		-e 's,^\(logdir\) \.,\1 /var/log/privoxy,' \
X		-e 's,^\(actionsfile user\),#\1,' \
X	${WRKSRC}/config
X.if !defined(NOPORTDOCS)
X	${REINPLACE_CMD} \
X		-e 's,^#\(user-manual\) http://www.privoxy.org/user-manual/,\1 ${PREFIX}/share/doc/privoxy-manual,' \
X	${WRKSRC}/config
X
X.endif
X
Xpre-configure:
X	@cd ${WRKSRC}; ${AUTOHEADER}
X
Xpre-install:
X	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
X		${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xdo-install:
X	@${MKDIR} ${PREFIX}/etc/privoxy/templates
X	@${INSTALL_PROGRAM} ${WRKSRC}/privoxy ${PREFIX}/sbin
X	@${INSTALL_DATA} ${WRKSRC}/templates/[a-z]* ${PREFIX}/etc/privoxy/templates
X.for file in config default.action standard.action default.filter trust
X	@${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/etc/privoxy
X.endfor
X	@${INSTALL_MAN}  ${WRKSRC}/privoxy.1 ${MANPREFIX}/man/man1
X	@${MKDIR} ${PREFIX}/share/examples/privoxy
X	@${INSTALL_DATA} ${WRKSRC}/user.action ${PREFIX}/share/examples/privoxy
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${PREFIX}/share/doc/privoxy-manual
X	${INSTALL_DATA} ${WRKSRC}/doc/webserver/user-manual/[a-z]* ${PREFIX}/share/doc/privoxy-manual
X	${INSTALL_DATA} ${WRKSRC}/doc/webserver/p_doc.css ${PREFIX}/share/doc/privoxy-manual
X.endif
X
Xpost-install:
X	${MKDIR} /var/log/privoxy
X	${CHOWN} privoxy:privoxy /var/log/privoxy
X	${CHMOD} 0750 /var/log/privoxy
X	${MKDIR} /var/run/privoxy
X	${CHOWN} privoxy:privoxy /var/run/privoxy
X	${CHMOD} 0750 /var/run/privoxy
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.post.mk>
END-of-www/privoxy/Makefile
echo x - www/privoxy/distinfo
sed 's/^X//' >www/privoxy/distinfo << 'END-of-www/privoxy/distinfo'
XMD5 (privoxy-3.0.6-stable-src.tar.gz) = c3b34c620e1174f0c0b91aa2a04ceae4
XSHA256 (privoxy-3.0.6-stable-src.tar.gz) = 49e49d92d3b22c0fe730fef0f067668a51bb8a7aae53277ba709f301066e5dc0
XSIZE (privoxy-3.0.6-stable-src.tar.gz) = 1755661
END-of-www/privoxy/distinfo
echo x - www/privoxy/pkg-descr
sed 's/^X//' >www/privoxy/pkg-descr << 'END-of-www/privoxy/pkg-descr'
XPrivoxy is a web proxy with advanced filtering capabilities for protecting
Xprivacy, filtering web page content, managing cookies, controlling access,
Xand removing ads, banners, pop-ups and other obnoxious Internet junk.
XPrivoxy has a very flexible configuration and can be customized to suit
Xindividual needs and tastes. Privoxy has application for both stand-alone
Xsystems and multi-user networks.
X
XWWW: http://www.privoxy.org/
END-of-www/privoxy/pkg-descr
echo x - www/privoxy/pkg-plist
sed 's/^X//' >www/privoxy/pkg-plist << 'END-of-www/privoxy/pkg-plist'
Xsbin/privoxy
Xetc/privoxy/config
Xetc/privoxy/default.action
Xetc/privoxy/standard.action
Xetc/privoxy/default.filter
Xetc/privoxy/trust
Xetc/privoxy/templates/blocked
Xetc/privoxy/templates/cgi-error-404
Xetc/privoxy/templates/cgi-error-bad-param
Xetc/privoxy/templates/cgi-error-disabled
Xetc/privoxy/templates/cgi-error-file
Xetc/privoxy/templates/cgi-error-file-read-only
Xetc/privoxy/templates/cgi-error-modified
Xetc/privoxy/templates/cgi-error-parse
Xetc/privoxy/templates/cgi-style.css
Xetc/privoxy/templates/connect-failed
Xetc/privoxy/templates/default
Xetc/privoxy/templates/edit-actions-add-url-form
Xetc/privoxy/templates/edit-actions-for-url
Xetc/privoxy/templates/edit-actions-for-url-filter
Xetc/privoxy/templates/edit-actions-list
Xetc/privoxy/templates/edit-actions-list-button
Xetc/privoxy/templates/edit-actions-list-section
Xetc/privoxy/templates/edit-actions-list-url
Xetc/privoxy/templates/edit-actions-remove-url-form
Xetc/privoxy/templates/edit-actions-url-form
Xetc/privoxy/templates/mod-local-help
Xetc/privoxy/templates/mod-support-and-service
Xetc/privoxy/templates/mod-title
Xetc/privoxy/templates/mod-unstable-warning
Xetc/privoxy/templates/no-such-domain
Xetc/privoxy/templates/show-request
Xetc/privoxy/templates/show-status
Xetc/privoxy/templates/show-status-file
Xetc/privoxy/templates/show-url-info
Xetc/privoxy/templates/show-version
Xetc/privoxy/templates/toggle
Xetc/privoxy/templates/toggle-mini
Xetc/privoxy/templates/untrusted
X%%PORTDOCS%%share/doc/privoxy-manual/actions-file.html
X%%PORTDOCS%%share/doc/privoxy-manual/appendix.html
X%%PORTDOCS%%share/doc/privoxy-manual/config.html
X%%PORTDOCS%%share/doc/privoxy-manual/configuration.html
X%%PORTDOCS%%share/doc/privoxy-manual/contact.html
X%%PORTDOCS%%share/doc/privoxy-manual/copyright.html
X%%PORTDOCS%%share/doc/privoxy-manual/files-in-use.jpg
X%%PORTDOCS%%share/doc/privoxy-manual/filter-file.html
X%%PORTDOCS%%share/doc/privoxy-manual/index.html
X%%PORTDOCS%%share/doc/privoxy-manual/installation.html
X%%PORTDOCS%%share/doc/privoxy-manual/introduction.html
X%%PORTDOCS%%share/doc/privoxy-manual/p_doc.css
X%%PORTDOCS%%share/doc/privoxy-manual/proxy2.jpg
X%%PORTDOCS%%share/doc/privoxy-manual/proxy_setup.jpg
X%%PORTDOCS%%share/doc/privoxy-manual/quickstart.html
X%%PORTDOCS%%share/doc/privoxy-manual/seealso.html
X%%PORTDOCS%%share/doc/privoxy-manual/startup.html
X%%PORTDOCS%%share/doc/privoxy-manual/templates.html
X%%PORTDOCS%%share/doc/privoxy-manual/upgradersnote.html
X%%PORTDOCS%%share/doc/privoxy-manual/whatsnew.html
X%%PORTDOCS%%@dirrm share/doc/privoxy-manual
X@dirrm etc/privoxy/templates
X@dirrm etc/privoxy
END-of-www/privoxy/pkg-plist
echo c - www/privoxy/files
mkdir -p www/privoxy/files > /dev/null 2>&1
echo x - www/privoxy/files/privoxy.in
sed 's/^X//' >www/privoxy/files/privoxy.in << 'END-of-www/privoxy/files/privoxy.in'
X#!/bin/sh
X#
X# $FreeBSD: ports/www/privoxy/files/privoxy.in,v 1.1 2006/10/07 16:47:15 pav Exp $
X#
X#
X# PROVIDE: privoxy
X# REQUIRE: NETWORKING
X# BEFORE: LOGIN
X#
X# This rc script understands the following variables
X# which are read from /etc/rc.conf:
X#
X# privoxy_enable  (bool): Set to "NO" by default.
X#                         Set it to "YES" to enable Privoxy.
X# privoxy_config   (str): Privoxy's configuration file. Default is:
X#                         %%PREFIX%%/etc/privoxy/config.
X# privoxy_flags    (str): List of additional Privoxy options you want
X#                         to use. None set by default.
X# privoxy_pidfile  (str): Default is /var/run/privoxy/privoxy.pid.
X# privoxy_user     (str): Privoxy Daemon user. Default is privoxy.
X#
X# Usage:
X# %%PREFIX%%/etc/rc.d/privoxy [fast|force|one](start|stop|restart|rcvar|status|poll)
X
X. %%RC_SUBR%%
X
Xname="privoxy"
Xrcvar=${name}_enable
Xload_rc_config ${name}
X
X: ${privoxy_enable="NO"}
X: ${privoxy_config="%%PREFIX%%/etc/privoxy/config"}
X: ${privoxy_flags=""}
X: ${privoxy_user="privoxy"}
X: ${privoxy_pidfile="/var/run/privoxy/privoxy.pid"}
X
X
Xcommand="%%PREFIX%%/sbin/privoxy"
Xcommand_args="${privoxy_flags} --pidfile ${privoxy_pidfile} ${privoxy_config}"
X
Xrun_rc_command "$1"
X
END-of-www/privoxy/files/privoxy.in
echo x - www/privoxy/files/pkg-message.in
sed 's/^X//' >www/privoxy/files/pkg-message.in << 'END-of-www/privoxy/files/pkg-message.in'
X***********************************************************
X** Privoxy's default configuration file is:              **
X** %%PREFIX%%/etc/privoxy/config                         **
X** It gets overwritten on (re)install, if you make your  **
X** own modifications, you should rename it first.        **
X**                                                       **
X** To start Privoxy on boot, add: privoxy_enable="YES"   **
X** to /etc/rc.conf. If you changed the location of the   **
X** configuration file, additionally add:                 **
X** privoxy_config="%%PREFIX%%/etc/privoxy/your-config"   **
X**                                                       **
X** To start Privoxy manually, run:                       **
X** %%PREFIX%%/etc/rc.d/privoxy forcestart                **
X** The script understands most of the commands listed    **
X** in rc(8), it also contains a list of other rc         **
X** variables you can use.                                **
X**                                                       **
X** If you installed Privoxy as package and are using the **
X** default configuration, you have to make sure the      **
X** directories /var/log/privoxy and /var/run/privoxy     **
X** exist and are owned by privoxy:privoxy.               **
X**                                                       **
X** For documentation see:                                **
X** %%PREFIX%%/share/doc/privoxy-manual or 'man privoxy'  **
X***********************************************************
END-of-www/privoxy/files/pkg-message.in
echo x - www/privoxy/pkg-install
sed 's/^X//' >www/privoxy/pkg-install << 'END-of-www/privoxy/pkg-install'
X#!/bin/sh
X
Xif [ "$2" != "PRE-INSTALL" ]; then
X    exit 0
Xfi
X
XPW=/usr/sbin/pw
XECHO=echo
XUSER=privoxy
XGROUP=${USER}
XUIDGID=201
X
Xif ! ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then
X	if ${PW} groupadd ${GROUP} -g ${UIDGID}; then
X		${ECHO} "Added group \"${GROUP}\"."
X	else
X                ${ECHO} "Adding group \"${GROUP}\" failed..."
X                exit 1
X        fi
Xfi
X
Xif ! ${PW} usershow "${USER}" 2>/dev/null 1>&2; then
X        if ${PW} useradd ${USER} -g ${GROUP} -h - \
X                -s "/sbin/nologin" -d "/nonexistent" \
X                -c "privoxy pseudo-user" -u ${UIDGID}; \
X        then
X                ${ECHO} "Added user \"${USER}\"."
X        else
X                ${ECHO} "Adding user \"${USER}\" failed..."
X                exit 1
X        fi
Xfi
Xexit 0
END-of-www/privoxy/pkg-install
exit

