Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/bind/
Date: Thu, 18 Aug 2022 03:10:26
Message-Id: 1660792197.39f09b2a99cbc163d350a580fd833549be9f6462.sam@gentoo
1 commit: 39f09b2a99cbc163d350a580fd833549be9f6462
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 18 03:04:14 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 18 03:09:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39f09b2a
7
8 net-dns/bind: add 9.16.32
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 net-dns/bind/Manifest | 1 +
13 net-dns/bind/bind-9.16.32.ebuild | 382 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 383 insertions(+)
15
16 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
17 index 5f6d74ad9fac..dd3dac899b24 100644
18 --- a/net-dns/bind/Manifest
19 +++ b/net-dns/bind/Manifest
20 @@ -2,4 +2,5 @@ DIST bind-9.16.27.tar.xz 5084340 BLAKE2B 37b49ce81aa5122493a4feb2bb7be53c5d46ff2
21 DIST bind-9.16.29.tar.xz 5088348 BLAKE2B 17ee1443926327c30f1d5820110b01a193c53eb24e23385b713217a4e49d9c2b5ddb6e1c49cb80d2c9083c71ce7872a26fe3597209f2e3215e6cc7e930e68004 SHA512 b4acbafed370438ac53e73468ccb5ea5745a1c8f764dd96f9c9a027594a3b7ce0d486e7f01138b39795b456265e0e6116cd76e44f5a3329687cd718550ca79fb
22 DIST bind-9.16.30.tar.xz 5086288 BLAKE2B 35fe14b58a018df25563e58a9632b4431f740bc7a708eb823117541548d23b1855e43058cf7323361ca904d5e59d687e282abb73dc8b617e4eb25ef113168e93 SHA512 cc9bcbedf63c2efe0a23f14db3e57fdae46f0509aac58e5840a6805ce4fbd76cad5bfde4d461442adb88c4d947f8d79bf979aeb24aeb9303b6adc8d169b7118c
23 DIST bind-9.16.31.tar.xz 5087424 BLAKE2B 75c9038c00fe289161a15a8e4fdadaef5a6a7f3ca03068ec24e82aa9f30ac82d0ded9cf73df83219058cd81b198ea8f561211a323e31b41407294f6932dc61d3 SHA512 8577b4d021a5a763b8669d59ef6c3499238e87657ca94ccfc530cb9a7a215ee3682002aa6141f5731154cbc43e0e6094372961468811a68bbd2a37e20e287c7e
24 +DIST bind-9.16.32.tar.xz 5091860 BLAKE2B df6f2c878138015da580dfaf0e16b5a97b11ead9f99c1425a09da8484954196ea3dafb828ac3ab386200ce2b180646c7eb1e0e62a84c153162270a4a1e19a5fc SHA512 99abedf055901b43e1a85c448ee4c2dd731b7ab77de1454b73c8f9df816aa32262e70e23a8112959d94be990fd4f1c48c36611657ba745670141a7447fd53316
25 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
26
27 diff --git a/net-dns/bind/bind-9.16.32.ebuild b/net-dns/bind/bind-9.16.32.ebuild
28 new file mode 100644
29 index 000000000000..010d5b56b5d2
30 --- /dev/null
31 +++ b/net-dns/bind/bind-9.16.32.ebuild
32 @@ -0,0 +1,382 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +# Re dlz/mysql and threads, needs to be verified..
37 +# MySQL uses thread local storage in its C api. Thus MySQL
38 +# requires that each thread of an application execute a MySQL
39 +# thread initialization to setup the thread local storage.
40 +# This is impossible to do safely while staying within the DLZ
41 +# driver API. This is a limitation caused by MySQL, and not the DLZ API.
42 +# Because of this BIND MUST only run with a single thread when
43 +# using the MySQL driver.
44 +
45 +EAPI=8
46 +
47 +PYTHON_COMPAT=( python3_{8..10} )
48 +
49 +inherit python-r1 autotools multiprocessing toolchain-funcs flag-o-matic db-use systemd tmpfiles
50 +
51 +MY_PV="${PV/_p/-P}"
52 +MY_PV="${MY_PV/_rc/rc}"
53 +MY_P="${PN}-${MY_PV}"
54 +
55 +SDB_LDAP_VER="1.1.0-fc14"
56 +
57 +RRL_PV="${MY_PV}"
58 +
59 +# SDB-LDAP: http://bind9-ldap.bayour.com/
60 +
61 +DESCRIPTION="Berkeley Internet Name Domain - Name Server"
62 +HOMEPAGE="https://www.isc.org/software/bind https://gitlab.isc.org/isc-projects/bind9"
63 +SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
64 + doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
65 +
66 +LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
67 +SLOT="0"
68 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
69 +# -berkdb by default re bug #602682
70 +IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
71 +json ldap lmdb mysql odbc postgres python selinux static-libs test xml +zlib"
72 +# sdb-ldap - patch broken
73 +# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
74 +RESTRICT="!test? ( test )"
75 +
76 +# Upstream dropped the old geoip library, but the BIND configuration for using
77 +# GeoIP remained the same.
78 +REQUIRED_USE="
79 + postgres? ( dlz )
80 + berkdb? ( dlz )
81 + mysql? ( dlz )
82 + odbc? ( dlz )
83 + ldap? ( dlz )
84 + dnsrps? ( dlz )
85 + python? ( ${PYTHON_REQUIRED_USE} )
86 +"
87 +
88 +DEPEND="
89 + acct-group/named
90 + acct-user/named
91 + berkdb? ( sys-libs/db:= )
92 + dev-libs/openssl:=[-bindist(-)]
93 + mysql? ( dev-db/mysql-connector-c:0= )
94 + odbc? ( >=dev-db/unixODBC-2.2.6 )
95 + ldap? ( net-nds/openldap:= )
96 + postgres? ( dev-db/postgresql:= )
97 + caps? ( >=sys-libs/libcap-2.1.0 )
98 + xml? ( dev-libs/libxml2 )
99 + geoip? ( dev-libs/libmaxminddb:= )
100 + geoip2? ( dev-libs/libmaxminddb:= )
101 + gssapi? ( virtual/krb5 )
102 + json? ( dev-libs/json-c:= )
103 + lmdb? ( dev-db/lmdb:= )
104 + zlib? ( sys-libs/zlib )
105 + dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
106 + python? (
107 + ${PYTHON_DEPS}
108 + dev-python/ply[${PYTHON_USEDEP}]
109 + )
110 + dev-libs/libuv:=
111 +"
112 +
113 +RDEPEND="${DEPEND}
114 + selinux? ( sec-policy/selinux-bind )
115 + sys-process/psmisc"
116 +
117 +BDEPEND="
118 + test? (
119 + dev-util/cmocka
120 + dev-util/kyua
121 + )
122 +"
123 +
124 +S="${WORKDIR}/${MY_P}"
125 +
126 +PATCHES=(
127 + "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
128 +)
129 +
130 +src_prepare() {
131 + default
132 +
133 + # Should be installed by bind-tools
134 + sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
135 +
136 + # bug #220361
137 + rm aclocal.m4 || die
138 + rm -rf libtool.m4/ || die
139 + eautoreconf
140 +
141 + use python && python_copy_sources
142 +}
143 +
144 +src_configure() {
145 + bind_configure --without-python
146 + use python && python_foreach_impl python_configure
147 +}
148 +
149 +bind_configure() {
150 + local myeconfargs=(
151 + AR="$(type -P $(tc-getAR))"
152 + --prefix="${EPREFIX}"/usr
153 + --sysconfdir=/etc/bind
154 + --localstatedir=/var
155 + --with-libtool
156 + --enable-full-report
157 + --without-readline
158 + --with-openssl="${ESYSROOT}"/usr
159 + $(use_with test cmocka)
160 + # Removed in 9.17, drags in libunwind dependency too
161 + --disable-backtrace
162 + $(use_enable caps linux-caps)
163 + $(use_enable dnsrps)
164 + $(use_enable dnstap)
165 + $(use_enable fixed-rrset)
166 + $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
167 + $(use_with dlz dlopen)
168 + $(use_with dlz dlz-filesystem)
169 + $(use_with dlz dlz-stub)
170 + $(use_with gssapi)
171 + $(use_with json json-c)
172 + $(use_with ldap dlz-ldap)
173 + $(use_with mysql dlz-mysql)
174 + $(use_with odbc dlz-odbc)
175 + $(use_with postgres dlz-postgres)
176 + $(use_with lmdb)
177 + $(use_with xml libxml2)
178 + $(use_with zlib)
179 + "${@}"
180 + )
181 +
182 + # This is for users to start to migrate back to USE=geoip, rather than
183 + # USE=geoip2
184 + if use geoip ; then
185 + myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
186 + elif use geoip2 ; then
187 + # Added 2020/09/30
188 + # Remove USE=geoip2 support after 2020/03/01
189 + ewarn "USE=geoip2 is deprecated; update your USE flags!"
190 + myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
191 + else
192 + myeconfargs+=( --without-maxminddb --disable-geoip )
193 + fi
194 +
195 + # bug #158664
196 + #gcc-specs-ssp && replace-flags -O[23s] -O
197 +
198 + # To include db.h from proper path
199 + use berkdb && append-flags "-I$(db_includedir)"
200 +
201 + export BUILD_CC=$(tc-getBUILD_CC)
202 + econf "${myeconfargs[@]}"
203 +
204 + # bug #151839
205 + echo '#undef SO_BSDCOMPAT' >> config.h || die
206 +}
207 +
208 +python_configure() {
209 + pushd "${BUILD_DIR}" >/dev/null || die
210 + bind_configure --with-python
211 + popd >/dev/null || die
212 +}
213 +
214 +src_compile() {
215 + default
216 + use python && python_foreach_impl python_compile
217 +}
218 +
219 +python_compile() {
220 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
221 + emake
222 + popd >/dev/null || die
223 +}
224 +
225 +src_test() {
226 + # system tests ('emake test') require network configuration for IPs etc
227 + # so we run the unit tests instead.
228 + TEST_PARALLEL_JOBS="$(makeopts_jobs)" emake unit
229 +}
230 +
231 +src_install() {
232 + default
233 +
234 + dodoc CHANGES README
235 +
236 + if use doc; then
237 + docinto misc
238 + dodoc -r doc/misc/
239 +
240 + # might a 'html' useflag make sense?
241 + docinto html
242 + dodoc -r doc/arm/
243 +
244 + docinto contrib
245 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
246 +
247 + # some handy-dandy dynamic dns examples
248 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
249 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
250 + popd 1>/dev/null || die
251 + fi
252 +
253 + insinto /etc/bind
254 + newins "${FILESDIR}"/named.conf-r8 named.conf
255 +
256 + # ftp://ftp.rs.internic.net/domain/named.cache:
257 + insinto /var/bind
258 + newins "${FILESDIR}"/named.cache-r3 named.cache
259 +
260 + insinto /var/bind/pri
261 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
262 +
263 + newinitd "${FILESDIR}"/named.init-r14 named
264 + newconfd "${FILESDIR}"/named.confd-r7 named
265 +
266 + newenvd "${FILESDIR}"/10bind.env 10bind
267 +
268 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
269 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
270 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
271 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
272 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
273 + for tool in dsfromkey importkey keyfromlabel keygen \
274 + revoke settime signzone verify; do
275 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
276 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
277 + done
278 +
279 + # bug 405251, library archives aren't properly handled by --enable/disable-static
280 + if ! use static-libs; then
281 + find "${ED}" -type f -name '*.a' -delete || die
282 + fi
283 +
284 + # bug 405251
285 + find "${ED}" -type f -name '*.la' -delete || die
286 +
287 + use python && python_foreach_impl python_install
288 +
289 + # bug 450406
290 + dosym named.cache /var/bind/root.cache
291 +
292 + dosym ../../var/bind/pri /etc/bind/pri
293 + dosym ../../var/bind/sec /etc/bind/sec
294 + dosym ../../var/bind/dyn /etc/bind/dyn
295 + keepdir /var/bind/{pri,sec,dyn} /var/log/named
296 +
297 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
298 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
299 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
300 + fperms 0750 /etc/bind /var/bind/pri
301 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
302 +
303 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
304 + dotmpfiles "${FILESDIR}"/named.conf
305 + exeinto /usr/libexec
306 + doexe "${FILESDIR}/generate-rndc-key.sh"
307 +}
308 +
309 +python_install() {
310 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
311 + emake DESTDIR="${D}" install
312 + python_scriptinto /usr/sbin
313 + python_doscript dnssec-{checkds,coverage}
314 + python_optimize
315 + popd >/dev/null || die
316 +}
317 +
318 +pkg_postinst() {
319 + tmpfiles_process named.conf
320 +
321 + if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
322 + einfo "Using /dev/urandom for generating rndc.key"
323 + /usr/sbin/rndc-confgen -a
324 + chown root:named /etc/bind/rndc.key || die
325 + chmod 0640 /etc/bind/rndc.key || die
326 + fi
327 +
328 + einfo
329 + einfo "You can edit /etc/conf.d/named to customize named settings"
330 + einfo
331 + use mysql || use postgres || use ldap && {
332 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
333 + elog "uncomment the specified rc_named_* lines in your"
334 + elog "/etc/conf.d/named config to ensure they'll start before bind"
335 + einfo
336 + }
337 + einfo "If you'd like to run bind in a chroot AND this is a new"
338 + einfo "install OR your bind doesn't already run in a chroot:"
339 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
340 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
341 + einfo
342 +
343 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
344 + if [[ -n ${CHROOT} ]]; then
345 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
346 + elog "To enable the old behaviour (without using mount) uncomment the"
347 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
348 + elog "If you decide to use the new/default method, ensure to make backup"
349 + elog "first and merge your existing configs/zones to /etc/bind and"
350 + elog "/var/bind because bind will now mount the needed directories into"
351 + elog "the chroot dir."
352 + fi
353 +}
354 +
355 +pkg_config() {
356 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
357 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
358 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
359 +
360 + if [[ -z "${CHROOT}" ]]; then
361 + eerror "This config script is designed to automate setting up"
362 + eerror "a chrooted bind/named. To do so, please first uncomment"
363 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
364 + die "Unset CHROOT"
365 + fi
366 + if [[ -d "${CHROOT}" ]]; then
367 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
368 + ewarn "To enable the old behaviour (without using mount) uncomment the"
369 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
370 + ewarn
371 + ewarn "${CHROOT} already exists... some things might become overridden"
372 + ewarn "press CTRL+C if you don't want to continue"
373 + sleep 10
374 + fi
375 +
376 + echo; einfo "Setting up the chroot directory..."
377 +
378 + mkdir -m 0750 -p ${CHROOT} || die
379 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
380 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
381 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
382 +
383 + chown root:named \
384 + ${CHROOT} \
385 + ${CHROOT}/var/{bind,log/named} \
386 + ${CHROOT}/run/named/ \
387 + ${CHROOT}/etc/bind \
388 + || die
389 +
390 + mknod ${CHROOT}/dev/null c 1 3 || die
391 + chmod 0666 ${CHROOT}/dev/null || die
392 +
393 + mknod ${CHROOT}/dev/zero c 1 5 || die
394 + chmod 0666 ${CHROOT}/dev/zero || die
395 +
396 + mknod ${CHROOT}/dev/urandom c 1 9 || die
397 + chmod 0666 ${CHROOT}/dev/urandom || die
398 +
399 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
400 + cp -a /etc/bind ${CHROOT}/etc/ || die
401 + cp -a /var/bind ${CHROOT}/var/ || die
402 + fi
403 +
404 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
405 + if use geoip; then
406 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
407 + elif use geoip2; then
408 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
409 + fi
410 + fi
411 +
412 + elog "You may need to add the following line to your syslog-ng.conf:"
413 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
414 +}