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