Skip to content

Instantly share code, notes, and snippets.

@ropery
Created August 28, 2016 12:01
Show Gist options
  • Save ropery/1e2a78d453060b9a4cf83b0d094f136a to your computer and use it in GitHub Desktop.
Save ropery/1e2a78d453060b9a4cf83b0d094f136a to your computer and use it in GitHub Desktop.
# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Juergen Hoetzel <juergen@hoetzel.info>
# Contributor: basilburn (basilburn), Paul Bredbury (brebs)
pkgname=privoxy
pkgver=3.0.26
pkgrel=1
pkgdesc='A web proxy with advanced filtering capabilities.'
arch=('i686' 'x86_64')
url='https://www.privoxy.org'
license=('GPL2')
depends=('pcre' 'zlib')
makedepends=('autoconf')
backup=('etc/privoxy/'{config,trust,match-all.action,{default,user}.{action,filter}}
'etc/logrotate.d/privoxy')
install='privoxy.install'
source=("http://downloads.sourceforge.net/ijbswa/${pkgname}-${pkgver}-stable-src.tar.gz"
'privoxy.logrotate.d'
'privoxy.sysusers'
'privoxy.service')
md5sums=('8a1c842112ccea68c19b7ceb4a0e999f'
'e8196e745c765b398b3bfac68f370279'
'b16776164ab677282c44a8729743eca1'
'99ecefbdab8d2260d9b217895b3adc73')
build() {
cd "${srcdir}/${pkgname}-${pkgver}-stable"
autoheader
autoconf
./configure --prefix=/usr --sysconfdir=/etc/privoxy --enable-compression
make
sed -i '
s+^confdir \.+confdir /etc/privoxy+
s+^logdir \.+logdir /var/log/privoxy+
s+^#\?user-manual .*+user-manual /usr/share/doc/privoxy/user-manual/+' config
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}-stable"
install -Dm644 "$srcdir/privoxy.service" "$pkgdir/usr/lib/systemd/system/privoxy.service"
install -Dm644 "$srcdir/privoxy.sysusers" "$pkgdir/usr/lib/sysusers.d/privoxy.conf"
install -Dm644 "$srcdir/privoxy.logrotate.d" "$pkgdir/etc/logrotate.d/privoxy"
install -Dm755 {,"$pkgdir"/usr/bin/}privoxy
install -Dm644 {,"$pkgdir"/usr/share/man/man1/}privoxy.1
install -d -o42 -g42 "$pkgdir"/var/log/privoxy
install -m644 config trust *.{action,filter} "$pkgdir"/etc/privoxy/ # -m0660 upstream
find templates -type f -exec install -Dm644 '{}' "$pkgdir"/etc/privoxy/'{}' \;
(d=$pkgdir/usr/share/doc/privoxy
cd doc/webserver
install -Dm644 {privoxy-,"$d"/}index.html
install -m644 p_doc.css ../../{AUTHORS,README,ChangeLog} "$d"/
install -Dm644 {,"$d"/user-manual/}p_doc.css
find user-manual developer-manual faq man-page \( -name '*.html' -o -name '*.jpg' \) \
-exec install -Dm644 '{}' "$d"/'{}' \;)
}
post_install() {
systemd-sysusers privoxy.conf
}
/var/log/privoxy/logfile {
missingok
create 660 root privoxy
notifempty
compress
postrotate
/bin/kill -HUP `cat /var/run/privoxy.pid 2>/dev/null` 2> /dev/null || true
endscript
}
[Unit]
Description=Privoxy Web Proxy With Advanced Filtering Capabilities
After=network.target
[Service]
User=privoxy
Type=simple
ExecStart=/usr/bin/privoxy --no-daemon /etc/privoxy/config
PrivateDevices=yes
[Install]
WantedBy=multi-user.target
u privoxy 42 "Privoxy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment