dev-python/cryptography: stable on arm64
[gentoo.git] / net-dns / pdns-recursor / pdns-recursor-4.1.14.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit flag-o-matic
7
8 DESCRIPTION="The PowerDNS Recursor"
9 HOMEPAGE="https://www.powerdns.com/"
10 SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ~arm x86"
15 IUSE="debug libressl luajit protobuf snmp sodium systemd"
16
17 DEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
18         luajit? ( dev-lang/luajit:= )
19         protobuf? (
20                 dev-libs/protobuf
21                 >=dev-libs/boost-1.42:=
22         )
23         systemd? ( sys-apps/systemd:0= )
24         snmp? ( net-analyzer/net-snmp )
25         sodium? ( dev-libs/libsodium:= )
26         libressl? ( dev-libs/libressl:= )
27         !libressl? ( dev-libs/openssl:= )
28         >=dev-libs/boost-1.35:="
29 RDEPEND="${DEPEND}
30         !<net-dns/pdns-2.9.20-r1"
31 BDEPEND="virtual/pkgconfig"
32
33 S="${WORKDIR}"/${P/_/-}
34
35 pkg_setup() {
36         filter-flags -ftree-vectorize
37 }
38
39 src_configure() {
40         econf \
41                 --sysconfdir=/etc/powerdns \
42                 $(use_enable debug verbose-logging) \
43                 $(use_enable systemd) \
44                 $(use_enable sodium libsodium) \
45                 $(use_with !luajit lua) \
46                 $(use_with luajit luajit) \
47                 $(use_with protobuf) \
48                 $(use_with snmp net-snmp)
49 }
50
51 src_install() {
52         default
53
54         mv "${D}"/etc/powerdns/recursor.conf{-dist,}
55
56         # set defaults: setuid=nobody, setgid=nobody
57         sed -i \
58                 -e 's/^# set\([ug]\)id=$/set\1id=nobody/' \
59                 -e 's/^# quiet=$/quiet=on/' \
60                 -e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
61                 "${D}"/etc/powerdns/recursor.conf
62
63         newinitd "${FILESDIR}"/pdns-recursor-r1 pdns-recursor
64
65         keepdir /var/lib/powerdns
66 }
67
68 pkg_postinst() {
69         local old
70
71         for old in ${REPLACING_VERSIONS}; do
72                 ver_test ${old} -lt 4.0.0-r1 || continue
73
74                 ewarn "Starting with 4.0.0-r1 the init script has been renamed from precursor"
75                 ewarn "to pdns-recursor, please update your runlevels accordingly."
76
77                 break
78         done
79 }