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