summaryrefslogtreecommitdiff
path: root/extra/squid/PKGBUILD
blob: a4c2f02dc964a73cd45897e9f293888e294b08ff (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
# $Id: PKGBUILD 131635 2011-07-13 01:26:21Z kevin $
# Maintainer: Kevin Piche <kevin@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=squid
pkgver=3.1.14
pkgrel=1
pkgdesc="A full-featured Web proxy cache server."
arch=(i686 x86_64 'mips64el')
url="http://www.squid-cache.org"
depends=('openssl' 'pam' 'cron' 'perl')
makedepends=('libcap>=2.16')
license=('GPL')
backup=(etc/squid/squid.conf etc/squid/mime.conf etc/conf.d/squid)
install=squid.install
source=(http://www.squid-cache.org/Versions/v3/3.1/${pkgname}-${pkgver}.tar.bz2
        squid squid.conf.d squid.pam squid.cron squid-3.1.11-unused.patch)
md5sums=('8f82a451b04c3bf3c29202c548d2f2dd' 'd213b0cc1db72b749bb8c88716fdab39'
         '2383772ef94efddc7b920628bc7ac5b0' '270977cdd9b47ef44c0c427ab9034777'
         '5e17df989e2a74e869790c066f61225b' '8e59089e4a8556fc18df51979f1cfbff')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # gcc 4.6 doesn't support -fhuge-objects.
  sed '/^    HUGE_OBJECT_FLAG=/ s/"-fhuge-objects"//' -i configure
  # fix compile errors with gcc 4.6
  # http://bugs.squid-cache.org/show_bug.cgi?id=3178
  #patch -Np1 -i ${srcdir}/squid-3.1.11-unused.patch

  # fix cache_dir, cache_dir size, and effective group.
  sed '/^DEFAULT_SWAP_DIR/ s@/cache@/cache/squid@' -i src/Makefile.in
  sed '/^#cache_dir/ s/100/256/
       /^NAME: cache_effective_group/ {n;n;s/none/proxy/}' -i src/cf.data.pre

  ./configure --prefix=/usr --datadir=/usr/share/squid \
      --sysconfdir=/etc/squid --libexecdir=/usr/lib/squid \
      --localstatedir=/var --with-logdir=/var/log/squid \
      --enable-auth="basic,digest,ntlm" --enable-removal-policies="lru,heap" \
      --enable-digest-auth-helpers="password" --enable-storeio="aufs,ufs,diskd" \
      --enable-basic-auth-helpers="getpwnam,YP,NCSA,SMB,MSNT,PAM,multi-domain-NTLM" \
      --enable-external-acl-helpers="ip_user,unix_group,wbinfo_group" \
      --enable-ntlm-auth-helpers="smb_lm,fakeauth,no_check" \
      --enable-delay-pools --enable-arp-acl --enable-ssl --enable-snmp \
      --enable-linux-netfilter --enable-ident-lookups \
      --enable-useragent-log --enable-cache-digests --enable-referer-log \
      --enable-arp-acl --enable-htcp --enable-carp --enable-epoll \
      --with-filedescriptors=4096 --with-large-files --enable-arp-acl \
      --with-default-user=proxy \
      --enable-async-io --enable-truncate
#some versions have build problems with both async and truncate enabled:
#      --enable-async-io

  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install

  install -D -m755 ${srcdir}/squid ${pkgdir}/etc/rc.d/squid
  install -D -m755 ${srcdir}/squid.cron ${pkgdir}/etc/cron.weekly/squid
  install -D -m644 ${srcdir}/squid.conf.d ${pkgdir}/etc/conf.d/squid
  install -D -m644 ${srcdir}/squid.pam ${pkgdir}/etc/pam.d/squid
}
# vim: ts=2 sw=2 et ft=sh