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, 29 Oct 2020 19:44:59
Message-Id: 1604000696.70604a985724e337603ab86c80d5a87660423910.zlogene@gentoo
1 commit: 70604a985724e337603ab86c80d5a87660423910
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 29 19:35:01 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 29 19:44:56 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70604a98
7
8 net-dns/bind: Version bump (v9.16.8)
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.2
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.16.8.ebuild | 389 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 390 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index 972f732ee00..4dc25490144 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -1,3 +1,4 @@
22 DIST bind-9.16.6.tar.xz 3228368 BLAKE2B 0c2265fe0e006679733a4f7610b0c33bb8e2bd32caf26dca8cfedbea0e08df9e7665cbbbf5321199bd2e30b97ad5b0146ae4e8a9a78abadbe6d067bbd1ad8a3a SHA512 37f57db6d1633cc85a4d954a69bbb3372c65ac43fef965df5aee8dcdd32153bb5b0c6d0d5f00f353dd4464c71d74dc8e801937b930e2b8f6799fa77af5f243e0
23 DIST bind-9.16.7.tar.xz 3241476 BLAKE2B ed11be4cb11cf0b77dfefd4284bdbe2d0e8dfd4c8b46e2966f3f0afc60a5df2ff3545a10209ede65f55f7d5dab3ed10945b98908c1b6bf35723c89c6d940a001 SHA512 176c84657e8a7b10a7ca93c939ca6a7fcdefb22f9200c3f01be59bcd8990dee27b8dc0970299225bcbe0f1aa8f49a67c80c4a9853895ffbcd685adb9674e7768
24 +DIST bind-9.16.8.tar.xz 3253744 BLAKE2B 013c61d7298f334aae0165fa0ddaf4eb8fc22021b161f3a53843b4860456c133f1f33316387fcf2d7267a992844de44467eaec70c8064c77f9baef00f37fb98f SHA512 803af842b4f83c16556036f3a2a52b4aeab4781bafb35385b786a3331cf17ef6148c23928f6903fd371337ba92870d7a8548f5d178b805d160d0af34af45fee7
25 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
26
27 diff --git a/net-dns/bind/bind-9.16.8.ebuild b/net-dns/bind/bind-9.16.8.ebuild
28 new file mode 100644
29 index 00000000000..3ee669a35b7
30 --- /dev/null
31 +++ b/net-dns/bind/bind-9.16.8.ebuild
32 @@ -0,0 +1,389 @@
33 +# Copyright 1999-2020 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_{6..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 ~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 libressl lmdb mysql odbc postgres python selinux static-libs
72 +urandom 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 + !libressl? ( dev-libs/openssl:=[-bindist] )
92 + libressl? ( dev-libs/libressl:= )
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 + # don't create /var/run
227 + rmdir "${ED}"/var/run || die
228 +
229 + dodoc CHANGES README
230 +
231 + if use doc; then
232 + docinto misc
233 + dodoc -r doc/misc/
234 +
235 + # might a 'html' useflag make sense?
236 + docinto html
237 + dodoc -r doc/arm/
238 +
239 + docinto contrib
240 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
241 +
242 + # some handy-dandy dynamic dns examples
243 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
244 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
245 + popd 1>/dev/null || die
246 + fi
247 +
248 + insinto /etc/bind
249 + newins "${FILESDIR}"/named.conf-r8 named.conf
250 +
251 + # ftp://ftp.rs.internic.net/domain/named.cache:
252 + insinto /var/bind
253 + newins "${FILESDIR}"/named.cache-r3 named.cache
254 +
255 + insinto /var/bind/pri
256 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
257 +
258 + newinitd "${FILESDIR}"/named.init-r13 named
259 + newconfd "${FILESDIR}"/named.confd-r7 named
260 +
261 + newenvd "${FILESDIR}"/10bind.env 10bind
262 +
263 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
264 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
265 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
266 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
267 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
268 + for tool in dsfromkey importkey keyfromlabel keygen \
269 + revoke settime signzone verify; do
270 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
271 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
272 + done
273 +
274 + # bug 405251, library archives aren't properly handled by --enable/disable-static
275 + if ! use static-libs; then
276 + find "${ED}" -type f -name '*.a' -delete || die
277 + fi
278 +
279 + # bug 405251
280 + find "${ED}" -type f -name '*.la' -delete || die
281 +
282 + use python && python_foreach_impl python_install
283 +
284 + # bug 450406
285 + dosym named.cache /var/bind/root.cache
286 +
287 + dosym ../../var/bind/pri /etc/bind/pri
288 + dosym ../../var/bind/sec /etc/bind/sec
289 + dosym ../../var/bind/dyn /etc/bind/dyn
290 + keepdir /var/bind/{pri,sec,dyn} /var/log/named
291 +
292 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
293 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
294 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
295 + fperms 0750 /etc/bind /var/bind/pri
296 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
297 +
298 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
299 + dotmpfiles "${FILESDIR}"/named.conf
300 + exeinto /usr/libexec
301 + doexe "${FILESDIR}/generate-rndc-key.sh"
302 +
303 + tmpfiles_process
304 +}
305 +
306 +python_install() {
307 + pushd "${BUILD_DIR}"/bin/python >/dev/null || die
308 + emake DESTDIR="${D}" install
309 + python_scriptinto /usr/sbin
310 + python_doscript dnssec-{checkds,coverage}
311 + python_optimize
312 + popd >/dev/null || die
313 +}
314 +
315 +pkg_postinst() {
316 + if [ ! -f '/etc/bind/rndc.key' ]; then
317 + if use urandom; then
318 + einfo "Using /dev/urandom for generating rndc.key"
319 + /usr/sbin/rndc-confgen -r /dev/urandom -a
320 + echo
321 + else
322 + einfo "Using /dev/random for generating rndc.key"
323 + /usr/sbin/rndc-confgen -a
324 + echo
325 + fi
326 + chown root:named /etc/bind/rndc.key || die
327 + chmod 0640 /etc/bind/rndc.key || die
328 + fi
329 +
330 + einfo
331 + einfo "You can edit /etc/conf.d/named to customize named settings"
332 + einfo
333 + use mysql || use postgres || use ldap && {
334 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
335 + elog "uncomment the specified rc_named_* lines in your"
336 + elog "/etc/conf.d/named config to ensure they'll start before bind"
337 + einfo
338 + }
339 + einfo "If you'd like to run bind in a chroot AND this is a new"
340 + einfo "install OR your bind doesn't already run in a chroot:"
341 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
342 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
343 + einfo
344 +
345 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
346 + if [[ -n ${CHROOT} ]]; then
347 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
348 + elog "To enable the old behaviour (without using mount) uncomment the"
349 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
350 + elog "If you decide to use the new/default method, ensure to make backup"
351 + elog "first and merge your existing configs/zones to /etc/bind and"
352 + elog "/var/bind because bind will now mount the needed directories into"
353 + elog "the chroot dir."
354 + fi
355 +}
356 +
357 +pkg_config() {
358 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
359 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
360 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
361 +
362 + if [[ -z "${CHROOT}" ]]; then
363 + eerror "This config script is designed to automate setting up"
364 + eerror "a chrooted bind/named. To do so, please first uncomment"
365 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
366 + die "Unset CHROOT"
367 + fi
368 + if [[ -d "${CHROOT}" ]]; then
369 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
370 + ewarn "To enable the old behaviour (without using mount) uncomment the"
371 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
372 + ewarn
373 + ewarn "${CHROOT} already exists... some things might become overridden"
374 + ewarn "press CTRL+C if you don't want to continue"
375 + sleep 10
376 + fi
377 +
378 + echo; einfo "Setting up the chroot directory..."
379 +
380 + mkdir -m 0750 -p ${CHROOT} || die
381 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
382 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
383 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
384 +
385 + chown root:named \
386 + ${CHROOT} \
387 + ${CHROOT}/var/{bind,log/named} \
388 + ${CHROOT}/run/named/ \
389 + ${CHROOT}/etc/bind \
390 + || die
391 +
392 + mknod ${CHROOT}/dev/null c 1 3 || die
393 + chmod 0666 ${CHROOT}/dev/null || die
394 +
395 + mknod ${CHROOT}/dev/zero c 1 5 || die
396 + chmod 0666 ${CHROOT}/dev/zero || die
397 +
398 + if use urandom; then
399 + mknod ${CHROOT}/dev/urandom c 1 9 || die
400 + chmod 0666 ${CHROOT}/dev/urandom || die
401 + else
402 + mknod ${CHROOT}/dev/random c 1 8 || die
403 + chmod 0666 ${CHROOT}/dev/random || die
404 + fi
405 +
406 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
407 + cp -a /etc/bind ${CHROOT}/etc/ || die
408 + cp -a /var/bind ${CHROOT}/var/ || die
409 + fi
410 +
411 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
412 + if use geoip; then
413 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
414 + elif use geoip2; then
415 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
416 + fi
417 + fi
418 +
419 + elog "You may need to add the following line to your syslog-ng.conf:"
420 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
421 +}