desktop/privoxy/PKGBUILD

67 lines
2.2 KiB
Bash

# Maintainer: abveritas@chakra-project.org
pkgname=privoxy
pkgver=3.0.21
pkgrel=1
pkgdesc='A web proxy with advanced filtering capabilities.'
arch=('x86_64')
url='http://www.privoxy.org'
license=('GPL')
depends=('pcre' 'zlib')
makedepends=('autoconf')
backup=('etc/conf.d/privoxy'
'etc/privoxy/'{config,trust,default.action,user.filter,default.filter}
'etc/privoxy/'{match-all,user}.action
'etc/logrotate.d/privoxy')
categories=('network')
install=${pkgname}.install
source=("http://downloads.sourceforge.net/ijbswa/${pkgname}-${pkgver}-stable-src.tar.gz"
'privoxy-logrotate' # renamed the entry, because *.log is in gitignore
'privoxy.conf.d'
'privoxy.service')
md5sums=('79558f2545cfcf9731f7de611646d837'
'fc3046377137003726a151ee27b142a2'
'27830ef79418e277b90c1c1fa933f876'
'4c154a126ec17b02c623e3d451e062d9')
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" 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 start scripts and config files
install -Dm0644 "${srcdir}/privoxy.service" "${pkgdir}/usr/lib/systemd/system/privoxy.service"
install -Dm0644 "${srcdir}/privoxy-logrotate" "${pkgdir}/etc/logrotate.d/privoxy"
install -Dm0644 "${srcdir}/privoxy.conf.d" "${pkgdir}/etc/conf.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 /var/run
rmdir "${pkgdir}/var/run"
}