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