[arch-commits] Commit in varnish/repos (7 files)
Bartłomiej Piotrowski
bpiotrowski at archlinux.org
Sat Apr 14 11:33:21 UTC 2018
Date: Saturday, April 14, 2018 @ 11:33:20
Author: bpiotrowski
Revision: 321789
archrelease: copy trunk to staging-x86_64
Added:
varnish/repos/staging-x86_64/
varnish/repos/staging-x86_64/PKGBUILD
(from rev 321788, varnish/trunk/PKGBUILD)
varnish/repos/staging-x86_64/hack-up-vcstools-to-work-with-python-2-and-3.patch
(from rev 321788, varnish/trunk/hack-up-vcstools-to-work-with-python-2-and-3.patch)
varnish/repos/staging-x86_64/varnish-vcl-reload
(from rev 321788, varnish/trunk/varnish-vcl-reload)
varnish/repos/staging-x86_64/varnish.install
(from rev 321788, varnish/trunk/varnish.install)
varnish/repos/staging-x86_64/varnish.service
(from rev 321788, varnish/trunk/varnish.service)
varnish/repos/staging-x86_64/varnish.sysusers
(from rev 321788, varnish/trunk/varnish.sysusers)
----------------------------------------------------+
PKGBUILD | 76 +++++++++++++++++++
hack-up-vcstools-to-work-with-python-2-and-3.patch | 66 ++++++++++++++++
varnish-vcl-reload | 20 +++++
varnish.install | 12 +++
varnish.service | 16 ++++
varnish.sysusers | 2
6 files changed, 192 insertions(+)
Copied: varnish/repos/staging-x86_64/PKGBUILD (from rev 321788, varnish/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD (rev 0)
+++ staging-x86_64/PKGBUILD 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,76 @@
+# $Id$
+# Maintainer: Dave Reisner <dreisner at archlinux.org>
+# Contributor: Jaroslav Lichtblau <dragonlord at aur.archlinux.org>
+# Contributor: Douglas Soares de Andrade
+# Contributor: Roberto Alsina <ralsina at kde.org>
+
+pkgname=varnish
+pkgver=5.2.1
+pkgrel=3
+pkgdesc="High-performance HTTP accelerator"
+arch=('x86_64')
+url="https://www.varnish-cache.org/"
+license=('BSD')
+depends=('gcc' 'libedit' 'pcre' 'libnsl')
+makedepends=('python-docutils')
+optdepends=('python: needed for vmod development')
+backup=('etc/varnish/default.vcl')
+options=('!buildflags')
+install=$pkgname.install
+source=("https://github.com/varnishcache/varnish-cache/archive/varnish-$pkgver.tar.gz"
+ hack-up-vcstools-to-work-with-python-2-and-3.patch
+ varnish-vcl-reload
+ varnish.service
+ varnish.sysusers)
+sha256sums=('f44decf0f382a2ac76aaaa2478167a6b41909a3f6179eeefce402d19e694aba0'
+ '97a00962474a5bf97fd71e4c0e792861157aa8ac872fc9c5636b763f11445e8c'
+ '0369e3e735e4c6150f08677df8b7cdae1a36ea75fd0e03734abe814a94312f80'
+ '49b48981ccb97aee77ef59373db3856652d7badc909f2504df01970d834183f2'
+ 'b58dd6b00eb81c75e4bb30421b85b2be88c049d5b72a8ee553ba690a5414972b')
+
+prepare() {
+ cd "varnish-cache-varnish-$pkgver"
+
+ patch -Np1 <"$srcdir/hack-up-vcstools-to-work-with-python-2-and-3.patch"
+
+ ./autogen.sh
+}
+
+build() {
+ cd "varnish-cache-varnish-$pkgver"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ --sbindir=/usr/bin
+
+ make
+}
+
+check() {
+ cd "varnish-cache-varnish-$pkgver"
+
+ # Sometimes fails on i686 in address remapping test. Not sure if flaky
+ # test or otherwise...
+ make check
+}
+
+package() {
+ cd "varnish-cache-varnish-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+
+ install -m755 "$srcdir/varnish-vcl-reload" "$pkgdir/usr/bin"
+ install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+
+ # create varnish:varnish user/group
+ install -Dm644 "$srcdir/$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/varnish.conf"
+
+ # config
+ install -Dm644 "etc/example.vcl" "$pkgdir/etc/varnish/default.vcl"
+ install -Dm644 "etc/builtin.vcl" "$pkgdir/usr/share/doc/varnish/builtin.vcl"
+
+ # license
+ install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
Copied: varnish/repos/staging-x86_64/hack-up-vcstools-to-work-with-python-2-and-3.patch (from rev 321788, varnish/trunk/hack-up-vcstools-to-work-with-python-2-and-3.patch)
===================================================================
--- staging-x86_64/hack-up-vcstools-to-work-with-python-2-and-3.patch (rev 0)
+++ staging-x86_64/hack-up-vcstools-to-work-with-python-2-and-3.patch 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,66 @@
+From 17c92e43fda114bf5341e51d752e882238b8fe8c Mon Sep 17 00:00:00 2001
+From: Nils Goroll <nils.goroll at uplex.de>
+Date: Thu, 5 Oct 2017 13:39:23 +0200
+Subject: [PATCH] hack up vsctool to work with python 2 and 3
+
+StringIO does not exist any more in python3, yet requiring 2.7 would
+not pave the path forward, so try to be compatible with both.
+
+Works for me on Python 2.7.9 and Python 3.4
+
+I would appreciate if someone more fluent in serpentinous programming
+language reviewed and/or rewrote this.
+---
+ lib/libvcc/vsctool.py | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/lib/libvcc/vsctool.py b/lib/libvcc/vsctool.py
+index 854968e3b..829c6e518 100644
+--- a/lib/libvcc/vsctool.py
++++ b/lib/libvcc/vsctool.py
+@@ -37,7 +37,10 @@
+ import json
+ import sys
+ import gzip
+-import StringIO
++try:
++ import StringIO
++except ImportError:
++ import io
+ import collections
+ import struct
+
+@@ -54,9 +57,22 @@
+ "format": [ "integer", FORMATS],
+ }
+
++# http://python3porting.com/problems.html#bytes-strings-and-unicode
++if sys.version_info < (3,):
++ def b(x):
++ return x
++else:
++ import codecs
++ def b(x):
++ return codecs.latin_1_encode(x)[0]
++
+ def gzip_str(s):
+- out = StringIO.StringIO()
+- gzip.GzipFile(fileobj=out, mode="w").write(s)
++ try:
++ out = StringIO.StringIO()
++ except NameError:
++ out = io.BytesIO()
++
++ gzip.GzipFile(fileobj=out, mode="w").write(b(s))
+ out.seek(4)
+ out.write(struct.pack("<L", 0x12bfd58))
+ return out.getvalue()
+@@ -285,7 +301,7 @@ class rst_vsc(directive):
+ def __init__(self, s):
+ super(rst_vsc, self).__init__(s)
+
+- for i,v in PARAMS.iteritems():
++ for i,v in PARAMS.items():
+ if v is not True:
+ self.do_default(i, v[0], v[1])
+
Copied: varnish/repos/staging-x86_64/varnish-vcl-reload (from rev 321788, varnish/trunk/varnish-vcl-reload)
===================================================================
--- staging-x86_64/varnish-vcl-reload (rev 0)
+++ staging-x86_64/varnish-vcl-reload 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+cfg=${1:-/etc/varnish/default.vcl}
+if [ ! -e "$cfg" ]; then
+ printf 'ERROR: VCL file %s does not exist\n' "$cfg" >&2
+ exit 1
+fi
+
+activecfg=$(varnishadm 'vcl.list' | awk '/active/ { print $4 }')
+if [ -z "$activecfg" ]; then
+ printf 'ERROR: No active VCL found!\n' >&2
+ exit 1
+fi
+
+newcfg=$(date +'vcl-%s')
+printf 'INFO: using new config %s\n' "$cfg"
+
+varnishadm "vcl.load $newcfg $cfg" &&
+varnishadm "vcl.use $newcfg" &&
+varnishadm "vcl.discard $activecfg"
Copied: varnish/repos/staging-x86_64/varnish.install (from rev 321788, varnish/trunk/varnish.install)
===================================================================
--- staging-x86_64/varnish.install (rev 0)
+++ staging-x86_64/varnish.install 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,12 @@
+# remove localstatedir -- compiled VCL and slab files will still be here.
+post_remove() {
+ rm -rf var/lib/varnish
+}
+
+post_upgrade() {
+ if [[ $(vercmp 5.0.0-1 "$2") -eq 1 ]]; then
+ echo ":: You must update your VCL to be compatible with varnish 5.0.0. See the"
+ echo " following upgrade guide to port your configuration:"
+ echo " http://varnish-cache.org/docs/5.0/whats-new/upgrading-5.0.html"
+ fi
+}
Copied: varnish/repos/staging-x86_64/varnish.service (from rev 321788, varnish/trunk/varnish.service)
===================================================================
--- staging-x86_64/varnish.service (rev 0)
+++ staging-x86_64/varnish.service 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,16 @@
+[Unit]
+Description=High-perfomance HTTP accelerator
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/varnishd -j unix -a 0.0.0.0:80 -a [::]:80 -f /etc/varnish/default.vcl -T localhost:6082 -s malloc,64M
+ExecReload=/usr/bin/varnish-vcl-reload
+PrivateTmp=true
+PrivateDevices=true
+LimitNOFILE=131072
+LimitMEMLOCK=82000
+LimitCORE=infinity
+
+[Install]
+WantedBy=multi-user.target
Copied: varnish/repos/staging-x86_64/varnish.sysusers (from rev 321788, varnish/trunk/varnish.sysusers)
===================================================================
--- staging-x86_64/varnish.sysusers (rev 0)
+++ staging-x86_64/varnish.sysusers 2018-04-14 11:33:20 UTC (rev 321789)
@@ -0,0 +1,2 @@
+u varnish - "Varnish Cache Proxy"
+g varnish -
More information about the arch-commits
mailing list