summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbar0metr2018-07-31 12:24:08 +0500
committerbar0metr2018-07-31 12:24:08 +0500
commit138b8089f446209222216e39e1711ec82906af0f (patch)
treee5f63c2417bdf4ee11480cc1db966dde4e724214
downloadaur-138b8089f446209222216e39e1711ec82906af0f.tar.gz
First
-rw-r--r--.SRCINFO44
-rw-r--r--PKGBUILD117
-rw-r--r--squid-rotate.service9
-rw-r--r--squid-rotate.timer10
-rw-r--r--squid.pam5
-rw-r--r--squid.service13
-rw-r--r--squid.sysusers2
-rw-r--r--squid.tmpfiles4
8 files changed, 204 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2f02ff97f48b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,44 @@
+pkgbase = squid-git
+ pkgdesc = Full-featured Web proxy cache server with the support SSL, eCAP, iCAP-client. Include patches for normal work with long url`s and CDN.
+ pkgver = 4.1
+ pkgrel = 4
+ url = https://github.com/squid-cache/squid
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ makedepends = krb5
+ depends = openssl-1.0
+ depends = libecap
+ depends = pam
+ depends = perl
+ depends = libltdl
+ depends = libcap
+ depends = nettle
+ depends = gnutls
+ depends = libnsl
+ conflicts = squid
+ conflicts = squid4
+ options = emptydirs
+ backup = etc/squid/squid.conf
+ backup = etc/squid/cachemgr.conf
+ backup = etc/squid/errorpage.css
+ backup = etc/squid/mime.conf
+ source = squid-git::git+https://github.com/squid-cache/squid.git
+ source = squid.pam
+ source = squid.service
+ source = squid.tmpfiles
+ source = squid.sysusers
+ source = squid-rotate.service
+ source = squid-rotate.timer
+ validpgpkeys = B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = squid-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cf8f14638169
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,117 @@
+pkgname=squid-git
+pkgver=4.1
+pkgrel=4
+pkgdesc='Full-featured Web proxy cache server with the support SSL, eCAP, iCAP-client. Include patches for normal work with long url`s
+and CDN.'
+arch=('x86_64')
+url='https://github.com/squid-cache/squid'
+depends=('openssl-1.0' 'libecap' 'pam' 'perl' 'libltdl' 'libcap' 'nettle' 'gnutls' 'libnsl')
+makedepends=('git' 'krb5')
+conflicts=('squid' 'squid4')
+license=('GPL')
+options=('emptydirs')
+backup=('etc/squid/squid.conf'
+ 'etc/squid/cachemgr.conf'
+ 'etc/squid/errorpage.css'
+ 'etc/squid/mime.conf')
+validpgpkeys=('B06884EDB779C89B044E64E3CD6DBF8EF3B17D3E')
+source=("$pkgname::git+$url.git"
+ 'squid.pam'
+ 'squid.service'
+ 'squid.tmpfiles'
+ 'squid.sysusers'
+ 'squid-rotate.service'
+ 'squid-rotate.timer')
+
+sha256sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP')
+
+
+prepare() {
+ cd "$srcdir/squid"
+ msg "Preparing Squid..."
+ msg2 "Getting the client_side_request patch..."
+ wget https://raw.githubusercontent.com/bar0metr/squid/master/client_side_request.patch
+ msg2 "Patching Squid..."
+ patch -p0 -i client_side_request.patch
+ msg2 "Getting the on_unsupported_protocol (bug 4861)..."
+ wget https://raw.githubusercontent.com/bar0metr/squid/master/on_unsupported_protocol.patch
+ msg2 "Patching Squid..."
+ patch -p0 -i on_unsupported_protocol.patch
+ msg2 "Done!"
+}
+
+build() {
+ cd "$srcdir/squid"
+
+ PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig \
+ ./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 \
+ --enable-auth-ntlm \
+ --enable-auth-digest \
+ --enable-auth-negotiate \
+ --enable-removal-policies="lru,heap" \
+ --enable-storeio="aufs,ufs,diskd" \
+ --enable-delay-pools \
+ --enable-arp-acl \
+ --with-openssl=/usr/include/openssl-1.0/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 \
+ --enable-ssl-crtd
+ make -j$(nproc)
+}
+
+package() {
+ cd "$srcdir"
+
+ make -C "squid" 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}
+}
+
diff --git a/squid-rotate.service b/squid-rotate.service
new file mode 100644
index 000000000000..b29006930689
--- /dev/null
+++ b/squid-rotate.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Squid Rotate
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/squid -k rotate
+Nice=19
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7
diff --git a/squid-rotate.timer b/squid-rotate.timer
new file mode 100644
index 000000000000..132f94113a7f
--- /dev/null
+++ b/squid-rotate.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Weekly rotation of squid log files
+
+[Timer]
+OnCalendar=weekly
+AccuracySec=1d
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/squid.pam b/squid.pam
new file mode 100644
index 000000000000..14d1141afbba
--- /dev/null
+++ b/squid.pam
@@ -0,0 +1,5 @@
+#/etc/pam.d/squid
+#
+auth required pam_unix.so
+account required pam_unix.so
+
diff --git a/squid.service b/squid.service
new file mode 100644
index 000000000000..1db8860e581f
--- /dev/null
+++ b/squid.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Web Proxy Cache Server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/squid.pid
+ExecStart=/usr/bin/squid -sYC
+ExecStop=/usr/bin/squid -k shutdown
+ExecReload=/usr/bin/squid -k reconfigure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/squid.sysusers b/squid.sysusers
new file mode 100644
index 000000000000..3769022c164b
--- /dev/null
+++ b/squid.sysusers
@@ -0,0 +1,2 @@
+u proxy 15 - /var/empty
+
diff --git a/squid.tmpfiles b/squid.tmpfiles
new file mode 100644
index 000000000000..edbe765215fe
--- /dev/null
+++ b/squid.tmpfiles
@@ -0,0 +1,4 @@
+d /run/squid 0755 proxy proxy -
+d /var/cache/squid 0755 proxy proxy -
+d /var/log/squid 0755 proxy proxy -
+