Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/unbound/
Date: Thu, 06 Aug 2020 13:51:28
Message-Id: 1596721792.3d0671589f2a4739bb6db0e45f67c5f486df43c4.whissi@gentoo
1 commit: 3d0671589f2a4739bb6db0e45f67c5f486df43c4
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 6 13:46:52 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 6 13:49:52 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d067158
7
8 net-dns/unbound: bump to v1.11.0
9
10 Package-Manager: Portage-3.0.1, Repoman-2.3.23
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 net-dns/unbound/Manifest | 1 +
14 net-dns/unbound/unbound-1.11.0.ebuild | 200 ++++++++++++++++++++++++++++++++++
15 2 files changed, 201 insertions(+)
16
17 diff --git a/net-dns/unbound/Manifest b/net-dns/unbound/Manifest
18 index bdc8e09b1b1..3dbbe890ff8 100644
19 --- a/net-dns/unbound/Manifest
20 +++ b/net-dns/unbound/Manifest
21 @@ -1 +1,2 @@
22 DIST unbound-1.10.1.tar.gz 5729334 BLAKE2B 7ca4f23c12a551bc6e5d6ec32f19ca0f54526b9a4c868ced8f31cfd31dec23f8240b78f0c00d2cc6f9aa21f6c1b98697c85ef3ebd804a838a5a082893fe98094 SHA512 d07f3ac0e751c17a3ff7d99518c22529cf6856861218564a2ca073422905525cb9ddaf76c9600187946fadb7324343bcd85c34ff06bd322e0ea621a2d258bb85
23 +DIST unbound-1.11.0.tar.gz 5900967 BLAKE2B 3119bbcd78fa19c610937215abc64abcc1ca96ba42b6753a1e36fef501f68971ac2ee0cb9bde377e0b257c57f505aeac2315a6bf031626874d30967b0a5eb46a SHA512 511e787c5f9647286b07028702a8909390e0e6eafe7224459d5f1eee8a8dfb09c71e33f291e30851dc57411123b91dfe0e124787109a7e4afdf6f3b02768e7cd
24
25 diff --git a/net-dns/unbound/unbound-1.11.0.ebuild b/net-dns/unbound/unbound-1.11.0.ebuild
26 new file mode 100644
27 index 00000000000..30cafd751b1
28 --- /dev/null
29 +++ b/net-dns/unbound/unbound-1.11.0.ebuild
30 @@ -0,0 +1,200 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI="7"
35 +PYTHON_COMPAT=( python3_{6,7,8,9} )
36 +
37 +inherit autotools flag-o-matic multilib-minimal python-single-r1 systemd
38 +
39 +MY_P=${PN}-${PV/_/}
40 +DESCRIPTION="A validating, recursive and caching DNS resolver"
41 +HOMEPAGE="https://unbound.net/ https://nlnetlabs.nl/projects/unbound/about/"
42 +SRC_URI="https://nlnetlabs.nl/downloads/unbound/${MY_P}.tar.gz"
43 +
44 +LICENSE="BSD GPL-2"
45 +SLOT="0/8" # ABI version of libunbound.so
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86"
47 +IUSE="debug dnscrypt dnstap +ecdsa ecs gost libressl python redis selinux static-libs systemd test threads"
48 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
49 +RESTRICT="!test? ( test )"
50 +
51 +# Note: expat is needed by executable only but the Makefile is custom
52 +# and doesn't make it possible to easily install the library without
53 +# the executables. MULTILIB_USEDEP may be dropped once build system
54 +# is fixed.
55 +
56 +CDEPEND="acct-group/unbound
57 + acct-user/unbound
58 + >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
59 + >=dev-libs/libevent-2.0.21:0=[${MULTILIB_USEDEP}]
60 + libressl? ( >=dev-libs/libressl-2.2.4:0[${MULTILIB_USEDEP}] )
61 + !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
62 + dnscrypt? ( dev-libs/libsodium[${MULTILIB_USEDEP}] )
63 + dnstap? (
64 + dev-libs/fstrm[${MULTILIB_USEDEP}]
65 + >=dev-libs/protobuf-c-1.0.2-r1[${MULTILIB_USEDEP}]
66 + )
67 + ecdsa? (
68 + !libressl? ( dev-libs/openssl:0[-bindist] )
69 + )
70 + python? ( ${PYTHON_DEPS} )
71 + redis? ( dev-libs/hiredis:= )"
72 +
73 +BDEPEND="virtual/pkgconfig"
74 +
75 +DEPEND="${CDEPEND}
76 + python? ( dev-lang/swig )
77 + test? (
78 + net-dns/ldns-utils[examples]
79 + dev-util/splint
80 + app-text/wdiff
81 + )
82 + systemd? ( sys-apps/systemd )"
83 +
84 +RDEPEND="${CDEPEND}
85 + net-dns/dnssec-root
86 + selinux? ( sec-policy/selinux-bind )"
87 +
88 +# bug #347415
89 +RDEPEND="${RDEPEND}
90 + net-dns/dnssec-root"
91 +
92 +PATCHES=(
93 + "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
94 + "${FILESDIR}"/${PN}-1.6.3-pkg-config.patch
95 + "${FILESDIR}"/${PN}-1.10.1-find-ar.patch
96 +)
97 +
98 +S=${WORKDIR}/${MY_P}
99 +
100 +pkg_setup() {
101 + use python && python-single-r1_pkg_setup
102 +}
103 +
104 +src_prepare() {
105 + default
106 +
107 + eautoreconf
108 +
109 + # required for the python part
110 + multilib_copy_sources
111 +}
112 +
113 +src_configure() {
114 + [[ ${CHOST} == *-darwin* ]] || append-ldflags -Wl,-z,noexecstack
115 + multilib-minimal_src_configure
116 +}
117 +
118 +multilib_src_configure() {
119 + econf \
120 + $(use_enable debug) \
121 + $(use_enable gost) \
122 + $(use_enable dnscrypt) \
123 + $(use_enable dnstap) \
124 + $(use_enable ecdsa) \
125 + $(use_enable ecs subnet) \
126 + $(multilib_native_use_enable redis cachedb) \
127 + $(use_enable static-libs static) \
128 + $(use_enable systemd) \
129 + $(multilib_native_use_with python pythonmodule) \
130 + $(multilib_native_use_with python pyunbound) \
131 + $(use_with threads pthreads) \
132 + --disable-flto \
133 + --disable-rpath \
134 + --enable-event-api \
135 + --enable-ipsecmod \
136 + --enable-tfo-client \
137 + --enable-tfo-server \
138 + --with-libevent="${EPREFIX}"/usr \
139 + $(multilib_native_usex redis --with-libhiredis="${EPREFIX}/usr" --without-libhiredis) \
140 + --with-pidfile="${EPREFIX}"/run/unbound.pid \
141 + --with-rootkey-file="${EPREFIX}"/etc/dnssec/root-anchors.txt \
142 + --with-ssl="${EPREFIX}"/usr \
143 + --with-libexpat="${EPREFIX}"/usr
144 +
145 + # http://unbound.nlnetlabs.nl/pipermail/unbound-users/2011-April/001801.html
146 + # $(use_enable debug lock-checks) \
147 + # $(use_enable debug alloc-checks) \
148 + # $(use_enable debug alloc-lite) \
149 + # $(use_enable debug alloc-nonregional) \
150 +}
151 +
152 +multilib_src_install_all() {
153 + use python && python_optimize
154 +
155 + newinitd "${FILESDIR}"/unbound-r1.initd unbound
156 + newconfd "${FILESDIR}"/unbound-r1.confd unbound
157 +
158 + systemd_dounit "${FILESDIR}"/unbound.service
159 + systemd_dounit "${FILESDIR}"/unbound.socket
160 + systemd_newunit "${FILESDIR}"/unbound_at.service "unbound@.service"
161 + systemd_dounit "${FILESDIR}"/unbound-anchor.service
162 +
163 + dodoc doc/{README,CREDITS,TODO,Changelog,FEATURES}
164 +
165 + # bug #315519
166 + dodoc contrib/unbound_munin_
167 +
168 + docinto selinux
169 + dodoc contrib/selinux/*
170 +
171 + exeinto /usr/share/${PN}
172 + doexe contrib/update-anchor.sh
173 +
174 + # create space for auto-trust-anchor-file...
175 + keepdir /etc/unbound/var
176 + fowners root:unbound /etc/unbound/var
177 + fperms 0770 /etc/unbound/var
178 + # ... and point example config to it
179 + sed -i \
180 + -e '/# auto-trust-anchor-file:/s,/etc/dnssec/root-anchors.txt,/etc/unbound/var/root-anchors.txt,' \
181 + "${ED}/etc/unbound/unbound.conf" \
182 + || die
183 +
184 + # Used to store cache data
185 + keepdir /var/lib/${PN}
186 + fowners root:unbound /var/lib/${PN}
187 + fperms 0770 /var/lib/${PN}
188 +
189 + find "${ED}" -name '*.la' -delete || die
190 + if ! use static-libs ; then
191 + find "${ED}" -name "*.a" -delete || die
192 + fi
193 +}
194 +
195 +pkg_postinst() {
196 + if [[ ! -f "${EROOT}/etc/unbound/unbound_control.key" ]] ; then
197 + einfo "Trying to create unbound control key ..."
198 + if ! unbound-control-setup &>/dev/null ; then
199 + ewarn "Failed to create unbound control key!"
200 + fi
201 + fi
202 +
203 + if [[ ! -f "${EROOT}/etc/unbound/var/root-anchors.txt" ]] ; then
204 + einfo ""
205 + einfo "If you want unbound to automatically update the root-anchor file for DNSSEC validation"
206 + einfo "set 'auto-trust-anchor-file: ${EROOT}/etc/unbound/var/root-anchors.txt' in ${EROOT}/etc/unbound/unbound.conf"
207 + einfo "and run"
208 + einfo ""
209 + einfo " su -s /bin/sh -c '${EROOT}/usr/sbin/unbound-anchor -a ${EROOT}/etc/unbound/var/root-anchors.txt' unbound"
210 + einfo ""
211 + einfo "as root to create it initially before starting unbound for the first time after enabling this."
212 + einfo ""
213 + fi
214 +
215 + # Our user is not available on prefix
216 + use prefix && return
217 +
218 + local _perm_check_testfile=$(mktemp --dry-run "${EPREFIX}"/etc/unbound/var/.pkg_postinst-perm-check.XXXXXXXXX)
219 + su -s /bin/sh -c "touch ${_perm_check_testfile}" unbound &>/dev/null
220 + if [ $? -ne 0 ] ; then
221 + ewarn "WARNING: unbound user cannot write to \"${EPREFIX}/etc/unbound/var\"!"
222 + ewarn "Run the following commands to restore default permission:"
223 + ewarn ""
224 + ewarn " chown root:unbound ${EPREFIX}/etc/unbound/var"
225 + ewarn " chmod 0770 ${EPREFIX}/etc/unbound/var"
226 + else
227 + # Cleanup -- no reason to die here!
228 + rm -f "${_perm_check_testfile}"
229 + fi
230 +}