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: Sun, 23 Feb 2020 12:46:32
Message-Id: 1582461986.ea85309a0f78d33b1c27cf803176955586587196.zlogene@gentoo
1 commit: ea85309a0f78d33b1c27cf803176955586587196
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 23 12:46:08 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 23 12:46:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea85309a
7
8 net-dns/bind: Version bump (v9.16.0)
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.16.0.ebuild | 375 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 376 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index 81315410ebc..95ff4811282 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -1,3 +1,4 @@
22 DIST bind-9.14.8.tar.gz 6403140 BLAKE2B 45cb06ce8564880d501c63d25c7af8567184e4e4293e01886620cf655449c972ab55c77c7aded07838c61557bc56d9edac26097715c1121fcfb6b606d7a29365 SHA512 eb52760982ebd246e6e1945684771193fc7364324a6d6a95a0cae33afa0a4fa24ffe8313b5f9094420c7c2ec932b1b1a9fb19f6e673ff3c5583ab5e3ff04eb6a
23 DIST bind-9.14.9.tar.gz 6296339 BLAKE2B 65496ab94a83ddd1c519df4519373aa77858c6d66efed9342e962cd61943b12e9ecb2f74132015b3f835d0368d1cc59be23e0db92d4780f9f367c0d0fe8c3ada SHA512 aa6b1273f06fc16c842b7012a4d09cb65325a44ee88fea8bea8264ffa907ef4a6f8d5e09384599b2d6f5cea66c0dc220765c245814f54b2f09a5b6e65f97964b
24 +DIST bind-9.16.0.tar.xz 4533976 BLAKE2B f9892258a10a2423b4b26ae78927109c03ca39440f1d93d5d29369b666ef2ad8a8be72079f78a8b464f1e897b4d6c6511de280bba3f4e98fdf9604e9d1366c78 SHA512 6f836fe4cb12d3e2e3a871f69e5b249b2bae6ae1dc542395c79cc974ca95aa595e963b6716a38f6c9d5cb3c54ec606fcd932412a6fbe596651123ac1379dd010
25 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
26
27 diff --git a/net-dns/bind/bind-9.16.0.ebuild b/net-dns/bind/bind-9.16.0.ebuild
28 new file mode 100644
29 index 00000000000..323f6fe4642
30 --- /dev/null
31 +++ b/net-dns/bind/bind-9.16.0.ebuild
32 @@ -0,0 +1,375 @@
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,7} )
48 +
49 +inherit python-r1 eutils autotools toolchain-funcs flag-o-matic multilib db-use user systemd
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 +# sdb-ldap? (
66 +# http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2
67 +# )"
68 +
69 +LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
70 +SLOT="0"
71 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
72 +# -berkdb by default re bug 602682
73 +IUSE="-berkdb +caps dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
74 +json ldap libressl lmdb mysql odbc postgres python selinux static-libs
75 +urandom xml +zlib"
76 +# sdb-ldap - patch broken
77 +# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
78 +
79 +REQUIRED_USE="
80 + ?? ( geoip geoip2 )
81 + postgres? ( dlz )
82 + berkdb? ( dlz )
83 + mysql? ( dlz )
84 + odbc? ( dlz )
85 + ldap? ( dlz )
86 + dnsrps? ( dlz )
87 + python? ( ${PYTHON_REQUIRED_USE} )"
88 +# sdb-ldap? ( dlz )
89 +
90 +DEPEND="!libressl? ( dev-libs/openssl:=[-bindist] )
91 + libressl? ( dev-libs/libressl:= )
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/geoip-1.4.6 )
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 +# sdb-ldap? ( net-nds/openldap )
110 +
111 +RDEPEND="${DEPEND}
112 + selinux? ( sec-policy/selinux-bind )
113 + sys-process/psmisc"
114 +
115 +S="${WORKDIR}/${MY_P}"
116 +
117 +# bug 479092, requires networking
118 +RESTRICT="test"
119 +
120 +pkg_setup() {
121 + ebegin "Creating named group and user"
122 + enewgroup named 40
123 + enewuser named 40 -1 /etc/bind named
124 + eend ${?}
125 +}
126 +
127 +src_prepare() {
128 + default
129 +
130 + export LDFLAGS="${LDFLAGS} -L${EPREFIX}/usr/$(get_libdir) -ldl"
131 +
132 + # Adjusting PATHs in manpages
133 + for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
134 + sed -i \
135 + -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
136 + -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
137 + -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
138 + "${i}" || die "sed failed, ${i} doesn't exist"
139 + done
140 +
141 +# if use dlz; then
142 +# # sdb-ldap patch as per bug #160567
143 +# # Upstream URL: http://bind9-ldap.bayour.com/
144 +# # New patch take from bug 302735
145 +# if use sdb-ldap; then
146 +# epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
147 +# cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
148 +# cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
149 +# cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
150 +# fi
151 +# fi
152 +
153 + # should be installed by bind-tools
154 + sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
155 +
156 + # Disable tests for now, bug 406399
157 + sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
158 +
159 + # bug #220361
160 + rm aclocal.m4 || die
161 + rm -rf libtool.m4/ || die
162 + eautoreconf
163 +}
164 +
165 +src_configure() {
166 + local myeconfargs=(
167 + --prefix="${EPREFIX}"/usr
168 + --sysconfdir=/etc/bind
169 + --localstatedir=/var
170 + --with-libtool
171 + --enable-full-report
172 + --without-readline
173 + --with-openssl="${EPREFIX}"/usr
174 + $(use_enable caps linux-caps)
175 + $(use_enable dnsrps)
176 + $(use_enable dnstap)
177 + $(use_enable fixed-rrset)
178 + # $(use_enable static-libs static)
179 + $(use_with berkdb dlz-bdb)
180 + $(use_with dlz dlopen)
181 + $(use_with dlz dlz-filesystem)
182 + $(use_with dlz dlz-stub)
183 + $(use_with gssapi)
184 + $(use_with json json-c)
185 + $(use_with ldap dlz-ldap)
186 + $(use_with mysql dlz-mysql)
187 + $(use_with odbc dlz-odbc)
188 + $(use_with postgres dlz-postgres)
189 + $(use_with lmdb)
190 + $(use_with python)
191 + $(use_with xml libxml2)
192 + $(use_with zlib)
193 + )
194 +
195 + use geoip && myeconfargs+=( --with-geoip )
196 + use geoip2 && myeconfargs+=( --with-geoip2 )
197 +
198 + # bug #158664
199 +# gcc-specs-ssp && replace-flags -O[23s] -O
200 +
201 + # To include db.h from proper path
202 + use berkdb && append-flags "-I$(db_includedir)"
203 +
204 + export BUILD_CC=$(tc-getBUILD_CC)
205 + econf "${myeconfargs[@]}"
206 +
207 + # bug #151839
208 + echo '#undef SO_BSDCOMPAT' >> config.h
209 +}
210 +
211 +src_install() {
212 + default
213 +
214 + dodoc CHANGES README
215 +
216 + if use doc; then
217 + dodoc doc/arm/Bv9ARM.pdf
218 +
219 + docinto misc
220 + dodoc -r doc/misc/
221 +
222 + # might a 'html' useflag make sense?
223 + docinto html
224 + dodoc -r doc/arm/
225 +
226 + docinto contrib
227 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
228 +
229 + # some handy-dandy dynamic dns examples
230 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
231 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
232 + popd 1>/dev/null || die
233 + fi
234 +
235 + insinto /etc/bind
236 + newins "${FILESDIR}"/named.conf-r8 named.conf
237 +
238 + # ftp://ftp.rs.internic.net/domain/named.cache:
239 + insinto /var/bind
240 + newins "${FILESDIR}"/named.cache-r3 named.cache
241 +
242 + insinto /var/bind/pri
243 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
244 +
245 + newinitd "${FILESDIR}"/named.init-r13 named
246 + newconfd "${FILESDIR}"/named.confd-r7 named
247 +
248 + newenvd "${FILESDIR}"/10bind.env 10bind
249 +
250 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
251 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup}.1* || die
252 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
253 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
254 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
255 + for tool in dsfromkey importkey keyfromlabel keygen \
256 + revoke settime signzone verify; do
257 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
258 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
259 + done
260 +
261 + # bug 405251, library archives aren't properly handled by --enable/disable-static
262 + if ! use static-libs; then
263 + find "${ED}" -type f -name '*.a' -delete || die
264 + fi
265 +
266 + # bug 405251
267 + find "${ED}" -type f -name '*.la' -delete || die
268 +
269 + if use python; then
270 + install_python_tools() {
271 + dosbin bin/python/dnssec-{checkds,coverage}
272 + }
273 + python_foreach_impl install_python_tools
274 +
275 + python_replicate_script "${ED}/usr/sbin/dnssec-checkds"
276 + python_replicate_script "${ED}/usr/sbin/dnssec-coverage"
277 + fi
278 +
279 + # bug 450406
280 + dosym named.cache /var/bind/root.cache
281 +
282 + dosym ../../var/bind/pri /etc/bind/pri
283 + dosym ../../var/bind/sec /etc/bind/sec
284 + dosym ../../var/bind/dyn /etc/bind/dyn
285 + keepdir /var/bind/{pri,sec,dyn}
286 +
287 + dodir /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 + systemd_dotmpfilesd "${FILESDIR}"/named.conf
297 + exeinto /usr/libexec
298 + doexe "${FILESDIR}/generate-rndc-key.sh"
299 +}
300 +
301 +pkg_postinst() {
302 + if [ ! -f '/etc/bind/rndc.key' ]; then
303 + if use urandom; then
304 + einfo "Using /dev/urandom for generating rndc.key"
305 + /usr/sbin/rndc-confgen -r /dev/urandom -a
306 + echo
307 + else
308 + einfo "Using /dev/random for generating rndc.key"
309 + /usr/sbin/rndc-confgen -a
310 + echo
311 + fi
312 + chown root:named /etc/bind/rndc.key || die
313 + chmod 0640 /etc/bind/rndc.key || die
314 + fi
315 +
316 + einfo
317 + einfo "You can edit /etc/conf.d/named to customize named settings"
318 + einfo
319 + use mysql || use postgres || use ldap && {
320 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
321 + elog "uncomment the specified rc_named_* lines in your"
322 + elog "/etc/conf.d/named config to ensure they'll start before bind"
323 + einfo
324 + }
325 + einfo "If you'd like to run bind in a chroot AND this is a new"
326 + einfo "install OR your bind doesn't already run in a chroot:"
327 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
328 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
329 + einfo
330 +
331 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
332 + if [[ -n ${CHROOT} ]]; then
333 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
334 + elog "To enable the old behaviour (without using mount) uncomment the"
335 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
336 + elog "If you decide to use the new/default method, ensure to make backup"
337 + elog "first and merge your existing configs/zones to /etc/bind and"
338 + elog "/var/bind because bind will now mount the needed directories into"
339 + elog "the chroot dir."
340 + fi
341 +}
342 +
343 +pkg_config() {
344 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
345 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
346 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
347 +
348 + if [[ -z "${CHROOT}" ]]; then
349 + eerror "This config script is designed to automate setting up"
350 + eerror "a chrooted bind/named. To do so, please first uncomment"
351 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
352 + die "Unset CHROOT"
353 + fi
354 + if [[ -d "${CHROOT}" ]]; then
355 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
356 + ewarn "To enable the old behaviour (without using mount) uncomment the"
357 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
358 + ewarn
359 + ewarn "${CHROOT} already exists... some things might become overridden"
360 + ewarn "press CTRL+C if you don't want to continue"
361 + sleep 10
362 + fi
363 +
364 + echo; einfo "Setting up the chroot directory..."
365 +
366 + mkdir -m 0750 -p ${CHROOT} || die
367 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
368 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
369 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
370 +
371 + chown root:named \
372 + ${CHROOT} \
373 + ${CHROOT}/var/{bind,log/named} \
374 + ${CHROOT}/run/named/ \
375 + ${CHROOT}/etc/bind \
376 + || die
377 +
378 + mknod ${CHROOT}/dev/null c 1 3 || die
379 + chmod 0666 ${CHROOT}/dev/null || die
380 +
381 + mknod ${CHROOT}/dev/zero c 1 5 || die
382 + chmod 0666 ${CHROOT}/dev/zero || die
383 +
384 + if use urandom; then
385 + mknod ${CHROOT}/dev/urandom c 1 9 || die
386 + chmod 0666 ${CHROOT}/dev/urandom || die
387 + else
388 + mknod ${CHROOT}/dev/random c 1 8 || die
389 + chmod 0666 ${CHROOT}/dev/random || die
390 + fi
391 +
392 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
393 + cp -a /etc/bind ${CHROOT}/etc/ || die
394 + cp -a /var/bind ${CHROOT}/var/ || die
395 + fi
396 +
397 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
398 + if use geoip; then
399 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
400 + elif use geoip2; then
401 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
402 + fi
403 + fi
404 +
405 + elog "You may need to add the following line to your syslog-ng.conf:"
406 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
407 +}