Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/bind/
Date: Thu, 16 Sep 2021 17:31:37
Message-Id: 1631813295.9e3a302ee5214041304e34e17af55042b69ce023.zlogene@gentoo
1 commit: 9e3a302ee5214041304e34e17af55042b69ce023
2 Author: Mikhail Koliada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 16 17:28:15 2021 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 16 17:28:15 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e3a302e
7
8 net-dns/bind: Version bump (v9.16.21)
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.16.21.ebuild | 373 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 374 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index 3c4f1e6eb6b..a264eb599c7 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -1,3 +1,4 @@
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 dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
26
27 diff --git a/net-dns/bind/bind-9.16.21.ebuild b/net-dns/bind/bind-9.16.21.ebuild
28 new file mode 100644
29 index 00000000000..692748deccc
30 --- /dev/null
31 +++ b/net-dns/bind/bind-9.16.21.ebuild
32 @@ -0,0 +1,373 @@
33 +# Copyright 1999-2021 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=7
46 +
47 +PYTHON_COMPAT=( python3_{8..9} )
48 +
49 +inherit python-r1 autotools 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"
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 xml +zlib"
72 +# sdb-ldap - patch broken
73 +# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
74 +
75 +# Upstream dropped the old geoip library, but the BIND configuration for using
76 +# GeoIP remained the same.
77 +REQUIRED_USE="
78 + postgres? ( dlz )
79 + berkdb? ( dlz )
80 + mysql? ( dlz )
81 + odbc? ( dlz )
82 + ldap? ( dlz )
83 + dnsrps? ( dlz )
84 + python? ( ${PYTHON_REQUIRED_USE} )
85 +"
86 +
87 +DEPEND="
88 + acct-group/named
89 + acct-user/named
90 + berkdb? ( sys-libs/db:= )
91 + dev-libs/openssl:=[-bindist(-)]
92 + mysql? ( dev-db/mysql-connector-c:0= )
93 + odbc? ( >=dev-db/unixODBC-2.2.6 )
94 + ldap? ( net-nds/openldap )
95 + postgres? ( dev-db/postgresql:= )
96 + caps? ( >=sys-libs/libcap-2.1.0 )
97 + xml? ( dev-libs/libxml2 )
98 + geoip? ( dev-libs/libmaxminddb )
99 + geoip2? ( dev-libs/libmaxminddb )
100 + gssapi? ( virtual/krb5 )
101 + json? ( dev-libs/json-c:= )
102 + lmdb? ( dev-db/lmdb )
103 + zlib? ( sys-libs/zlib )
104 + dnstap? ( dev-libs/fstrm dev-libs/protobuf-c )
105 + python? (
106 + ${PYTHON_DEPS}
107 + dev-python/ply[${PYTHON_USEDEP}]
108 + )
109 + dev-libs/libuv:=
110 +"
111 +
112 +RDEPEND="${DEPEND}
113 + selinux? ( sec-policy/selinux-bind )
114 + sys-process/psmisc"
115 +
116 +S="${WORKDIR}/${MY_P}"
117 +
118 +PATCHES=(
119 + "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
120 +)
121 +
122 +# bug 479092, requires networking
123 +# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
124 +#RESTRICT="test"
125 +
126 +src_prepare() {
127 + default
128 +
129 + # should be installed by bind-tools
130 + sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
131 +
132 + # Disable tests for now, bug 406399
133 + sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
134 +
135 + # bug #220361
136 + rm aclocal.m4 || die
137 + rm -rf libtool.m4/ || die
138 + eautoreconf
139 +
140 + use python && python_copy_sources
141 +}
142 +
143 +src_configure() {
144 + bind_configure --without-python
145 + use python && python_foreach_impl python_configure
146 +}
147 +
148 +bind_configure() {
149 + local myeconfargs=(
150 + AR="$(type -P $(tc-getAR))"
151 + --prefix="${EPREFIX}"/usr
152 + --sysconfdir=/etc/bind
153 + --localstatedir=/var
154 + --with-libtool
155 + --enable-full-report
156 + --without-readline
157 + --with-openssl="${EPREFIX}"/usr
158 + --without-cmocka
159 + $(use_enable caps linux-caps)
160 + $(use_enable dnsrps)
161 + $(use_enable dnstap)
162 + $(use_enable fixed-rrset)
163 + # $(use_enable static-libs static)
164 + $(use_with berkdb dlz-bdb)
165 + $(use_with dlz dlopen)
166 + $(use_with dlz dlz-filesystem)
167 + $(use_with dlz dlz-stub)
168 + $(use_with gssapi)
169 + $(use_with json json-c)
170 + $(use_with ldap dlz-ldap)
171 + $(use_with mysql dlz-mysql)
172 + $(use_with odbc dlz-odbc)
173 + $(use_with postgres dlz-postgres)
174 + $(use_with lmdb)
175 + $(use_with xml libxml2)
176 + $(use_with zlib)
177 + "${@}"
178 + )
179 + # This is for users to start to migrate back to USE=geoip, rather than
180 + # USE=geoip2
181 + if use geoip ; then
182 + myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
183 + elif use geoip2 ; then
184 + # Added 2020/09/30
185 + # Remove USE=geoip2 support after 2020/03/01
186 + ewarn "USE=geoip2 is deprecated; update your USE flags!"
187 + myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
188 + else
189 + myeconfargs+=( --without-maxminddb --disable-geoip )
190 + fi
191 +
192 + # bug #158664
193 +# gcc-specs-ssp && replace-flags -O[23s] -O
194 +
195 + # To include db.h from proper path
196 + use berkdb && append-flags "-I$(db_includedir)"
197 +
198 + export BUILD_CC=$(tc-getBUILD_CC)
199 + econf "${myeconfargs[@]}"
200 +
201 + # bug #151839
202 + echo '#undef SO_BSDCOMPAT' >> config.h
203 +}
204 +
205 +python_configure() {
206 + pushd "${BUILD_DIR}" >/dev/null || die
207 + bind_configure --with-python
208 + popd >/dev/null || die
209 +}
210 +
211 +src_compile() {
212 + default
213 + use python && python_foreach_impl python_compile
214 +}
215 +
216 +python_compile() {
217 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
218 + emake
219 + popd >/dev/null || die
220 +}
221 +
222 +src_install() {
223 + default
224 +
225 + dodoc CHANGES README
226 +
227 + if use doc; then
228 + docinto misc
229 + dodoc -r doc/misc/
230 +
231 + # might a 'html' useflag make sense?
232 + docinto html
233 + dodoc -r doc/arm/
234 +
235 + docinto contrib
236 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
237 +
238 + # some handy-dandy dynamic dns examples
239 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
240 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
241 + popd 1>/dev/null || die
242 + fi
243 +
244 + insinto /etc/bind
245 + newins "${FILESDIR}"/named.conf-r8 named.conf
246 +
247 + # ftp://ftp.rs.internic.net/domain/named.cache:
248 + insinto /var/bind
249 + newins "${FILESDIR}"/named.cache-r3 named.cache
250 +
251 + insinto /var/bind/pri
252 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
253 +
254 + newinitd "${FILESDIR}"/named.init-r14 named
255 + newconfd "${FILESDIR}"/named.confd-r7 named
256 +
257 + newenvd "${FILESDIR}"/10bind.env 10bind
258 +
259 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
260 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
261 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
262 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
263 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
264 + for tool in dsfromkey importkey keyfromlabel keygen \
265 + revoke settime signzone verify; do
266 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
267 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
268 + done
269 +
270 + # bug 405251, library archives aren't properly handled by --enable/disable-static
271 + if ! use static-libs; then
272 + find "${ED}" -type f -name '*.a' -delete || die
273 + fi
274 +
275 + # bug 405251
276 + find "${ED}" -type f -name '*.la' -delete || die
277 +
278 + use python && python_foreach_impl python_install
279 +
280 + # bug 450406
281 + dosym named.cache /var/bind/root.cache
282 +
283 + dosym ../../var/bind/pri /etc/bind/pri
284 + dosym ../../var/bind/sec /etc/bind/sec
285 + dosym ../../var/bind/dyn /etc/bind/dyn
286 + keepdir /var/bind/{pri,sec,dyn} /var/log/named
287 +
288 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
289 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
290 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
291 + fperms 0750 /etc/bind /var/bind/pri
292 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
293 +
294 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
295 + dotmpfiles "${FILESDIR}"/named.conf
296 + exeinto /usr/libexec
297 + doexe "${FILESDIR}/generate-rndc-key.sh"
298 +}
299 +
300 +python_install() {
301 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
302 + emake DESTDIR="${D}" install
303 + python_scriptinto /usr/sbin
304 + python_doscript dnssec-{checkds,coverage}
305 + python_optimize
306 + popd >/dev/null || die
307 +}
308 +
309 +pkg_postinst() {
310 + tmpfiles_process named.conf
311 +
312 + if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
313 + einfo "Using /dev/urandom for generating rndc.key"
314 + /usr/sbin/rndc-confgen -a
315 + chown root:named /etc/bind/rndc.key || die
316 + chmod 0640 /etc/bind/rndc.key || die
317 + fi
318 +
319 + einfo
320 + einfo "You can edit /etc/conf.d/named to customize named settings"
321 + einfo
322 + use mysql || use postgres || use ldap && {
323 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
324 + elog "uncomment the specified rc_named_* lines in your"
325 + elog "/etc/conf.d/named config to ensure they'll start before bind"
326 + einfo
327 + }
328 + einfo "If you'd like to run bind in a chroot AND this is a new"
329 + einfo "install OR your bind doesn't already run in a chroot:"
330 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
331 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
332 + einfo
333 +
334 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
335 + if [[ -n ${CHROOT} ]]; then
336 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
337 + elog "To enable the old behaviour (without using mount) uncomment the"
338 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
339 + elog "If you decide to use the new/default method, ensure to make backup"
340 + elog "first and merge your existing configs/zones to /etc/bind and"
341 + elog "/var/bind because bind will now mount the needed directories into"
342 + elog "the chroot dir."
343 + fi
344 +}
345 +
346 +pkg_config() {
347 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
348 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
349 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
350 +
351 + if [[ -z "${CHROOT}" ]]; then
352 + eerror "This config script is designed to automate setting up"
353 + eerror "a chrooted bind/named. To do so, please first uncomment"
354 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
355 + die "Unset CHROOT"
356 + fi
357 + if [[ -d "${CHROOT}" ]]; then
358 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
359 + ewarn "To enable the old behaviour (without using mount) uncomment the"
360 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
361 + ewarn
362 + ewarn "${CHROOT} already exists... some things might become overridden"
363 + ewarn "press CTRL+C if you don't want to continue"
364 + sleep 10
365 + fi
366 +
367 + echo; einfo "Setting up the chroot directory..."
368 +
369 + mkdir -m 0750 -p ${CHROOT} || die
370 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
371 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
372 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
373 +
374 + chown root:named \
375 + ${CHROOT} \
376 + ${CHROOT}/var/{bind,log/named} \
377 + ${CHROOT}/run/named/ \
378 + ${CHROOT}/etc/bind \
379 + || die
380 +
381 + mknod ${CHROOT}/dev/null c 1 3 || die
382 + chmod 0666 ${CHROOT}/dev/null || die
383 +
384 + mknod ${CHROOT}/dev/zero c 1 5 || die
385 + chmod 0666 ${CHROOT}/dev/zero || die
386 +
387 + mknod ${CHROOT}/dev/urandom c 1 9 || die
388 + chmod 0666 ${CHROOT}/dev/urandom || die
389 +
390 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
391 + cp -a /etc/bind ${CHROOT}/etc/ || die
392 + cp -a /var/bind ${CHROOT}/var/ || die
393 + fi
394 +
395 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
396 + if use geoip; then
397 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
398 + elif use geoip2; then
399 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
400 + fi
401 + fi
402 +
403 + elog "You may need to add the following line to your syslog-ng.conf:"
404 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
405 +}