summaryrefslogtreecommitdiff
path: root/extra/varnish
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-09-23 23:14:53 +0000
committerroot <root@rshg054.dnsready.net>2011-09-23 23:14:53 +0000
commitcb2a1951e9cd1de18c0ab88c9d741e91a423fc36 (patch)
tree97c7682d2038f33c83b0b3910cea44bb38a3533f /extra/varnish
parent919a63ffc80158b2a5610fa87eb51fd5f8f724ba (diff)
Fri Sep 23 23:14:53 UTC 2011
Diffstat (limited to 'extra/varnish')
-rw-r--r--extra/varnish/PKGBUILD44
-rw-r--r--extra/varnish/rc.varnish46
-rw-r--r--extra/varnish/varnish.conf.d9
-rw-r--r--extra/varnish/varnish.install6
4 files changed, 105 insertions, 0 deletions
diff --git a/extra/varnish/PKGBUILD b/extra/varnish/PKGBUILD
new file mode 100644
index 000000000..05ab8890f
--- /dev/null
+++ b/extra/varnish/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id
+# Maintainer: Dave Reisner <dreisner@archlinux.org>
+# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+# Contributor: Douglas Soares de Andrade
+# Contributor: Roberto Alsina <ralsina@kde.org>
+
+pkgname=varnish
+pkgver=3.0.1
+pkgrel=1
+pkgdesc="High-performance HTTP accelerator"
+arch=('i686' 'x86_64')
+url="http://www.varnish-cache.org/"
+license=('BSD')
+depends=('gcc' 'libedit' 'pcre')
+backup=('etc/conf.d/varnish')
+install=$pkgname.install
+options=('!libtool')
+source=("http://repo.varnish-cache.org/source/$pkgname-$pkgver.tar.gz"
+ "$pkgname.conf.d"
+ "rc.$pkgname")
+md5sums=('d01d9c1f2da2b2a1b18299a0b44c8580'
+ 'd42eebc7f0ac429d9740125ff1e61daf'
+ '18b7747020ecfe2eac7445971a7014e3')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib
+
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+
+ install -D -m755 "$srcdir/rc.$pkgname" "$pkgdir/etc/rc.d/$pkgname"
+ install -D -m644 "$srcdir/$pkgname.conf.d" "$pkgdir/etc/conf.d/$pkgname"
+ install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/extra/varnish/rc.varnish b/extra/varnish/rc.varnish
new file mode 100644
index 000000000..2ebd97e33
--- /dev/null
+++ b/extra/varnish/rc.varnish
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/varnish
+
+pidfile=/run/varnish.pid
+if [[ -r $pidfile ]]; then
+ read -r PID < "$pidfile"
+ if [[ ! -d /proc/$PID ]]; then
+ # stale pidfile
+ unset PID
+ rm -f "$pidfile"
+ fi
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting Varnish Reverse Proxy"
+ if /usr/sbin/varnishd $VARNISHD_OPTS -P "$pidfile"; then
+ add_daemon varnish
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Varnish Reverse Proxy"
+ if [[ $PID ]] && kill $PID &>/dev/null; then
+ rm_daemon varnish
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac
diff --git a/extra/varnish/varnish.conf.d b/extra/varnish/varnish.conf.d
new file mode 100644
index 000000000..2970468b7
--- /dev/null
+++ b/extra/varnish/varnish.conf.d
@@ -0,0 +1,9 @@
+#
+# Command line options to varnishd
+#
+
+VARNISHD_OPTS="-a 0.0.0.0:80 \
+ -b localhost:8080 \
+ -T localhost:6082 \
+ -s malloc,64M
+ -u nobody -g nobody"
diff --git a/extra/varnish/varnish.install b/extra/varnish/varnish.install
new file mode 100644
index 000000000..fceaf4be7
--- /dev/null
+++ b/extra/varnish/varnish.install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# remove localstatedir -- compiled VCL and slab files will still be here.
+post_remove() {
+ rm -rf /var/lib/varnish
+}