1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit user autotools systemd python-r1
10 DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
11 HOMEPAGE="https://varnish-cache.org/"
12 SRC_URI="http://varnish-cache.org/_downloads/${P}.tgz"
16 KEYWORDS="amd64 ~mips ~ppc ~ppc64 x86"
17 IUSE="jemalloc jit static-libs"
21 dev-libs/libpcre[jit?]
22 jemalloc? ( dev-libs/jemalloc )
25 #varnish compiles stuff at run time
36 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
38 RESTRICT="test" #315725
41 ebegin "Creating varnish user and group"
43 enewuser varnish -1 -1 /var/lib/varnish varnish
48 # Remove bundled libjemalloc. We also fix
49 # automagic dep in our patches, bug #461638
50 rm -rf lib/libjemalloc
53 eapply "${FILESDIR}"/fix-build-x86.patch
55 # Remove -Werror bug #528354
56 sed -i -e 's/-Werror\([^=]\)/\1/g' configure.ac
65 $(use_enable static-libs static) \
66 $(use_enable jit pcre-jit ) \
71 emake DESTDIR="${D}" install
73 python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
75 newinitd "${FILESDIR}"/varnishlog.initd varnishlog
76 newconfd "${FILESDIR}"/varnishlog.confd varnishlog
78 newinitd "${FILESDIR}"/varnishncsa.initd varnishncsa
79 newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
81 newinitd "${FILESDIR}"/varnishd.initd-r4 varnishd
82 newconfd "${FILESDIR}"/varnishd.confd-r4 varnishd
84 insinto /etc/logrotate.d/
85 newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
89 dodir /var/log/varnish/
91 systemd_dounit "${FILESDIR}/${PN}d.service"
94 doins lib/libvmod_std/vmod.vcc
100 fowners root:varnish /etc/varnish/
101 fowners varnish:varnish /var/lib/varnish/
102 fperms 0750 /var/lib/varnish/ /etc/varnish/