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: Fri, 31 Jul 2020 16:19:39
Message-Id: 1596212363.3c5dea5f4a7f67848b8d557622e7fc9290ba6fd5.zlogene@gentoo
1 commit: 3c5dea5f4a7f67848b8d557622e7fc9290ba6fd5
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 31 16:19:23 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 31 16:19:23 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c5dea5f
7
8 net-dns/bind: Version bump (v9.16.5)
9
10 Package-Manager: Portage-2.3.103, Repoman-2.3.23
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.16.5.ebuild | 351 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 352 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index 1cae5c453c6..32cf75dd555 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -1,3 +1,4 @@
22 DIST bind-9.14.12.tar.gz 6318913 BLAKE2B 38cad65923666afa5d83434c43a1b5577fe9555ca637489f780996a1b439955169c859c690f6fb96b003976eca482fe57c9226797cda5b124dc2073a90ef0515 SHA512 f4e6c50cbe8fdb44cdd8e30b4560b6fe2fccd0fd5bde527a897a66e85065265da0d0aceb95af42d5568dea95d59e68574e5a486bbb7e6c5d0af275538c353ddf
23 DIST bind-9.16.4.tar.xz 3465172 BLAKE2B 0787920793798ecc5d3197e1e51d41c14170f25608077af8275fd60502e2a6f5365670ca9e611a94a53517b6a0bd55cbb37ac37a4f01063fc409def4e34c39a8 SHA512 b1cf0607b0d7569ea594e02848eed601b8faf31c527fc17d379cfff3cd45c0c8b849364af0312e9b65bc14875aad87de379281603c150a07bf021ec740e92860
24 +DIST bind-9.16.5.tar.xz 3474044 BLAKE2B 6908ba2d86049bc684b4876d09fe799313f0f44cc1f2ed89f0143523b9fd2a863fd8791b650f7001a5be14acde9306b70dee8c0d25b3d0676aea1a4d2878958f SHA512 789fc19f60e81f67ef13ebacd030ea5d8f8cc42cf5f06a01ee2eefe9b7c6d3b10603a3a6a3df85b0e5d770fcf462ce8dddc3a7e5f7f2dab27aa5879ee5380eb7
25 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
26
27 diff --git a/net-dns/bind/bind-9.16.5.ebuild b/net-dns/bind/bind-9.16.5.ebuild
28 new file mode 100644
29 index 00000000000..0d9ea65c7da
30 --- /dev/null
31 +++ b/net-dns/bind/bind-9.16.5.ebuild
32 @@ -0,0 +1,351 @@
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_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 +
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 +REQUIRED_USE="
77 + ?? ( geoip geoip2 )
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 +DEPEND="!libressl? ( dev-libs/openssl:=[-bindist] )
87 + libressl? ( dev-libs/libressl:= )
88 + mysql? ( dev-db/mysql-connector-c:0= )
89 + odbc? ( >=dev-db/unixODBC-2.2.6 )
90 + ldap? ( net-nds/openldap )
91 + postgres? ( dev-db/postgresql:= )
92 + caps? ( >=sys-libs/libcap-2.1.0 )
93 + xml? ( dev-libs/libxml2 )
94 + geoip? ( >=dev-libs/geoip-1.4.6 )
95 + geoip2? ( dev-libs/libmaxminddb )
96 + gssapi? ( virtual/krb5 )
97 + json? ( dev-libs/json-c:= )
98 + lmdb? ( dev-db/lmdb )
99 + zlib? ( sys-libs/zlib )
100 + dnstap? ( dev-libs/fstrm dev-libs/protobuf-c )
101 + python? (
102 + ${PYTHON_DEPS}
103 + dev-python/ply[${PYTHON_USEDEP}]
104 + )
105 + dev-libs/libuv:="
106 +
107 +RDEPEND="${DEPEND}
108 + selinux? ( sec-policy/selinux-bind )
109 + sys-process/psmisc"
110 +
111 +S="${WORKDIR}/${MY_P}"
112 +
113 +# bug 479092, requires networking
114 +# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
115 +RESTRICT="test"
116 +
117 +pkg_setup() {
118 + ebegin "Creating named group and user"
119 + enewgroup named 40
120 + enewuser named 40 -1 /etc/bind named
121 + eend ${?}
122 +}
123 +
124 +src_prepare() {
125 + default
126 +
127 + export LDFLAGS="${LDFLAGS} -L${EPREFIX}/usr/$(get_libdir) -ldl"
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 +
141 +src_configure() {
142 + local myeconfargs=(
143 + AR="$(type -P $(tc-getAR))"
144 + --prefix="${EPREFIX}"/usr
145 + --sysconfdir=/etc/bind
146 + --localstatedir=/var
147 + --with-libtool
148 + --enable-full-report
149 + --without-readline
150 + --with-openssl="${EPREFIX}"/usr
151 + --without-cmocka
152 + $(use_enable caps linux-caps)
153 + $(use_enable dnsrps)
154 + $(use_enable dnstap)
155 + $(use_enable fixed-rrset)
156 + # $(use_enable static-libs static)
157 + $(use_with berkdb dlz-bdb)
158 + $(use_with dlz dlopen)
159 + $(use_with dlz dlz-filesystem)
160 + $(use_with dlz dlz-stub)
161 + $(use_with gssapi)
162 + $(use_with json json-c)
163 + $(use_with ldap dlz-ldap)
164 + $(use_with mysql dlz-mysql)
165 + $(use_with odbc dlz-odbc)
166 + $(use_with postgres dlz-postgres)
167 + $(use_with lmdb)
168 + $(use_with python)
169 + $(use_with xml libxml2)
170 + $(use_with zlib)
171 + )
172 +
173 + use geoip && myeconfargs+=( --enable-geoip )
174 + use geoip2 && myeconfargs+=( --with-maxminddb )
175 +
176 + # bug #158664
177 +# gcc-specs-ssp && replace-flags -O[23s] -O
178 +
179 + # To include db.h from proper path
180 + use berkdb && append-flags "-I$(db_includedir)"
181 +
182 + export BUILD_CC=$(tc-getBUILD_CC)
183 + econf "${myeconfargs[@]}"
184 +
185 + # bug #151839
186 + echo '#undef SO_BSDCOMPAT' >> config.h
187 +}
188 +
189 +src_install() {
190 + default
191 +
192 + dodoc CHANGES README
193 +
194 + if use doc; then
195 + docinto misc
196 + dodoc -r doc/misc/
197 +
198 + # might a 'html' useflag make sense?
199 + docinto html
200 + dodoc -r doc/arm/
201 +
202 + docinto contrib
203 + dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
204 +
205 + # some handy-dandy dynamic dns examples
206 + pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
207 + tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
208 + popd 1>/dev/null || die
209 + fi
210 +
211 + insinto /etc/bind
212 + newins "${FILESDIR}"/named.conf-r8 named.conf
213 +
214 + # ftp://ftp.rs.internic.net/domain/named.cache:
215 + insinto /var/bind
216 + newins "${FILESDIR}"/named.cache-r3 named.cache
217 +
218 + insinto /var/bind/pri
219 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
220 +
221 + newinitd "${FILESDIR}"/named.init-r13 named
222 + newconfd "${FILESDIR}"/named.confd-r7 named
223 +
224 + newenvd "${FILESDIR}"/10bind.env 10bind
225 +
226 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
227 + rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
228 + rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
229 + rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
230 + rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
231 + for tool in dsfromkey importkey keyfromlabel keygen \
232 + revoke settime signzone verify; do
233 + rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
234 + rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
235 + done
236 +
237 + # bug 405251, library archives aren't properly handled by --enable/disable-static
238 + if ! use static-libs; then
239 + find "${ED}" -type f -name '*.a' -delete || die
240 + fi
241 +
242 + # bug 405251
243 + find "${ED}" -type f -name '*.la' -delete || die
244 +
245 + if use python; then
246 + install_python_tools() {
247 + dosbin bin/python/dnssec-{checkds,coverage}
248 + }
249 + python_foreach_impl install_python_tools
250 +
251 + python_replicate_script "${ED}/usr/sbin/dnssec-checkds"
252 + python_replicate_script "${ED}/usr/sbin/dnssec-coverage"
253 + fi
254 +
255 + # bug 450406
256 + dosym named.cache /var/bind/root.cache
257 +
258 + dosym ../../var/bind/pri /etc/bind/pri
259 + dosym ../../var/bind/sec /etc/bind/sec
260 + dosym ../../var/bind/dyn /etc/bind/dyn
261 + keepdir /var/bind/{pri,sec,dyn}
262 +
263 + dodir /var/log/named
264 +
265 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
266 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
267 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
268 + fperms 0750 /etc/bind /var/bind/pri
269 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
270 +
271 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
272 + systemd_dotmpfilesd "${FILESDIR}"/named.conf
273 + exeinto /usr/libexec
274 + doexe "${FILESDIR}/generate-rndc-key.sh"
275 +}
276 +
277 +pkg_postinst() {
278 + if [ ! -f '/etc/bind/rndc.key' ]; then
279 + if use urandom; then
280 + einfo "Using /dev/urandom for generating rndc.key"
281 + /usr/sbin/rndc-confgen -r /dev/urandom -a
282 + echo
283 + else
284 + einfo "Using /dev/random for generating rndc.key"
285 + /usr/sbin/rndc-confgen -a
286 + echo
287 + fi
288 + chown root:named /etc/bind/rndc.key || die
289 + chmod 0640 /etc/bind/rndc.key || die
290 + fi
291 +
292 + einfo
293 + einfo "You can edit /etc/conf.d/named to customize named settings"
294 + einfo
295 + use mysql || use postgres || use ldap && {
296 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
297 + elog "uncomment the specified rc_named_* lines in your"
298 + elog "/etc/conf.d/named config to ensure they'll start before bind"
299 + einfo
300 + }
301 + einfo "If you'd like to run bind in a chroot AND this is a new"
302 + einfo "install OR your bind doesn't already run in a chroot:"
303 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
304 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
305 + einfo
306 +
307 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
308 + if [[ -n ${CHROOT} ]]; then
309 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
310 + elog "To enable the old behaviour (without using mount) uncomment the"
311 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
312 + elog "If you decide to use the new/default method, ensure to make backup"
313 + elog "first and merge your existing configs/zones to /etc/bind and"
314 + elog "/var/bind because bind will now mount the needed directories into"
315 + elog "the chroot dir."
316 + fi
317 +}
318 +
319 +pkg_config() {
320 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
321 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
322 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
323 +
324 + if [[ -z "${CHROOT}" ]]; then
325 + eerror "This config script is designed to automate setting up"
326 + eerror "a chrooted bind/named. To do so, please first uncomment"
327 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
328 + die "Unset CHROOT"
329 + fi
330 + if [[ -d "${CHROOT}" ]]; then
331 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
332 + ewarn "To enable the old behaviour (without using mount) uncomment the"
333 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
334 + ewarn
335 + ewarn "${CHROOT} already exists... some things might become overridden"
336 + ewarn "press CTRL+C if you don't want to continue"
337 + sleep 10
338 + fi
339 +
340 + echo; einfo "Setting up the chroot directory..."
341 +
342 + mkdir -m 0750 -p ${CHROOT} || die
343 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
344 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
345 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
346 +
347 + chown root:named \
348 + ${CHROOT} \
349 + ${CHROOT}/var/{bind,log/named} \
350 + ${CHROOT}/run/named/ \
351 + ${CHROOT}/etc/bind \
352 + || die
353 +
354 + mknod ${CHROOT}/dev/null c 1 3 || die
355 + chmod 0666 ${CHROOT}/dev/null || die
356 +
357 + mknod ${CHROOT}/dev/zero c 1 5 || die
358 + chmod 0666 ${CHROOT}/dev/zero || die
359 +
360 + if use urandom; then
361 + mknod ${CHROOT}/dev/urandom c 1 9 || die
362 + chmod 0666 ${CHROOT}/dev/urandom || die
363 + else
364 + mknod ${CHROOT}/dev/random c 1 8 || die
365 + chmod 0666 ${CHROOT}/dev/random || die
366 + fi
367 +
368 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
369 + cp -a /etc/bind ${CHROOT}/etc/ || die
370 + cp -a /var/bind ${CHROOT}/var/ || die
371 + fi
372 +
373 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
374 + if use geoip; then
375 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
376 + elif use geoip2; then
377 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
378 + fi
379 + fi
380 +
381 + elog "You may need to add the following line to your syslog-ng.conf:"
382 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
383 +}