summaryrefslogtreecommitdiff
path: root/www-servers/varnish
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/varnish')
-rw-r--r--www-servers/varnish/Manifest7
-rw-r--r--www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch35
-rw-r--r--www-servers/varnish/files/varnish-3.0.4-automagic.patch94
-rw-r--r--www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch12
-rw-r--r--www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch9
-rw-r--r--www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch12
-rw-r--r--www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch14
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch14
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch19
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-warning.patch12
-rw-r--r--www-servers/varnish/files/varnishd.confd-r122
-rw-r--r--www-servers/varnish/files/varnishd.confd-r226
-rw-r--r--www-servers/varnish/files/varnishd.confd-r322
-rwxr-xr-xwww-servers/varnish/files/varnishd.initd-r187
-rwxr-xr-xwww-servers/varnish/files/varnishd.initd-r294
-rw-r--r--www-servers/varnish/files/varnishd.initd-r378
-rw-r--r--www-servers/varnish/files/varnishd.logrotate9
-rw-r--r--www-servers/varnish/files/varnishd.logrotate-r231
-rw-r--r--www-servers/varnish/files/varnishd.service16
-rw-r--r--www-servers/varnish/files/varnishlog.confd3
-rw-r--r--www-servers/varnish/files/varnishlog.initd32
-rw-r--r--www-servers/varnish/files/varnishncsa.confd3
-rw-r--r--www-servers/varnish/files/varnishncsa.initd32
-rw-r--r--www-servers/varnish/files/varnishncsa.initd-r145
-rw-r--r--www-servers/varnish/metadata.xml31
-rw-r--r--www-servers/varnish/varnish-3.0.5-r3.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.5-r4.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.5.ebuild83
-rw-r--r--www-servers/varnish/varnish-3.0.6.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.7.ebuild100
-rw-r--r--www-servers/varnish/varnish-4.0.0-r1.ebuild108
-rw-r--r--www-servers/varnish/varnish-4.0.1-r1.ebuild111
-rw-r--r--www-servers/varnish/varnish-4.0.2.ebuild111
-rw-r--r--www-servers/varnish/varnish-4.0.3.ebuild105
34 files changed, 1677 insertions, 0 deletions
diff --git a/www-servers/varnish/Manifest b/www-servers/varnish/Manifest
new file mode 100644
index 00000000000..e8df026f0b3
--- /dev/null
+++ b/www-servers/varnish/Manifest
@@ -0,0 +1,7 @@
+DIST varnish-3.0.5.tar.gz 2116664 SHA256 302fd6afc771524ca3912f5d945ab197a55762385c012b2054df7d86bf7ae2b7 SHA512 0fe8a0f45ebe3b159fde811ac374ef8fb5be7712d8a61474778c57ddf4e7fb0404c7b28abeb614a16255a1c9ef0c780db44d03b1c8fbfee54adc49d92cbf733d WHIRLPOOL 5c33e510b5c511790a38451068e569ac62a5db4dc0c9aab99ef1509166674474c12dc5e0e9cdcde0245eb1b5c7b9947fed19a513114f363d468f2fbeff1c8d0d
+DIST varnish-3.0.6.tar.gz 2049810 SHA256 840ded8f25e7343117f6e3e2015759118f1d2db357ae8d7e02ea964e6fb680b7 SHA512 6dcbbf1407e72f9fe6c156a4074d9d42ce147d225cd3001b3240a22ed02e7adf2e900671f9f7e81cbd6b565b29ac65e0436c08c295763b5f7d48b6ab76a1c6b3 WHIRLPOOL 6254de1210f179c0e523cbdb7a1ecd36535cc50ee085d5093a7bc2285d666db45fa4fd130253ae6c94c09037b1225f0c89b5d73a2e0e51f0e5fda7d3e2e2d81d
+DIST varnish-3.0.7.tar.gz 2102037 SHA256 a27e9f11391617fab27cc6edc31d3c8681b8d6975f8c2cd07f6e081bc54c24ce SHA512 5fa9749305eb1a546ef4aae8a1797247fcc9098e1661453b9b87916da9fbc60d76bc0de9542ab17136e3da4b256c8a547aded2b4372dbbb54c44e93eff34a061 WHIRLPOOL 00ff6d16603ba4bf42608d55d769048f35c275a8ffa2b6860df6de2571d0481c39019d58d5b843f8a64492a5bf26caf9d841a023826d2fd2771ed8d35447a659
+DIST varnish-4.0.0.tar.gz 2372630 SHA256 4bbf73656be11687cbb8c7d4a7315786081687664b40a8ccbe67b36f8c0b1c17 SHA512 5eb3806f6c7c46438b6ebbe30c42f5a6afc53a9fa9e8f4b809c7d18b465712640950601be9873810a0f408865fba6ae9d18e46e4f22c89cc3a2e0c351753ac71 WHIRLPOOL 431dad47430a7b2a2eba3dd635eb487cb4d112a9ebdf6a3cb946b0bd8476653bded2d29128bcac1f98c6b3dfc3d7bc9c32f25ea76bccc9f427519f8dc36e2eb6
+DIST varnish-4.0.1.tar.gz 1877657 SHA256 49c3cebc89cb08fbc89d6680c1c8b42efc9313888172f3cdbdae7324b5c8f35b SHA512 e1ae846ff5b5e6ac0b694e8b197f9f7ec8c47677cbaaab6c0c490b6d5fa52f58f84fa3001bee8fe57451328cb809be0b5be55ddb41bd9c2444f23e0af582116b WHIRLPOOL 3013ae885a1eb6d44600b7c5513109a526cbed8f6bf687a81fa31111088713d68a9a059a67912966d7bed3b6404988c5fc785f02c91a63ea1f2a5037caf21e7b
+DIST varnish-4.0.2.tar.gz 1853668 SHA256 d9fb6a6eaf05bbb0c8eb5855556a4b092183b2c1a61281bfd73adf83a304555b SHA512 262bef5823f56c70fa9c7f24225b02b0218889c216143f63bb11db978ca7eddb174f605a5e48a4e774d88b20af5f5845bb2a6aef6fa3aaaf7cacd8c7c17cb82f WHIRLPOOL 35977069c6908a2fd731984585b447055730a288300de8709d83bec2df3677337535970c503b3b3d26635b0c747e7c387a423d93e776a755b8d8f0078c845696
+DIST varnish-4.0.3.tar.gz 1866760 SHA256 94b9a174097f47db2286acd2c35f235e49a2b7a9ddfdbd6eb7aa4da9ae8f8206 SHA512 db7bb141afd4617ac95573983dc30591b0eb9bc1af06df1094f2c1eeac539da936afb4a239d2f446d3c3a51b88a781b7f9f6d9a0b2028eaf0e7049ea2159d883 WHIRLPOOL 942456e19be427859283959dabe5522667519d36decbc598c8ee1e949767ea7435469393289d4373db6abac5275e50a95fc3799a837dc17740a490b4912bfe6f
diff --git a/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch b/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch
new file mode 100644
index 00000000000..93f3da3f878
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch
@@ -0,0 +1,35 @@
+Refine header check in bin/varnishd/mgt/mgt.h, mgt_main.c for uClibc
+
+Because of the difference in how uClibc and glibc stack their header
+files, stdio.h indirectly brings in PTHREAD_CANCELED from pthread.h
+on a uClibc system, whereas it does not on a glibc system. This happens
+in mgt.h and mgt_main.c. This patch refines the check in those files
+to take this fact into consideration.
+
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/444294
+---
+
+diff --git a/bin/varnishd/mgt.h b/bin/varnishd/mgt.h
+index 905fbcc..5d3ab09 100644
+--- a/bin/varnishd/mgt.h
++++ b/bin/varnishd/mgt.h
+@@ -126,6 +126,6 @@ extern unsigned mgt_vcc_unsafe_path;
+ syslog(pri, fmt, __VA_ARGS__); \
+ } while (0)
+
+-#if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT)
++#if (defined(PTHREAD_CANCELED) && !defined(__UCLIBC__)) || defined(PTHREAD_MUTEX_DEFAULT)
+ #error "Keep pthreads out of in manager process"
+ #endif
+diff --git a/bin/varnishd/varnishd.c b/bin/varnishd/varnishd.c
+index 1b7f1e3..dce42d9 100644
+--- a/bin/varnishd/varnishd.c
++++ b/bin/varnishd/varnishd.c
+@@ -656,6 +656,6 @@ main(int argc, char * const *argv)
+ exit(exit_status);
+ }
+
+-#if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT)
++#if (defined(PTHREAD_CANCELED) && !defined(__UCLIBC__)) || defined(PTHREAD_MUTEX_DEFAULT)
+ #error "Keep pthreads out of in manager process"
+ #endif
diff --git a/www-servers/varnish/files/varnish-3.0.4-automagic.patch b/www-servers/varnish/files/varnish-3.0.4-automagic.patch
new file mode 100644
index 00000000000..6a517cc9efe
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.4-automagic.patch
@@ -0,0 +1,94 @@
+diff -Naur varnish-3.0.4.orig/configure.ac varnish-3.0.4/configure.ac
+--- varnish-3.0.4.orig/configure.ac 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/configure.ac 2013-06-15 23:51:51.000000000 -0400
+@@ -87,15 +87,20 @@
+
+ save_LIBS="${LIBS}"
+ LIBS=""
+-AC_SEARCH_LIBS(initscr, [curses ncurses],
+- [have_curses=yes], [have_curses=no])
+-CURSES_LIBS="${LIBS}"
+-LIBS="${save_LIBS}"
+-AC_SUBST(CURSES_LIBS)
+-if test "$have_curses" = no; then
+- AC_MSG_WARN([curses not found; some tools will not be built])
+-fi
+-AC_CHECK_HEADERS([ncurses/curses.h curses.h])
++AC_ARG_WITH([tools], AS_HELP_STRING([--without-tools],
++ [Don't build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes (default: test)]))
++
++AS_IF([test "x$with_tools" != "xno"], [
++ AC_SEARCH_LIBS(initscr, [curses ncurses],
++ [have_curses=yes], [have_curses=no])
++ CURSES_LIBS="${LIBS}"
++ LIBS="${save_LIBS}"
++ AC_SUBST(CURSES_LIBS)
++ if test "$have_curses" = no; then
++ AC_MSG_ERROR([curses not found, required to build additional tools])
++ fi
++ AC_CHECK_HEADERS([ncurses/curses.h curses.h])
++])
+ AM_CONDITIONAL([HAVE_CURSES], [test x$have_curses = xyes])
+
+ save_LIBS="${LIBS}"
+@@ -266,7 +271,6 @@
+ CFLAGS="${save_CFLAGS}"
+
+ # Use jemalloc on Linux
+-JEMALLOC_SUBDIR=
+ JEMALLOC_LDADD=
+ AC_ARG_WITH([jemalloc],
+ [AS_HELP_STRING([--with-jemalloc],
+@@ -274,18 +278,13 @@
+ [],
+ [with_jemalloc=check])
+
+-case $target in
+- *-*-linux*)
+- if test "x$with_jemalloc" != xno; then
+- AC_CHECK_LIB([jemalloc], [malloc_conf],
++if test "x$with_jemalloc" != xno; then
++ AC_CHECK_LIB([jemalloc], [malloc_conf],
++ [JEMALLOC_LDADD="-ljemalloc"],
++ [AC_CHECK_LIB([jemalloc], [jmalloc_conf],
+ [JEMALLOC_LDADD="-ljemalloc"],
+- [AC_MSG_NOTICE([No system jemalloc found, using bundled version])
+- JEMALLOC_SUBDIR=libjemalloc
+- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'])
+- fi
+- ;;
+-esac
+-AC_SUBST(JEMALLOC_SUBDIR)
++ [AC_MSG_ERROR([No system jemalloc found])])])
++fi
+ AC_SUBST(JEMALLOC_LDADD)
+
+ # Userland slab allocator, available only on Solaris
+@@ -588,7 +587,6 @@
+ lib/libvcl/Makefile
+ lib/libvgz/Makefile
+ lib/libvmod_std/Makefile
+- lib/libjemalloc/Makefile
+ man/Makefile
+ redhat/Makefile
+ varnishapi.pc
+--- varnish-3.0.4.orig/lib/Makefile.am 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/lib/Makefile.am 2013-06-15 23:51:08.000000000 -0400
+@@ -6,14 +6,12 @@
+ libvarnishapi \
+ libvcl \
+ libvgz \
+- libvmod_std \
+- @JEMALLOC_SUBDIR@
++ libvmod_std
+
+-DIST_SUBDIRS = \
++DIST_SUBDIRS = \
+ libvarnishcompat \
+ libvarnish \
+ libvarnishapi \
+ libvcl \
+ libvgz \
+- libvmod_std \
+- libjemalloc
++ libvmod_std
diff --git a/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch b/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch
new file mode 100644
index 00000000000..0034c807139
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch
@@ -0,0 +1,12 @@
+diff -Naur varnish-3.0.4.orig/configure.ac varnish-3.0.4/configure.ac
+--- varnish-3.0.4.orig/configure.ac 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/configure.ac 2013-06-21 08:48:32.000000000 -0400
+@@ -4,7 +4,7 @@
+ AC_REVISION([$Id: varnish-3.0.4-fix-automake-1.13.patch,v 1.1 2013/06/21 12:51:35 blueness Exp $])
+ AC_INIT([Varnish], [3.0.4], [varnish-dev@varnish-cache.org])
+ AC_CONFIG_SRCDIR(include/varnishapi.h)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ # save command line CFLAGS for use in VCC_CC (to pass through things like -m64)
+ OCFLAGS="$CFLAGS"
diff --git a/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch b/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch
new file mode 100644
index 00000000000..4c927e364a6
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch
@@ -0,0 +1,9 @@
+diff -Naur varnish-3.0.5.orig/lib/libvmod_std/vmod.py varnish-3.0.5/lib/libvmod_std/vmod.py
+--- varnish-3.0.5.orig/lib/libvmod_std/vmod.py 2013-12-02 02:47:57.000000000 -0500
++++ varnish-3.0.5/lib/libvmod_std/vmod.py 2014-01-16 13:21:50.763238020 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python
+ #-
+ # Copyright (c) 2010-2011 Varnish Software AS
+ # All rights reserved.
diff --git a/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch b/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch
new file mode 100644
index 00000000000..479e007938b
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch
@@ -0,0 +1,12 @@
+diff -Naur varnish-3.0.5.orig/lib/libvmod_std/vmod.py varnish-3.0.5/lib/libvmod_std/vmod.py
+--- varnish-3.0.5.orig/lib/libvmod_std/vmod.py 2014-01-16 13:33:02.983247069 -0500
++++ varnish-3.0.5/lib/libvmod_std/vmod.py 2014-01-16 13:42:36.848254794 -0500
+@@ -43,7 +43,7 @@
+ if len(sys.argv) == 2:
+ specfile = sys.argv[1]
+ else:
+- specfile = "vmod.vcc"
++ specfile = "/etc/varnish/vmod.vcc"
+
+ ctypes = {
+ 'IP': "struct sockaddr_storage *",
diff --git a/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch
new file mode 100644
index 00000000000..311f0fd7c95
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch
@@ -0,0 +1,14 @@
+diff -Naur varnish-4.0.0.orig/man/Makefile.am varnish-4.0.0/man/Makefile.am
+--- varnish-4.0.0.orig/man/Makefile.am 2014-04-12 18:25:35.435043191 -0400
++++ varnish-4.0.0/man/Makefile.am 2014-04-12 18:25:58.579043997 -0400
+@@ -84,8 +84,8 @@
+ $(top_srcdir)/doc/sphinx/include/varnishhist_synopsis.rst
+ ${RST2MAN} $(top_srcdir)/doc/sphinx/reference/varnishhist.rst $@
+
+-vmod_std.3: $(top_srcdir)/lib/libvmod_std/vmod_std.man.rst
++vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst
+ ${RST2MAN} $? $@
+
+-vmod_directors.3: $(top_srcdir)/lib/libvmod_directors/vmod_directors.man.rst
++vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst
+ ${RST2MAN} $? $@
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch
new file mode 100644
index 00000000000..57885c6488e
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch
@@ -0,0 +1,14 @@
+diff -Naur varnish-4.0.1.orig/man/Makefile.am varnish-4.0.1/man/Makefile.am
+--- varnish-4.0.1.orig/man/Makefile.am 2014-06-23 09:43:06.000000000 -0400
++++ varnish-4.0.1/man/Makefile.am 2014-06-25 08:40:43.498765372 -0400
+@@ -86,8 +86,8 @@
+ $(top_srcdir)/doc/sphinx/include/varnishhist_synopsis.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishhist.rst $@
+
+-vmod_std.3: $(top_srcdir)/lib/libvmod_std/vmod_std.man.rst
++vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $? $@
+
+-vmod_directors.3: $(top_srcdir)/lib/libvmod_directors/vmod_directors.man.rst
++vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $? $@
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch
new file mode 100644
index 00000000000..c65fba2391e
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch
@@ -0,0 +1,19 @@
+diff -Naur varnish-4.0.1.orig/doc/sphinx/Makefile.am varnish-4.0.1/doc/sphinx/Makefile.am
+--- varnish-4.0.1.orig/doc/sphinx/Makefile.am 2014-06-23 09:43:06.000000000 -0400
++++ varnish-4.0.1/doc/sphinx/Makefile.am 2014-06-25 08:35:11.887750279 -0400
+@@ -144,11 +144,13 @@
+ BUILT_SOURCES += include/varnishhist_options.rst \
+ include/varnishhist_synopsis.rst
+
+-reference/vmod_std.generated.rst: $(top_srcdir)/lib/libvmod_std/vmod_std.rst
++reference/vmod_std.generated.rst: $(top_builddir)/lib/libvmod_std/vmod_std.rst
++ mkdir -p reference
+ cp $? $@
+ BUILT_SOURCES += reference/vmod_std.generated.rst
+
+-reference/vmod_directors.generated.rst: $(top_srcdir)/lib/libvmod_directors/vmod_directors.rst
++reference/vmod_directors.generated.rst: $(top_builddir)/lib/libvmod_directors/vmod_directors.rst
++ mkdir -p reference
+ cp $? $@
+ BUILT_SOURCES += reference/vmod_directors.generated.rst
+
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch b/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch
new file mode 100644
index 00000000000..ae327292fb7
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch
@@ -0,0 +1,12 @@
+diff -Naur /root/varnish-4.0.1/lib/libvcc/vcc_expr.c varnish-4.0.1/lib/libvcc/vcc_expr.c
+--- /root/varnish-4.0.1/lib/libvcc/vcc_expr.c 2014-06-25 07:06:42.550508615 -0400
++++ varnish-4.0.1/lib/libvcc/vcc_expr.c 2014-06-23 09:43:06.000000000 -0400
+@@ -670,7 +670,7 @@
+ struct expr *e1, *e2;
+ const char *ip;
+ const struct symbol *sym;
+- double d;
++ double d = 0.0;
+
+ *e = NULL;
+ if (tl->t->tok == '(') {
diff --git a/www-servers/varnish/files/varnishd.confd-r1 b/www-servers/varnish/files/varnishd.confd-r1
new file mode 100644
index 00000000000..472b26f9942
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r1
@@ -0,0 +1,22 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+# Ignore the config file, /etc/varnish/default.vcl
+VARNISHD_OPTS="-a 127.0.0.1:8080 -b 127.0.0.1:80"
+
+# Alternatively, don't listen to a backend and use
+# the config file
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -f $CONFIGFILE"
+
+# arguments passed to varnishncsa
+# please see the varnishncsa man page for more options
+VARNISHNCSA_ARGS="-c -a -w /var/log/varnish/access.log"
+
+# We need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.confd-r2 b/www-servers/varnish/files/varnishd.confd-r2
new file mode 100644
index 00000000000..699bc8e57d6
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r2
@@ -0,0 +1,26 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+# Ignore the config file, /etc/varnish/default.vcl
+VARNISHD_OPTS="-a 127.0.0.1:8080 -b 127.0.0.1:80"
+
+# Alternatively, don't listen to a backend and use
+# the config file
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -f $CONFIGFILE"
+
+# Arguments passed to varnishncsa
+# Please see varnishncsa(1) for more options
+VARNISHNCSA_ARGS="-c -a -w /var/log/varnish/access.log"
+
+# Arguments passed to varnishncsa -F option
+# Please see varnishncsa(1) for more options
+# VARNISHNCSA_LOGFORMAT='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"'
+
+# We need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.confd-r3 b/www-servers/varnish/files/varnishd.confd-r3
new file mode 100644
index 00000000000..c05b8fb7521
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r3
@@ -0,0 +1,22 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+
+#CONFIGFILES="/etc/varnish/${SVCNAME}.vcl"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -a 127.0.0.1:8080"
+
+# Alternatively, don't listen to a backend
+VARNISHD_OPTS="-a 127.0.0.1:8080"
+
+
+# User/Group
+VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
+
+# You may need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+#rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.initd-r1 b/www-servers/varnish/files/varnishd.initd-r1
new file mode 100755
index 00000000000..54487ca6e9e
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r1
@@ -0,0 +1,87 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting varnish"
+ start-stop-daemon --quiet --start --pidfile /var/run/varnishd.pid --exec ${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
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.initd-r2 b/www-servers/varnish/files/varnishd.initd-r2
new file mode 100755
index 00000000000..055a9ec0405
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r2
@@ -0,0 +1,94 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting varnish"
+ start-stop-daemon --quiet --start --pidfile /run/varnishd.pid \
+ --exec ${VARNISHD} -- \
+ -P /run/varnishd.pid \
+ ${VARNISHD_OPTS} &> /dev/null
+ eend $?
+
+ if [ "${VARNISHNCSA_ARGS}" != "" ]; then
+ ebegin "Starting varnish logging"
+ start-stop-daemon --quiet --start --pidfile /run/varnishncsa.pid \
+ --exec /usr/bin/varnishncsa -- \
+ -D -P /run/varnishncsa.pid \
+ ${VARNISHNCSA_ARGS} \
+ ${VARNISHNCSA_LOGFORMAT:+-F "${VARNISHNCSA_LOGFORMAT}"}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping varnish"
+ start-stop-daemon --quiet --stop --pidfile /run/varnishd.pid
+ eend $?
+
+ if [ -e /run/varnishncsa.pid ]; then
+ ebegin "Stopping varnish logging"
+ start-stop-daemon --quiet --stop --pidfile /run/varnishncsa.pid
+ eend $?
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.initd-r3 b/www-servers/varnish/files/varnishd.initd-r3
new file mode 100644
index 00000000000..4a7dcb9d0ad
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r3
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHD_PID=${VARNISHD_PID:-/run/${SVCNAME}.pid}
+CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}"
+
+command="${VARNISHD:-/usr/sbin/varnishd}"
+command_args="-P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
+pidfile="${VARNISHD_PID}"
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start_pre() {
+ checkconfig || return 1
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ checkconfig || return 1
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.logrotate b/www-servers/varnish/files/varnishd.logrotate
new file mode 100644
index 00000000000..62ee60007a2
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.logrotate
@@ -0,0 +1,9 @@
+/var/log/varnish/*.log {
+ weekly
+ rotate 10
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ missingok
+}
diff --git a/www-servers/varnish/files/varnishd.logrotate-r2 b/www-servers/varnish/files/varnishd.logrotate-r2
new file mode 100644
index 00000000000..e697e428f3d
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.logrotate-r2
@@ -0,0 +1,31 @@
+/var/log/varnish/varnishncsa.log {
+ daily
+ rotate 31
+ copytruncate
+ dateext
+ dateyesterday
+ delaycompress
+ compress
+ notifempty
+ missingok
+
+ prerotate
+ /etc/init.d/varnishncsa -q status && /etc/init.d/varnishncsa -q flush
+ endscript
+}
+
+/var/log/varnish/varnishlog.log {
+ daily
+ rotate 31
+ copytruncate
+ dateext
+ dateyesterday
+ delaycompress
+ compress
+ notifempty
+ missingok
+
+ prerotate
+ /etc/init.d/varnishlog -q status && /etc/init.d/varnishlog -q flush
+ endscript
+}
diff --git a/www-servers/varnish/files/varnishd.service b/www-servers/varnish/files/varnishd.service
new file mode 100644
index 00000000000..a45f1e24783
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Varnish is a high-performance HTTP accelerator
+After=network.target
+
+[Service]
+Type=forking
+LimitNOFILE=32786
+LimitMEMLOCK=82000
+PIDFile=/var/run/varnishd.pid
+ExecStart=/usr/sbin/varnishd -a 0.0.0.0:80 -P /var/run/varnishd.pid
+
+#If you wish to use a config file, then use the following ExecStart line
+#ExecStart=/usr/sbin/varnishd -a 0.0.0.0:80 -f /etc/varnish/default.vcl -P /var/run/varnishd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/varnish/files/varnishlog.confd b/www-servers/varnish/files/varnishlog.confd
new file mode 100644
index 00000000000..d7358b1dc89
--- /dev/null
+++ b/www-servers/varnish/files/varnishlog.confd
@@ -0,0 +1,3 @@
+# /etc/conf.d/varnishlog
+
+VARNISHLOG_OPTS="-a -w /var/log/varnish/varnishlog.log"
diff --git a/www-servers/varnish/files/varnishlog.initd b/www-servers/varnish/files/varnishlog.initd
new file mode 100644
index 00000000000..fae8297743f
--- /dev/null
+++ b/www-servers/varnish/files/varnishlog.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHLOG_PID=${VARNISHLOG_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHLOG:-/usr/bin/varnishlog}"
+command_args="-D -P ${VARNISHLOG_PID} ${VARNISHLOG_OPTS}"
+pidfile="${VARNISHLOG_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHLOG_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHLOG_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/files/varnishncsa.confd b/www-servers/varnish/files/varnishncsa.confd
new file mode 100644
index 00000000000..f3112fdd532
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.confd
@@ -0,0 +1,3 @@
+# /etc/conf.d/varnishncsa
+
+VARNISHNCSA_OPTS="-a -w /var/log/varnish/${SVCNAME}.log"
diff --git a/www-servers/varnish/files/varnishncsa.initd b/www-servers/varnish/files/varnishncsa.initd
new file mode 100644
index 00000000000..7b38397670d
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
+command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
+pidfile="${VARNISHNCSA_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/files/varnishncsa.initd-r1 b/www-servers/varnish/files/varnishncsa.initd-r1
new file mode 100644
index 00000000000..e06a5945afb
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.initd-r1
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
+command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
+pidfile="${VARNISHNCSA_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+# We need to make sure varnishd has started first, bug #524284
+start_pre() {
+ TIMEOUT=${TIMEOUT:-5}
+
+ local i=0
+ while [ $i -lt ${TIMEOUT} ]; do
+ echo status | varnishadm 2>/dev/null | grep -q "Child in state running"
+ test $? -eq 0 && break
+
+ sleep 1 && i=$(expr $i + 1)
+ done
+}
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/metadata.xml b/www-servers/varnish/metadata.xml
new file mode 100644
index 00000000000..a70395dd116
--- /dev/null
+++ b/www-servers/varnish/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer>
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ <description>Secondary maintainer</description>
+ </maintainer>
+ <use>
+ <flag name="tools">Build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes</flag>
+ <flag name="jemalloc">Use dev-libs/jemalloc for allocations</flag>
+ </use>
+ <longdescription lang="en">
+ Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy)
+ is an application that stores (caches) documents that have been requested over
+ the HTTP protocol.
+ Based on certain criteria the next client requesting the document is either
+ given the cached document, or a "fresh" document requested from a backend
+ server. The purpose of this is to minimize the requests going to the backend
+ server(s) by serving the same document to potentially many users.
+
+ The goal of Varnish is to be a very fast, stable and effective light-weight HTTP
+ accelerator daemon, by using modern and effective technologies. Ease of
+ managment and good documentation is also a main goal of the project since the
+ lack of either one will render Varnish useless.
+ </longdescription>
+</pkgmetadata>
diff --git a/www-servers/varnish/varnish-3.0.5-r3.ebuild b/www-servers/varnish/varnish-3.0.5-r3.ebuild
new file mode 100644
index 00000000000..f1acfed37bc
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5-r3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r1 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r1 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.5-r4.ebuild b/www-servers/varnish/varnish-3.0.5-r4.ebuild
new file mode 100644
index 00000000000..3dc57eb4af2
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5-r4.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.5.ebuild b/www-servers/varnish/varnish-3.0.5.ebuild
new file mode 100644
index 00000000000..151d66c7511
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools-utils eutils
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r1 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r1 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.6.ebuild b/www-servers/varnish/varnish-3.0.6.ebuild
new file mode 100644
index 00000000000..3bb22aa8082
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.6.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.7.ebuild b/www-servers/varnish/varnish-3.0.7.ebuild
new file mode 100644
index 00000000000..3dc57eb4af2
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.7.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.0-r1.ebuild b/www-servers/varnish/varnish-4.0.0-r1.ebuild
new file mode 100644
index 00000000000..8f7b4e21c55
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.0-r1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.0-fix-man-Makefile_am.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.1-r1.ebuild b/www-servers/varnish/varnish-4.0.1-r1.ebuild
new file mode 100644
index 00000000000..8d7018d9e6e
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.1-r1.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.1-fix-man-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-doc-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-warning.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.2.ebuild b/www-servers/varnish/varnish-4.0.2.ebuild
new file mode 100644
index 00000000000..8d7018d9e6e
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.2.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.1-fix-man-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-doc-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-warning.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.3.ebuild b/www-servers/varnish/varnish-4.0.3.ebuild
new file mode 100644
index 00000000000..9bf65e5b5e5
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.3.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}