aboutsummaryrefslogtreecommitdiffstats
path: root/testing/privoxy
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-05-26 13:02:00 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-05-26 13:02:00 +0000
commitcdd6e1dfa1cd5e59f95a5dbdf978c7c766eacd26 (patch)
tree7e1fbdec72a6b0330215e2abe2d26e053e301553 /testing/privoxy
parent5265583427de9887f6a8109c2494d17052b9674c (diff)
downloadaports-cdd6e1dfa1cd5e59f95a5dbdf978c7c766eacd26.tar.bz2
aports-cdd6e1dfa1cd5e59f95a5dbdf978c7c766eacd26.tar.xz
testing/privoxy: new aport
A web proxy with advanced filtering capabilities http://www.privoxy.org
Diffstat (limited to 'testing/privoxy')
-rw-r--r--testing/privoxy/APKBUILD55
-rw-r--r--testing/privoxy/privoxy-3.0.16-gentoo.patch108
-rw-r--r--testing/privoxy/privoxy.initd32
-rw-r--r--testing/privoxy/privoxy.logrotate9
-rw-r--r--testing/privoxy/privoxy.pre-install6
5 files changed, 210 insertions, 0 deletions
diff --git a/testing/privoxy/APKBUILD b/testing/privoxy/APKBUILD
new file mode 100644
index 0000000000..3499e91725
--- /dev/null
+++ b/testing/privoxy/APKBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=privoxy
+pkgver=3.0.16
+pkgrel=0
+pkgdesc="A web proxy with advanced filtering capabilities"
+url="http://www.privoxy.org"
+license="GPL"
+pkgusers="privoxy"
+pkggroups="privoxy"
+depends=
+makedepends="autoconf automake pcre-dev zlib-dev coreutils"
+install="privoxy.pre-install"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/ijbswa/$pkgname-$pkgver-stable-src.tar.gz
+ $pkgname.initd
+ $pkgname.logrotate
+ privoxy-3.0.16-gentoo.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver-stable
+prepare() {
+ cd "$_builddir"
+ patch -p1 -i "$srcdir"/privoxy-3.0.16-gentoo.patch || return 1
+ aclocal && autoheader && autoconf
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --localstatedir=/var/ \
+ --enable-zlib \
+ --enable-dynamic-pcre \
+ --with-user=privoxy \
+ --with-group=privoxy \
+ --sysconfdir=/etc/privoxy \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install
+ rm $pkgdir/var/log/privoxy/*
+ install -D -m755 "$srcdir"/privoxy.initd "$pkgdir"/etc/init.d/privoxy
+ install -D -m644 "$srcdir"/privoxy.logrotate \
+ "$pkgdir"/etc/logrotate.d/privoxy
+ find "$pkgdir"/etc/privoxy/ -type d | xargs chmod 770
+ find "$pkgdir"/etc/privoxy/ -type f | xargs chmod 660
+ chown -R privoxy:privoxy "$pkgdir"/var/log/privoxy
+}
+
+md5sums="64d3ffcdf8307e04a375773bb4eb255e privoxy-3.0.16-stable-src.tar.gz
+170d5679e4c3504f07ef1a4c9859e9b8 privoxy.initd
+f2b6a652dbfbc65e5b89024a8ea3da7e privoxy.logrotate
+48cce19ecdcf8f17a021ac3aa8f837bc privoxy-3.0.16-gentoo.patch"
diff --git a/testing/privoxy/privoxy-3.0.16-gentoo.patch b/testing/privoxy/privoxy-3.0.16-gentoo.patch
new file mode 100644
index 0000000000..d445ec1b01
--- /dev/null
+++ b/testing/privoxy/privoxy-3.0.16-gentoo.patch
@@ -0,0 +1,108 @@
+--- privoxy/GNUmakefile.in
++++ privoxy/GNUmakefile.in
+@@ -61,10 +61,10 @@
+ MAN_DIR = @mandir@
+ MAN_DEST = $(MAN_DIR)/man1
+ SHARE_DEST = @datadir@
+-DOC_DEST = $(SHARE_DEST)/doc/privoxy
++DOC_DEST = @docdir@
+-VAR_DEST = @localstatedir@
++VAR_DEST = /var
+ LOGS_DEST = $(VAR_DEST)/log/privoxy
+ PIDS_DEST = $(VAR_DEST)/run
+
+ # if $prefix = /usr/local then the default CONFDEST change from
+ # CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy
+@@ -901,34 +901,8 @@
+ fi ;\
+ $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
+ for i in $(CONFIGS); do \
+- if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
+- $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\
+- $(ECHO) Installing fresh $$i;\
+ $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
+- elif [ -s "$(CONF_DEST)/$$i" ]; then \
+- $(ECHO) Installing $$i as $$i.new ;\
+- $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\
+- NEW=1;\
+- else \
+- $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
+- fi ;\
+ done ;\
+- if [ -n "$$NEW" ]; then \
+- $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\
+- $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\
+- fi ;\
+- [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
+- $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
+- $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
+- if [ x$$USER != x ]; then \
+- $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
+- $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
+- fi ;\
+- if [ x$$GROUP_T != x ]; then \
+- $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
+- $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
+- fi ;\
+- $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
+ if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
+ if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
+ $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
+--- privoxy/config
++++ privoxy/config
+@@ -267,7 +267,7 @@
+ #
+ # No trailing "/", please.
+ #
+-confdir .
++confdir /etc/privoxy
+ #
+ #
+ # 2.2. templdir
+@@ -324,7 +324,7 @@
+ #
+ # No trailing "/", please.
+ #
+-logdir .
++logdir /var/log/privoxy
+ #
+ #
+ # 2.4. actionsfile
+@@ -464,7 +464,7 @@
+ # Any log files must be writable by whatever user Privoxy is
+ # being run as (on Unix, default user id is "privoxy").
+ #
+-logfile logfile
++logfile privoxy.log
+ #
+ #
+ # 2.7. trustfile
+--- privoxy/default.action.master
++++ privoxy/default.action.master
+@@ -564,7 +564,7 @@
+ { \
+ +change-x-forwarded-for{block} \
+ +hide-from-header{block} \
+-+set-image-blocker{pattern} \
+++set-image-blocker{blank} \
+ }
+ standard.Cautious
+
+@@ -584,7 +584,7 @@
+ +hide-from-header{block} \
+ +hide-referrer{conditional-block} \
+ +session-cookies-only \
+-+set-image-blocker{pattern} \
+++set-image-blocker{blank} \
+ }
+ standard.Medium
+
+@@ -623,7 +623,7 @@
+ +hide-referrer{conditional-block} \
+ +limit-connect{,} \
+ +overwrite-last-modified{randomize} \
+-+set-image-blocker{pattern} \
+++set-image-blocker{blank} \
+ }
+ standard.Advanced
+
diff --git a/testing/privoxy/privoxy.initd b/testing/privoxy/privoxy.initd
new file mode 100644
index 0000000000..ef984ea3df
--- /dev/null
+++ b/testing/privoxy/privoxy.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/privoxy/files/privoxy.initd,v 1.2 2007/11/14 05:14:56 mrness Exp $
+
+CONFFILE=/etc/${SVCNAME}/config
+PIDFILE=/var/run/${SVCNAME}.pid
+
+depend() {
+ need net
+}
+
+start() {
+ if [ ! -f "${CONFFILE}" ]; then
+ eerror "Configuration file ${CONFFILE} not found!"
+ return 1
+ fi
+
+ ebegin "Starting privoxy"
+ start-stop-daemon --start --quiet --exec /usr/sbin/privoxy \
+ --pidfile "${PIDFILE}" \
+ -- \
+ --pidfile "${PIDFILE}" \
+ --user privoxy.privoxy "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping privoxy"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/testing/privoxy/privoxy.logrotate b/testing/privoxy/privoxy.logrotate
new file mode 100644
index 0000000000..aa7463bd57
--- /dev/null
+++ b/testing/privoxy/privoxy.logrotate
@@ -0,0 +1,9 @@
+/var/log/privoxy/privoxy.log /var/log/privoxy/jarfile {
+ missingok
+ notifempty
+ create 0640 privoxy privoxy
+ sharedscripts
+ postrotate
+ killall -HUP privoxy 2>/dev/null || true
+ endscript
+}
diff --git a/testing/privoxy/privoxy.pre-install b/testing/privoxy/privoxy.pre-install
new file mode 100644
index 0000000000..38db002881
--- /dev/null
+++ b/testing/privoxy/privoxy.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup privoxy 2>/dev/null
+adduser -S -G privoxy -h /var/log/privoxy -s /bin/false -D privoxy 2>/dev/null
+exit 0
+