summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD83
-rw-r--r--privoxy.install20
-rw-r--r--privoxy.logrotate.d8
-rw-r--r--privoxy.service12
5 files changed, 148 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..47a9da9ff92
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = privoxy-cvs
+ pkgdesc = A web proxy with advanced filtering capabilities. CVS version
+ pkgver = 20130420
+ pkgrel = 1
+ url = http://www.privoxy.org
+ install = privoxy.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = cvs
+ optdepends = logrotate
+ provides = privoxy
+ conflicts = privoxy
+ backup = etc/privoxy/config
+ backup = etc/privoxy/trust
+ backup = etc/privoxy/user.filter
+ backup = etc/privoxy/default.filter
+ backup = etc/privoxy/user.action
+ source = privoxy.logrotate.d
+ source = privoxy.service
+ md5sums = 61a9436114bcad89d75f2f7468d0d429
+ md5sums = 358e614190247fc1671bbcadddf500db
+
+pkgname = privoxy-cvs
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..1e7af7f3c00
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,83 @@
+# Contributor: Mark Foxwell <fastfret79@archlinux.org.uk>
+# Maintainer: skydrome <skydrome@i2pmail.org>
+
+pkgname=privoxy-cvs
+pkgver=20130420
+pkgrel=1
+pkgdesc="A web proxy with advanced filtering capabilities. CVS version"
+arch=('i686' 'x86_64')
+url='http://www.privoxy.org'
+license=('GPL2')
+optdepends=('logrotate')
+makedepends=('cvs')
+conflicts=('privoxy')
+provides=('privoxy')
+backup=('etc/privoxy/'{config,trust,user.filter,default.filter}
+ 'etc/privoxy/user.action')
+install='privoxy.install'
+source=('privoxy.logrotate.d'
+ 'privoxy.service')
+md5sums=('61a9436114bcad89d75f2f7468d0d429'
+ '358e614190247fc1671bbcadddf500db')
+
+_cvsroot=":pserver:anonymous:@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa"
+_cvsmod="current"
+
+build() {
+ cd "$srcdir"
+
+ msg "Connecting to CVS server..."
+ if [[ -d "$_cvsmod/CVS" ]]; then
+ cd "$_cvsmod"
+ cvs -z3 update -d
+ else
+ cvs -z3 -d "$_cvsroot" co -f "$_cvsmod"
+ cd "$_cvsmod"
+ fi
+ msg "CVS checkout done or server timeout"
+
+ [[ -d "$srcdir/$_cvsmod-build" ]] && rm -rf "$srcdir/${_cvsmod}-build"
+ cp -r "$srcdir/$_cvsmod" "$srcdir/${_cvsmod}-build"
+
+ cd "$srcdir/${_cvsmod}-build"
+ msg "Starting make..."
+
+ autoheader
+ autoconf
+ ./configure --enable-compression
+ make
+}
+
+package() {
+ cd "$srcdir/${_cvsmod}-build"
+
+ make install \
+ prefix="$pkgdir/usr" \
+ SBIN_DEST="$pkgdir/usr/bin" \
+ MAN_DEST="$pkgdir/usr/share/man/man1" \
+ CONF_BASE="$pkgdir/etc/privoxy" \
+ VAR_DEST="$pkgdir/var" \
+ GROUP=privoxy USER=privoxy
+
+ # Don't overwrite existing log files!
+ rm "${pkgdir}/var/log/privoxy/"*
+
+ # Fix config paths.
+ sed -i "${pkgdir}/etc/privoxy/config" \
+ -e 's|^confdir.*$|confdir /etc/privoxy|' \
+ -e 's|^logdir.*$|logdir /var/log/privoxy|' \
+ -e '/^user-manual/s|.*|#user-manual /usr/share/doc/privoxy/user-manual/|' \
+ -e 's|logfile logfile|privoxy.log|'
+
+ # Fix permissions.
+ find "${pkgdir}/etc/privoxy/" -type d |xargs chmod 700
+ find "${pkgdir}/etc/privoxy/" -type f |xargs chmod 600
+ chmod 700 "${pkgdir}/var/log/privoxy/"
+
+ # avoid conflict with filesystem>=2012.06
+ rmdir "$pkgdir/var/run"
+
+ # systemd unit file
+ install -Dm644 "${srcdir}/privoxy.service" "${pkgdir}/usr/lib/systemd/system/privoxy.service"
+ install -Dm644 "${srcdir}/privoxy.logrotate.d" "${pkgdir}/etc/logrotate.d/privoxy"
+}
diff --git a/privoxy.install b/privoxy.install
new file mode 100644
index 00000000000..6c7632472b1
--- /dev/null
+++ b/privoxy.install
@@ -0,0 +1,20 @@
+post_install() {
+ groupadd -g 42 privoxy &>/dev/null
+ useradd -u 42 -g privoxy -d /var/spool/privoxy -s /bin/false privoxy &>/dev/null
+ chown -R privoxy:privoxy /etc/privoxy /var/log/privoxy
+ chmod 700 /etc/privoxy /var/log/privoxy
+
+ if [[ ! -d /var/spool/privoxy ]]; then
+ install -dm0700 -o privoxy -g privoxy /var/spool/privoxy
+ fi
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ userdel privoxy &>/dev/null
+ groupdel privoxy &>/dev/null
+ rm -rf var/spool/privoxy
+}
diff --git a/privoxy.logrotate.d b/privoxy.logrotate.d
new file mode 100644
index 00000000000..9df7fa7aca6
--- /dev/null
+++ b/privoxy.logrotate.d
@@ -0,0 +1,8 @@
+/var/log/privoxy/logfile {
+ create 660 root privoxy
+ notifempty
+ compress
+ postrotate
+ /bin/kill -HUP $(cat /run/privoxy.pid 2>/dev/null) 2>/dev/null || true
+ endscript
+}
diff --git a/privoxy.service b/privoxy.service
new file mode 100644
index 00000000000..e8b04447b38
--- /dev/null
+++ b/privoxy.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Privoxy Web Proxy With Advanced Filtering Capabilities
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/privoxy.pid
+ExecStart=/usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
+SuccessExitStatus=15
+
+[Install]
+WantedBy=multi-user.target