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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
# Maintainer: bar0metr <admin@os-admin.ru>
pkgname=squid4
pkgver=4.13
pkgrel=4
pkgdesc='Full-featured Web proxy cache server with the support SSL, eCAP, iCAP-client. Include patches for normal work with cache, long url`s and CDN.'
arch=('x86_64')
url='http://www.squid-cache.org'
depends=('openssl' 'libecap' 'libnetfilter_conntrack' 'pam' 'perl' 'libltdl' 'libcap' 'nettle' 'gnutls' 'libnsl' 'gperftools' 'libbsd')
makedepends=('krb5')
conflicts=('squid' 'squid4' 'squid5')
license=('GPL')
options=('emptydirs')
backup=('etc/squid/squid.conf'
'etc/squid/cachemgr.conf'
'etc/squid/errorpage.css'
'etc/squid/mime.conf')
source=("http://www.squid-cache.org/Versions/v4/squid-$pkgver.tar.xz"
'squid.pam'
'squid.service'
'squid.tmpfiles'
'squid.sysusers'
'squid-rotate.service'
'squid-rotate.timer')
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
prepare() {
cd "$srcdir/squid-$pkgver"
msg "Preparing Squid..."
msg2 "Getting the client_side_request patch (for work with CDN)..."
wget https://raw.githubusercontent.com/bar0metr/squid/master/client_side_request.patch
msg2 "Patching Squid (client_side_request)"
patch -p0 -i client_side_request.patch
msg2 "Done!"
}
build() {
cd "$srcdir/squid-$pkgver"
PKG_CONFIG_PATH=/usr/lib \
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--datadir=/usr/share/squid \
--sysconfdir=/etc/squid \
--libexecdir=/usr/lib/squid \
--localstatedir=/var \
--with-logdir=/var/log/squid \
--with-pidfile=/run/squid.pid \
--enable-ecap \
--enable-icap-client \
--enable-auth \
--enable-auth-basic \
--disable-auth-ntlm \
--disable-auth-digest \
--enable-auth-negotiate \
--enable-removal-policies="lru,heap" \
--enable-storeio="ufs,aufs,diskd,rock" \
--enable-delay-pools \
--enable-arp-acl \
--enable-zph-qos \
--with-netfilter-conntrack \
--with-openssl=/usr/include/openssl \
--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-large-files \
--enable-arp-acl \
--with-default-user=proxy \
--enable-async-io \
--enable-truncate \
--enable-icap-client \
--enable-ssl-crtd \
--disable-arch-native \
--disable-strict-error-checking \
--enable-wccpv2 \
--disable-wccp \
--enable-ssl-crtd \
--with-build-environment=POSIX_V6_LP64_OFF64 \
--enable-build-info="Intercept/WCCPv2/SSL/CRTD/(A)UFS/DISKD/ROCK/eCAP/ICAP/64/GCC Production" \
'CFLAGS=-g -O2 -fPIE -fstack-protector-strong -DNDEBUG -Wformat -Werror=format-security -Wall -ltcmalloc_minimal' \
'LDFLAGS=-fPIE -pie -Wl,-z,relro -Wl,-z,now' \
'CPPFLAGS=-D_FORTIFY_SOURCE=2' \
'CXXFLAGS=-g -O2 -fPIE -fstack-protector-strong -DNDEBUG -Wformat -Werror=format-security -ltcmalloc_minimal'
make -j$(nproc)
}
package() {
cd "$srcdir"
make -C "squid-$pkgver" DESTDIR="$pkgdir" install
install -Dm644 "$srcdir/squid.pam" "$pkgdir/etc/pam.d/squid"
install -Dm644 "$srcdir/squid.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/squid.conf"
install -Dm644 "$srcdir/squid.sysusers" "$pkgdir/usr/lib/sysusers.d/squid.conf"
install -Dm644 "$srcdir/squid.service" \
"$pkgdir/usr/lib/systemd/system/squid.service"
install -Dm644 "$srcdir/squid-rotate.service" \
"$pkgdir/usr/lib/systemd/system/squid-rotate.service"
install -Dm644 "$srcdir/squid-rotate.timer" \
"$pkgdir/usr/lib/systemd/system/squid-rotate.timer"
# install -dm755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
# ln -s ../squid-rotate.timer \
# "$pkgdir/usr/lib/systemd/system/timers.target.wants/squid-rotate.timer"
rm -rf "$pkgdir/run" "$pkgdir"/var/{cache,log,run}
}
|