summaryrefslogtreecommitdiff
path: root/community/privoxy/PKGBUILD
blob: ff82d567b292b969d84d6320fdfa6ae2ee8016a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# $Id: PKGBUILD 80122 2012-11-16 17:01:01Z lfleischer $
# 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.19
pkgrel=7
pkgdesc='A web proxy with advanced filtering capabilities.'
arch=('i686' 'x86_64' 'mips64el')
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')
install='privoxy.install'
source=("http://downloads.sourceforge.net/ijbswa/${pkgname}-${pkgver}-stable-src.tar.gz"
        'privoxy'
        'privoxy.logrotate.d'
        'privoxy.conf.d'
        'privoxy.service')
md5sums=('57acc79059565cc42eda67982842785d'
         '1b4ed8c4e7e5b04b10ef41b597dc3f3b'
         '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 -Dm0755 "${srcdir}/privoxy" "${pkgdir}/etc/rc.d/privoxy"
  install -Dm0644 "${srcdir}/privoxy.logrotate.d" "${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 filesystem>=2012.06
  rmdir "$pkgdir/var/run"

  # systemd unit file
  install -Dm0644 "${srcdir}/privoxy.service" "${pkgdir}/usr/lib/systemd/system/privoxy.service"
}