# 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-devel
#	www/privoxy-devel/Makefile
#	www/privoxy-devel/distinfo
#	www/privoxy-devel/pkg-descr
#	www/privoxy-devel/pkg-plist
#	www/privoxy-devel/files
#	www/privoxy-devel/files/privoxy.in
#	www/privoxy-devel/files/pkg-message.in
#	www/privoxy-devel/pkg-install
#
echo c - www/privoxy-devel
mkdir -p www/privoxy-devel > /dev/null 2>&1
echo x - www/privoxy-devel/Makefile
sed 's/^X//' >www/privoxy-devel/Makefile << 'END-of-www/privoxy-devel/Makefile'
X# New ports collection makefile for:	privoxy-devel
X# Date created:				2006-09-23
X# Whom:					Fabian Keil <fk@fabiankeil.de>
X#
X# $FreeBSD:$
X#
X
XPORTNAME=	privoxy
XPORTVERSION=	3.0.7
XCATEGORIES=	www
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
X		http://www.fabiankeil.de/sourcecode/privoxy/
XMASTER_SITE_SUBDIR=	ijbswa
XPKGNAMESUFFIX= -devel
XDISTNAME=	privoxy-${PORTVERSION}-beta-src
X
XMAINTAINER=	fk@fabiankeil.de
XCOMMENT=	Privoxy is a web proxy with advanced filtering capabilities
X
XLIB_DEPENDS=	pcre:${PORTSDIR}/devel/pcre
X
XWRKSRC=		${WRKDIR}/privoxy-${PORTVERSION}-beta
X
XUSE_GMAKE=	yes
XUSE_AUTOTOOLS=	autoconf:261
X
XUSE_RC_SUBR=	privoxy
XSUB_FILES=	pkg-message
X
XMAKEFILE=	GNUmakefile
X
XCONFLICTS=	privoxy-[0-9]*
X
XMAN1=		privoxy.1
X
XCONFIGURE_ARGS=	--enable-zlib
XCONFIGURE_ENV=  LDFLAGS=-L${LOCALBASE}/lib \
X		CPPFLAGS=-I${LOCALBASE}/include/
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" On
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 ${DOCSDIR}/user-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 defaultfile in default.action standard.action default.filter
X	@${INSTALL_DATA} ${WRKSRC}/${defaultfile} ${PREFIX}/etc/privoxy
X	@${CHOWN} privoxy:privoxy ${PREFIX}/etc/privoxy/${defaultfile}
X	@${CHMOD} 0640 ${PREFIX}/etc/privoxy/${defaultfile}
X.endfor
X	@${MKDIR} ${EXAMPLESDIR}
X.for examplefile in config trust user.action
X	@${INSTALL_DATA} ${WRKSRC}/${examplefile} ${EXAMPLESDIR}/
X	@${CHOWN} privoxy:privoxy ${EXAMPLESDIR}/${examplefile}
X	@${CHMOD} 0640 ${EXAMPLESDIR}/${examplefile}
X.endfor
X	@${INSTALL_MAN}  ${WRKSRC}/privoxy.1 ${MANPREFIX}/man/man1
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}/user-manual
X	@${INSTALL_DATA} ${WRKSRC}/doc/webserver/user-manual/[a-z]* ${DOCSDIR}/user-manual
X	@${INSTALL_DATA} ${WRKSRC}/doc/webserver/p_doc.css ${DOCSDIR}/user-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-devel/Makefile
echo x - www/privoxy-devel/distinfo
sed 's/^X//' >www/privoxy-devel/distinfo << 'END-of-www/privoxy-devel/distinfo'
XMD5 (privoxy-3.0.7-beta-src.tar.gz) = f68843a081fbd80743a50850001ab390
XSHA256 (privoxy-3.0.7-beta-src.tar.gz) = f5575a2e061264cd7f4c0488c0b151bf466c72968e50d10542e6382e6f598417
XSIZE (privoxy-3.0.7-beta-src.tar.gz) = 1853653
END-of-www/privoxy-devel/distinfo
echo x - www/privoxy-devel/pkg-descr
sed 's/^X//' >www/privoxy-devel/pkg-descr << 'END-of-www/privoxy-devel/pkg-descr'
XPrivoxy is a non-caching web proxy with advanced filtering capabilities for
Xenhancing privacy, modifying web page data, managing HTTP cookies, controlling
Xaccess, and removing ads, banners, pop-ups and other obnoxious Internet junk.
XPrivoxy has a flexible configuration and can be customized to suit individual
Xneeds and tastes. Privoxy has application for both stand-alone systems and
Xmulti-user networks.
X
XWWW: http://www.privoxy.org/
END-of-www/privoxy-devel/pkg-descr
echo x - www/privoxy-devel/pkg-plist
sed 's/^X//' >www/privoxy-devel/pkg-plist << 'END-of-www/privoxy-devel/pkg-plist'
Xsbin/privoxy
Xetc/privoxy/default.action
Xetc/privoxy/default.filter
Xetc/privoxy/standard.action
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/forwarding-failed
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%%DOCSDIR%%/user-manual/actions-file.html
X%%DOCSDIR%%/user-manual/appendix.html
X%%DOCSDIR%%/user-manual/config.html
X%%DOCSDIR%%/user-manual/configuration.html
X%%DOCSDIR%%/user-manual/contact.html
X%%DOCSDIR%%/user-manual/copyright.html
X%%DOCSDIR%%/user-manual/files-in-use.jpg
X%%DOCSDIR%%/user-manual/filter-file.html
X%%DOCSDIR%%/user-manual/index.html
X%%DOCSDIR%%/user-manual/installation.html
X%%DOCSDIR%%/user-manual/introduction.html
X%%DOCSDIR%%/user-manual/p_doc.css
X%%DOCSDIR%%/user-manual/proxy2.jpg
X%%DOCSDIR%%/user-manual/proxy_setup.jpg
X%%DOCSDIR%%/user-manual/quickstart.html
X%%DOCSDIR%%/user-manual/seealso.html
X%%DOCSDIR%%/user-manual/startup.html
X%%DOCSDIR%%/user-manual/templates.html
X%%DOCSDIR%%/user-manual/upgradersnote.html
X%%DOCSDIR%%/user-manual/whatsnew.html
X%%EXAMPLESDIR%%/config
X%%EXAMPLESDIR%%/trust
X%%EXAMPLESDIR%%/user.action
X@dirrm %%EXAMPLESDIR%%
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/user-manual
X@dirrm etc/privoxy/templates
X@dirrm etc/privoxy
END-of-www/privoxy-devel/pkg-plist
echo c - www/privoxy-devel/files
mkdir -p www/privoxy-devel/files > /dev/null 2>&1
echo x - www/privoxy-devel/files/privoxy.in
sed 's/^X//' >www/privoxy-devel/files/privoxy.in << 'END-of-www/privoxy-devel/files/privoxy.in'
X#!/bin/sh
X#
X# $FreeBSD: ports/www/privoxy/files/privoxy.in,v 1.2 2006/12/10 22:47:05 miwi 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
Xstart_precmd="if [ ! -e ${privoxy_config} ]; then\
X echo ${privoxy_config} not found. Copying default configuration.;\
X cp %%PREFIX%%/share/examples/privoxy/config ${privoxy_config};\
X chown ${privoxy_user}:${privoxy_user} ${privoxy_config};\
Xfi"
X
Xcommand="%%PREFIX%%/sbin/privoxy"
Xcommand_args="${privoxy_flags} --pidfile ${privoxy_pidfile} ${privoxy_config}"
X
Xrun_rc_command "$1"
X
END-of-www/privoxy-devel/files/privoxy.in
echo x - www/privoxy-devel/files/pkg-message.in
sed 's/^X//' >www/privoxy-devel/files/pkg-message.in << 'END-of-www/privoxy-devel/files/pkg-message.in'
X***********************************************************
X** To start Privoxy on boot, add: privoxy_enable="YES"   **
X** to /etc/rc.conf.                                      **
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** Privoxy example files were copied to:                 **
X** %%PREFIX%%/share/examples/privoxy                     **
X**                                                       **
X** For documentation see:                                **
X** %%PREFIX%%/share/doc/privoxy-manual or 'man privoxy'  **
X**                                                       **
X** Note that default.filter, standard.action and         **
X** default.action get overwritten with each Privoxy      **
X** update. Instead of changing them you should use       **
X** your own action and filter files as described in      **
X** Privoxy's manual.                                     **
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***********************************************************
END-of-www/privoxy-devel/files/pkg-message.in
echo x - www/privoxy-devel/pkg-install
sed 's/^X//' >www/privoxy-devel/pkg-install << 'END-of-www/privoxy-devel/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-devel/pkg-install
exit

