summaryrefslogtreecommitdiff
path: root/community/privoxy
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
committerroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
commit7a65a910b77ad191d69881098c47f9b0c852d92e (patch)
tree9564e611af1442f8952a8cbddb3b0ad25ed71aab /community/privoxy
parent60da6abff6c9577a783d72865f11de7a585e912e (diff)
Tue Aug 13 01:31:08 PDT 2013
Diffstat (limited to 'community/privoxy')
-rw-r--r--community/privoxy/PKGBUILD66
-rw-r--r--community/privoxy/privoxy.install19
-rw-r--r--community/privoxy/privoxy.logrotate.d8
-rw-r--r--community/privoxy/privoxy.service12
4 files changed, 105 insertions, 0 deletions
diff --git a/community/privoxy/PKGBUILD b/community/privoxy/PKGBUILD
new file mode 100644
index 000000000..a016a0e67
--- /dev/null
+++ b/community/privoxy/PKGBUILD
@@ -0,0 +1,66 @@
+# $Id: PKGBUILD 92055 2013-05-31 01:13:33Z seblu $
+# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
+# Contributor: Juergen Hoetzel <juergen@hoetzel.info>
+# Contributor: basilburn (basilburn), Paul Bredbury (brebs)
+
+pkgname=privoxy
+pkgver=3.0.21
+pkgrel=1
+pkgdesc='A web proxy with advanced filtering capabilities.'
+arch=('i686' 'x86_64')
+url='http://www.privoxy.org'
+license=('GPL')
+depends=('pcre' 'zlib')
+makedepends=('autoconf')
+backup=('etc/privoxy/'{config,trust,default.action,user.filter,default.filter}
+ 'etc/privoxy/'{match-all,user}.action
+ 'etc/logrotate.d/privoxy')
+install='privoxy.install'
+source=("http://downloads.sourceforge.net/ijbswa/${pkgname}-${pkgver}-stable-src.tar.gz"
+ 'privoxy.logrotate.d'
+ 'privoxy.service')
+md5sums=('79558f2545cfcf9731f7de611646d837'
+ 'fc3046377137003726a151ee27b142a2'
+ '358e614190247fc1671bbcadddf500db')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}-stable"
+
+ autoheader
+ autoconf
+ ./configure --prefix=/usr --sysconfdir=/etc/privoxy --enable-compression
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}-stable"
+
+ make prefix="${pkgdir}/usr" SBIN_DEST="${pkgdir}/usr/bin" \
+ MAN_DEST="${pkgdir}/usr/share/man/man1" GROUP=42 \
+ CONF_BASE="${pkgdir}/etc/privoxy" VAR_DEST="${pkgdir}/var" install
+
+ # Don't overwrite existing log files!
+ rm "${pkgdir}/var/log/privoxy/"*
+
+ install -Dm0644 "${srcdir}/privoxy.logrotate.d" "${pkgdir}/etc/logrotate.d/privoxy"
+
+ # Fix config paths.
+ sed -i -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/#' \
+ "${pkgdir}/etc/privoxy/config"
+
+ # Fix group ownership and permissions.
+ chgrp -R 42 "${pkgdir}/etc/privoxy/"
+ chgrp -R 42 "${pkgdir}/var/log/privoxy/"
+
+ find "${pkgdir}/etc/privoxy/" -type d | xargs chmod 0770
+ find "${pkgdir}/etc/privoxy/" -type f | xargs chmod 0660
+ chmod 0700 "${pkgdir}/var/log/privoxy"
+
+ # avoid conflict with filesystem>=2012.06
+ rmdir "$pkgdir/var/run"
+
+ # systemd unit file
+ install -Dm0644 "${srcdir}/privoxy.service" "${pkgdir}/usr/lib/systemd/system/privoxy.service"
+}
diff --git a/community/privoxy/privoxy.install b/community/privoxy/privoxy.install
new file mode 100644
index 000000000..c3ed75111
--- /dev/null
+++ b/community/privoxy/privoxy.install
@@ -0,0 +1,19 @@
+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
+
+ if [ ! -d /var/spool/privoxy ]; then
+ install -dm0770 -o privoxy -g privoxy /var/spool/privoxy
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ userdel privoxy &>/dev/null
+ groupdel privoxy &>/dev/null
+ rm -rf var/spool/privoxy
+}
diff --git a/community/privoxy/privoxy.logrotate.d b/community/privoxy/privoxy.logrotate.d
new file mode 100644
index 000000000..8c3129024
--- /dev/null
+++ b/community/privoxy/privoxy.logrotate.d
@@ -0,0 +1,8 @@
+/var/log/privoxy/logfile {
+ create 660 root privoxy
+ notifempty
+ compress
+ postrotate
+ /bin/kill -HUP `cat /var/run/privoxy.pid 2>/dev/null` 2> /dev/null || true
+ endscript
+}
diff --git a/community/privoxy/privoxy.service b/community/privoxy/privoxy.service
new file mode 100644
index 000000000..e8b04447b
--- /dev/null
+++ b/community/privoxy/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