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