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, 28 Oct 2021 02:02:01
Message-Id: 1635386498.7916382847660dca423c35c199bbab7f2b5576c4.sam@gentoo
1 commit: 7916382847660dca423c35c199bbab7f2b5576c4
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 28 01:58:50 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 28 02:01:38 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79163828
7
8 net-dns/bind: add 9.16.22 (security bump)
9
10 Bug: https://bugs.gentoo.org/820563
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.16.22.ebuild | 373 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 374 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index a264eb599c7..00f721a461a 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -1,4 +1,5 @@
22 DIST bind-9.16.15.tar.xz 5025688 BLAKE2B 8b0723d46f812793f5a52b1ddacf21fe28e183ef8cd166eadf0af163280021fce7c0a6a560d28dacbc6dd4642e41eb5424b4de2c5ff1049a5cfa5d52e3df5beb SHA512 30dad6e2144b3ac53ef0a2d1ed3c8342120f148fc0eb6409113a6d5ed3444eecb917915fdf39c26fd223396fc1e873410a50da305f0b870864f7fbbdccec8033
23 DIST bind-9.16.18.tar.xz 5023512 BLAKE2B 7766c1e6ab30ae42f0ba49d96fe0e2675e79aa01c48569d3cf5c122944319fbb88299a193ce06cc0aa67f6085fd80e29472fc7adc845e4bbb7ff6896dae87ed6 SHA512 6ba2f14324ebdc66d2a6d60e929fb47e170dd7662cf4b18ef3ad9da30a61b43c7d5539e931c483ab36e63ae0398aeed255fd672489fb332dccf182df9aa102f9
24 DIST bind-9.16.21.tar.xz 5057816 BLAKE2B bc7de285b45084a4904aee7c5c3042c7a2075968f19ed76b932c976f86f60bc8bf0d6cce8889a9adf7e807c8151bd6088ef1b2b00460a4d1cff7a74bb2221d43 SHA512 2cb71e50600fd7409ca7b7e2e9cf4ef6668b07faad7980ac8060e6a76f30a315182d75534ad1dcfb740c225cdf727b2bd6aa9ceb24ab77ffff09b7b5d6eaca2d
25 +DIST bind-9.16.22.tar.xz 5059000 BLAKE2B c4853a8be268f9666f3677adf2e64c6d74f7df44d2dc05df544cead38c6c3b86489d25a66ccea6ce8ca89fa525a1848fe93a8aaa6bb1ee090aa189bf6aad40f3 SHA512 586fb4d5a656d6539033dcdfdd230b36465a2d2e6ada651c1f1548d062a9050e7a962af87e2a56931fe24c65586d29012d4a041dcddbb28f42b4d01fe291d9d1
26 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
27
28 diff --git a/net-dns/bind/bind-9.16.22.ebuild b/net-dns/bind/bind-9.16.22.ebuild
29 new file mode 100644
30 index 00000000000..692748deccc
31 --- /dev/null
32 +++ b/net-dns/bind/bind-9.16.22.ebuild
33 @@ -0,0 +1,373 @@
34 +# Copyright 1999-2021 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +# Re dlz/mysql and threads, needs to be verified..
38 +# MySQL uses thread local storage in its C api. Thus MySQL
39 +# requires that each thread of an application execute a MySQL
40 +# thread initialization to setup the thread local storage.
41 +# This is impossible to do safely while staying within the DLZ
42 +# driver API. This is a limitation caused by MySQL, and not the DLZ API.
43 +# Because of this BIND MUST only run with a single thread when
44 +# using the MySQL driver.
45 +
46 +EAPI=7
47 +
48 +PYTHON_COMPAT=( python3_{8..9} )
49 +
50 +inherit python-r1 autotools toolchain-funcs flag-o-matic db-use systemd tmpfiles
51 +
52 +MY_PV="${PV/_p/-P}"
53 +MY_PV="${MY_PV/_rc/rc}"
54 +MY_P="${PN}-${MY_PV}"
55 +
56 +SDB_LDAP_VER="1.1.0-fc14"
57 +
58 +RRL_PV="${MY_PV}"
59 +
60 +# SDB-LDAP: http://bind9-ldap.bayour.com/
61 +
62 +DESCRIPTION="Berkeley Internet Name Domain - Name Server"
63 +HOMEPAGE="https://www.isc.org/software/bind"
64 +SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
65 + doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
66 +
67 +LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
68 +SLOT="0"
69 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
70 +# -berkdb by default re bug 602682
71 +IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
72 +json ldap lmdb mysql odbc postgres python selinux static-libs xml +zlib"
73 +# sdb-ldap - patch broken
74 +# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
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 +S="${WORKDIR}/${MY_P}"
118 +
119 +PATCHES=(
120 + "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
121 +)
122 +
123 +# bug 479092, requires networking
124 +# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
125 +#RESTRICT="test"
126 +
127 +src_prepare() {
128 + default
129 +
130 + # should be installed by bind-tools
131 + sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
132 +
133 + # Disable tests for now, bug 406399
134 + sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/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="${EPREFIX}"/usr
159 + --without-cmocka
160 + $(use_enable caps linux-caps)
161 + $(use_enable dnsrps)
162 + $(use_enable dnstap)
163 + $(use_enable fixed-rrset)
164 + # $(use_enable static-libs static)
165 + $(use_with berkdb dlz-bdb)
166 + $(use_with dlz dlopen)
167 + $(use_with dlz dlz-filesystem)
168 + $(use_with dlz dlz-stub)
169 + $(use_with gssapi)
170 + $(use_with json json-c)
171 + $(use_with ldap dlz-ldap)
172 + $(use_with mysql dlz-mysql)
173 + $(use_with odbc dlz-odbc)
174 + $(use_with postgres dlz-postgres)
175 + $(use_with lmdb)
176 + $(use_with xml libxml2)
177 + $(use_with zlib)
178 + "${@}"
179 + )
180 + # This is for users to start to migrate back to USE=geoip, rather than
181 + # USE=geoip2
182 + if use geoip ; then
183 + myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
184 + elif use geoip2 ; then
185 + # Added 2020/09/30
186 + # Remove USE=geoip2 support after 2020/03/01
187 + ewarn "USE=geoip2 is deprecated; update your USE flags!"
188 + myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
189 + else
190 + myeconfargs+=( --without-maxminddb --disable-geoip )
191 + fi
192 +
193 + # bug #158664
194 +# gcc-specs-ssp && replace-flags -O[23s] -O
195 +
196 + # To include db.h from proper path
197 + use berkdb && append-flags "-I$(db_includedir)"
198 +
199 + export BUILD_CC=$(tc-getBUILD_CC)
200 + econf "${myeconfargs[@]}"
201 +
202 + # bug #151839
203 + echo '#undef SO_BSDCOMPAT' >> config.h
204 +}
205 +
206 +python_configure() {
207 + pushd "${BUILD_DIR}" >/dev/null || die
208 + bind_configure --with-python
209 + popd >/dev/null || die
210 +}
211 +
212 +src_compile() {
213 + default
214 + use python && python_foreach_impl python_compile
215 +}
216 +
217 +python_compile() {
218 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
219 + emake
220 + popd >/dev/null || die
221 +}
222 +
223 +src_install() {
224 + default
225 +
226 + dodoc CHANGES README
227 +
228 + if use doc; then
229 + docinto misc
230 + dodoc -r doc/misc/
231 +
232 + # might a 'html' useflag make sense?
233 + docinto html
234 + dodoc -r doc/arm/
235 +
236 + docinto contrib
237 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
238 +
239 + # some handy-dandy dynamic dns examples
240 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
241 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
242 + popd 1>/dev/null || die
243 + fi
244 +
245 + insinto /etc/bind
246 + newins "${FILESDIR}"/named.conf-r8 named.conf
247 +
248 + # ftp://ftp.rs.internic.net/domain/named.cache:
249 + insinto /var/bind
250 + newins "${FILESDIR}"/named.cache-r3 named.cache
251 +
252 + insinto /var/bind/pri
253 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
254 +
255 + newinitd "${FILESDIR}"/named.init-r14 named
256 + newconfd "${FILESDIR}"/named.confd-r7 named
257 +
258 + newenvd "${FILESDIR}"/10bind.env 10bind
259 +
260 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
261 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
262 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
263 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
264 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
265 + for tool in dsfromkey importkey keyfromlabel keygen \
266 + revoke settime signzone verify; do
267 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
268 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
269 + done
270 +
271 + # bug 405251, library archives aren't properly handled by --enable/disable-static
272 + if ! use static-libs; then
273 + find "${ED}" -type f -name '*.a' -delete || die
274 + fi
275 +
276 + # bug 405251
277 + find "${ED}" -type f -name '*.la' -delete || die
278 +
279 + use python && python_foreach_impl python_install
280 +
281 + # bug 450406
282 + dosym named.cache /var/bind/root.cache
283 +
284 + dosym ../../var/bind/pri /etc/bind/pri
285 + dosym ../../var/bind/sec /etc/bind/sec
286 + dosym ../../var/bind/dyn /etc/bind/dyn
287 + keepdir /var/bind/{pri,sec,dyn} /var/log/named
288 +
289 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
290 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
291 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
292 + fperms 0750 /etc/bind /var/bind/pri
293 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
294 +
295 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
296 + dotmpfiles "${FILESDIR}"/named.conf
297 + exeinto /usr/libexec
298 + doexe "${FILESDIR}/generate-rndc-key.sh"
299 +}
300 +
301 +python_install() {
302 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
303 + emake DESTDIR="${D}" install
304 + python_scriptinto /usr/sbin
305 + python_doscript dnssec-{checkds,coverage}
306 + python_optimize
307 + popd >/dev/null || die
308 +}
309 +
310 +pkg_postinst() {
311 + tmpfiles_process named.conf
312 +
313 + if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
314 + einfo "Using /dev/urandom for generating rndc.key"
315 + /usr/sbin/rndc-confgen -a
316 + chown root:named /etc/bind/rndc.key || die
317 + chmod 0640 /etc/bind/rndc.key || die
318 + fi
319 +
320 + einfo
321 + einfo "You can edit /etc/conf.d/named to customize named settings"
322 + einfo
323 + use mysql || use postgres || use ldap && {
324 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
325 + elog "uncomment the specified rc_named_* lines in your"
326 + elog "/etc/conf.d/named config to ensure they'll start before bind"
327 + einfo
328 + }
329 + einfo "If you'd like to run bind in a chroot AND this is a new"
330 + einfo "install OR your bind doesn't already run in a chroot:"
331 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
332 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
333 + einfo
334 +
335 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
336 + if [[ -n ${CHROOT} ]]; then
337 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
338 + elog "To enable the old behaviour (without using mount) uncomment the"
339 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
340 + elog "If you decide to use the new/default method, ensure to make backup"
341 + elog "first and merge your existing configs/zones to /etc/bind and"
342 + elog "/var/bind because bind will now mount the needed directories into"
343 + elog "the chroot dir."
344 + fi
345 +}
346 +
347 +pkg_config() {
348 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
349 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
350 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
351 +
352 + if [[ -z "${CHROOT}" ]]; then
353 + eerror "This config script is designed to automate setting up"
354 + eerror "a chrooted bind/named. To do so, please first uncomment"
355 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
356 + die "Unset CHROOT"
357 + fi
358 + if [[ -d "${CHROOT}" ]]; then
359 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
360 + ewarn "To enable the old behaviour (without using mount) uncomment the"
361 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
362 + ewarn
363 + ewarn "${CHROOT} already exists... some things might become overridden"
364 + ewarn "press CTRL+C if you don't want to continue"
365 + sleep 10
366 + fi
367 +
368 + echo; einfo "Setting up the chroot directory..."
369 +
370 + mkdir -m 0750 -p ${CHROOT} || die
371 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
372 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
373 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
374 +
375 + chown root:named \
376 + ${CHROOT} \
377 + ${CHROOT}/var/{bind,log/named} \
378 + ${CHROOT}/run/named/ \
379 + ${CHROOT}/etc/bind \
380 + || die
381 +
382 + mknod ${CHROOT}/dev/null c 1 3 || die
383 + chmod 0666 ${CHROOT}/dev/null || die
384 +
385 + mknod ${CHROOT}/dev/zero c 1 5 || die
386 + chmod 0666 ${CHROOT}/dev/zero || die
387 +
388 + mknod ${CHROOT}/dev/urandom c 1 9 || die
389 + chmod 0666 ${CHROOT}/dev/urandom || die
390 +
391 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
392 + cp -a /etc/bind ${CHROOT}/etc/ || die
393 + cp -a /var/bind ${CHROOT}/var/ || die
394 + fi
395 +
396 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
397 + if use geoip; then
398 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
399 + elif use geoip2; then
400 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
401 + fi
402 + fi
403 +
404 + elog "You may need to add the following line to your syslog-ng.conf:"
405 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
406 +}