aboutsummaryrefslogtreecommitdiffstats
path: root/testing/varnish
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-11 10:01:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-11 10:02:01 +0000
commitc452528a37a334dba4beaf8f3595f69556187d47 (patch)
tree739346631d818ba2dd75e37b465899d0c16aa3b9 /testing/varnish
parentaa6f7efd4f5b46dd477ddabc120ec76ed3ebc631 (diff)
downloadaports-c452528a37a334dba4beaf8f3595f69556187d47.tar.bz2
aports-c452528a37a334dba4beaf8f3595f69556187d47.tar.xz
testing/varnish: new aport
High-performance HTTP accelerator http://www.varnish-cache.org/
Diffstat (limited to 'testing/varnish')
-rw-r--r--testing/varnish/APKBUILD62
-rw-r--r--testing/varnish/varnishd.confd9
-rwxr-xr-xtesting/varnish/varnishd.initd34
-rw-r--r--testing/varnish/varnishd.logrotate9
4 files changed, 114 insertions, 0 deletions
diff --git a/testing/varnish/APKBUILD b/testing/varnish/APKBUILD
new file mode 100644
index 0000000000..0476610d3b
--- /dev/null
+++ b/testing/varnish/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=varnish
+pkgver=2.1.5
+pkgrel=0
+pkgdesc="High-performance HTTP accelerator"
+url="http://www.varnish-cache.org/"
+arch="all"
+license="BSD"
+depends="gcc"
+depends_dev=
+makedepends="$depends_dev pcre-dev ncurses-dev"
+install=""
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
+source="http://repo.varnish-cache.org/source/varnish-$pkgver.tar.gz
+ varnishd.initd
+ varnishd.confd
+ varnishd.logrotate"
+
+_builddir="$srcdir"/varnish-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ install -Dm755 "$srcdir"/varnishd.initd "$pkgdir"/etc/init.d/varnishd \
+ || return 1
+ install -Dm644 "$srcdir"/varnishd.confd "$pkgdir"/etc/conf.d/varnishd \
+ || return 1
+ install -Dm644 "$srcdir"/varnishd.logrotate \
+ "$pkgdir"/etc/logrotate.d/varnishd || return 1
+}
+
+libs() {
+ pkgdesc="Libraries for varnish"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/*.so.* "$subpkgdir"/usr/lib/
+}
+
+md5sums="2d2f227da36a2a240c475304c717b8e3 varnish-2.1.5.tar.gz
+a86ece4df03e2643d4d659fb841e1ea6 varnishd.initd
+78bc033e92dc6153656408f44b1d1df8 varnishd.confd
+a6cb8a43c9465699cf956dc992998225 varnishd.logrotate"
diff --git a/testing/varnish/varnishd.confd b/testing/varnish/varnishd.confd
new file mode 100644
index 0000000000..c2eb140db7
--- /dev/null
+++ b/testing/varnish/varnishd.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/varnishd
+
+# options passed to varnish on startup
+# please see the varnishd man page for more options
+VARNISHD_OPTS="-a 127.0.0.1:8080 -b 127.0.0.1:80"
+
+# arguments passed to varnishncsa
+# please see the varnishncsa man page for more options
+VARNISHNCSA_ARGS="-c -a -w /var/log/varnish/access.log"
diff --git a/testing/varnish/varnishd.initd b/testing/varnish/varnishd.initd
new file mode 100755
index 0000000000..f65cce7122
--- /dev/null
+++ b/testing/varnish/varnishd.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishd.initd,v 1.7 2009/08/30 06:28:07 hollow Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting varnish"
+ #allow varnishd to lock logfile to memory
+ ulimit -l 82000
+ start-stop-daemon --quiet --start --pidfile /var/run/varnishd.pid --exec /usr/sbin/varnishd -- -P /var/run/varnishd.pid ${VARNISHD_OPTS} &> /dev/null
+ eend $?
+
+ if [ "${VARNISHNCSA_ARGS}" != "" ]; then
+ ebegin "Starting varnish logging"
+ start-stop-daemon --quiet --start --pidfile /var/run/varnishncsa.pid --exec /usr/bin/varnishncsa -- -D -P /var/run/varnishncsa.pid ${VARNISHNCSA_ARGS}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping varnish"
+ start-stop-daemon --quiet --stop --pidfile /var/run/varnishd.pid
+ eend $?
+
+ if [ -e /var/run/varnishncsa.pid ]; then
+ ebegin "Stopping varnish logging"
+ start-stop-daemon --quiet --stop --pidfile /var/run/varnishncsa.pid
+ eend $?
+ fi
+}
diff --git a/testing/varnish/varnishd.logrotate b/testing/varnish/varnishd.logrotate
new file mode 100644
index 0000000000..62ee60007a
--- /dev/null
+++ b/testing/varnish/varnishd.logrotate
@@ -0,0 +1,9 @@
+/var/log/varnish/*.log {
+ weekly
+ rotate 10
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ missingok
+}