Gentoo Archives: gentoo-commits

From: John Helmert III <ajak@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/bind/, net-dns/bind/files/
Date: Mon, 31 Oct 2022 01:21:37
Message-Id: 1667179211.8bdc575dae63f16d44b926f18271d15d3173fc5f.ajak@gentoo
1 commit: 8bdc575dae63f16d44b926f18271d15d3173fc5f
2 Author: John Helmert III <ajak <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 31 01:19:33 2022 +0000
4 Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 01:20:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bdc575d
7
8 net-dns/bind: security cleanup
9
10 Bug: https://bugs.gentoo.org/820563
11 Bug: https://bugs.gentoo.org/835439
12 Bug: https://bugs.gentoo.org/872206
13 Acked-by: Patrick McLean <chutzpah <AT> gentoo.org>
14 Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
15
16 net-dns/bind/Manifest | 5 -
17 net-dns/bind/bind-9.16.27-r1.ebuild | 375 --------------------
18 net-dns/bind/bind-9.16.29-r1.ebuild | 376 --------------------
19 net-dns/bind/bind-9.16.29.ebuild | 375 --------------------
20 net-dns/bind/bind-9.16.30.ebuild | 381 --------------------
21 net-dns/bind/bind-9.16.31.ebuild | 382 ---------------------
22 net-dns/bind/bind-9.16.32.ebuild | 382 ---------------------
23 .../bind/files/bind-9.16.29-fortify-source-3.patch | 35 --
24 8 files changed, 2311 deletions(-)
25
26 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
27 index e59b6e5dfe71..487c2e679e07 100644
28 --- a/net-dns/bind/Manifest
29 +++ b/net-dns/bind/Manifest
30 @@ -1,7 +1,2 @@
31 -DIST bind-9.16.27.tar.xz 5084340 BLAKE2B 37b49ce81aa5122493a4feb2bb7be53c5d46ff2ce28456aec31ce1332520a09c10bb2293c736bffe7badbc2bc3d156c05f83367678bd101e17b99ca3ff69bebf SHA512 5c71f228db83aa8cc9e65466d6e5afca4a9f80c693358111a003fe09e1a14522175eb2b6a0f11e2a2cd4fdba01f2ae315de52e394a441b3861ca2a011e02af62
32 -DIST bind-9.16.29.tar.xz 5088348 BLAKE2B 17ee1443926327c30f1d5820110b01a193c53eb24e23385b713217a4e49d9c2b5ddb6e1c49cb80d2c9083c71ce7872a26fe3597209f2e3215e6cc7e930e68004 SHA512 b4acbafed370438ac53e73468ccb5ea5745a1c8f764dd96f9c9a027594a3b7ce0d486e7f01138b39795b456265e0e6116cd76e44f5a3329687cd718550ca79fb
33 -DIST bind-9.16.30.tar.xz 5086288 BLAKE2B 35fe14b58a018df25563e58a9632b4431f740bc7a708eb823117541548d23b1855e43058cf7323361ca904d5e59d687e282abb73dc8b617e4eb25ef113168e93 SHA512 cc9bcbedf63c2efe0a23f14db3e57fdae46f0509aac58e5840a6805ce4fbd76cad5bfde4d461442adb88c4d947f8d79bf979aeb24aeb9303b6adc8d169b7118c
34 -DIST bind-9.16.31.tar.xz 5087424 BLAKE2B 75c9038c00fe289161a15a8e4fdadaef5a6a7f3ca03068ec24e82aa9f30ac82d0ded9cf73df83219058cd81b198ea8f561211a323e31b41407294f6932dc61d3 SHA512 8577b4d021a5a763b8669d59ef6c3499238e87657ca94ccfc530cb9a7a215ee3682002aa6141f5731154cbc43e0e6094372961468811a68bbd2a37e20e287c7e
35 -DIST bind-9.16.32.tar.xz 5091860 BLAKE2B df6f2c878138015da580dfaf0e16b5a97b11ead9f99c1425a09da8484954196ea3dafb828ac3ab386200ce2b180646c7eb1e0e62a84c153162270a4a1e19a5fc SHA512 99abedf055901b43e1a85c448ee4c2dd731b7ab77de1454b73c8f9df816aa32262e70e23a8112959d94be990fd4f1c48c36611657ba745670141a7447fd53316
36 DIST bind-9.16.33.tar.xz 5092516 BLAKE2B 4246b61ce91af3d494ace4b8065b4c0043b2cfaf28c6de326691a969837e7d1cfbc0dac6b1e1a5182fc32af68048abcfa1202d00022951f3caa13afb03ebeb69 SHA512 43fd2cea52dfd1115a4cca83830ab5b93208be401cdbbdff2bbf204b8f0d99fb434ad3156d3a21649488cc904ae09f145feba97b9b6918b0cf063ff5e2b10af5
37 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
38
39 diff --git a/net-dns/bind/bind-9.16.27-r1.ebuild b/net-dns/bind/bind-9.16.27-r1.ebuild
40 deleted file mode 100644
41 index dfbad3bc56ac..000000000000
42 --- a/net-dns/bind/bind-9.16.27-r1.ebuild
43 +++ /dev/null
44 @@ -1,375 +0,0 @@
45 -# Copyright 1999-2022 Gentoo Authors
46 -# Distributed under the terms of the GNU General Public License v2
47 -
48 -# Re dlz/mysql and threads, needs to be verified..
49 -# MySQL uses thread local storage in its C api. Thus MySQL
50 -# requires that each thread of an application execute a MySQL
51 -# thread initialization to setup the thread local storage.
52 -# This is impossible to do safely while staying within the DLZ
53 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
54 -# Because of this BIND MUST only run with a single thread when
55 -# using the MySQL driver.
56 -
57 -EAPI=7
58 -
59 -PYTHON_COMPAT=( python3_{8..10} )
60 -
61 -inherit python-r1 autotools toolchain-funcs flag-o-matic db-use systemd tmpfiles
62 -
63 -MY_PV="${PV/_p/-P}"
64 -MY_PV="${MY_PV/_rc/rc}"
65 -MY_P="${PN}-${MY_PV}"
66 -
67 -SDB_LDAP_VER="1.1.0-fc14"
68 -
69 -RRL_PV="${MY_PV}"
70 -
71 -# SDB-LDAP: http://bind9-ldap.bayour.com/
72 -
73 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
74 -HOMEPAGE="https://www.isc.org/software/bind"
75 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
76 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
77 -
78 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
79 -SLOT="0"
80 -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
81 -# -berkdb by default re bug 602682
82 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
83 -json ldap lmdb mysql odbc postgres python selinux static-libs xml +zlib"
84 -# sdb-ldap - patch broken
85 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
86 -
87 -# Upstream dropped the old geoip library, but the BIND configuration for using
88 -# GeoIP remained the same.
89 -REQUIRED_USE="
90 - postgres? ( dlz )
91 - berkdb? ( dlz )
92 - mysql? ( dlz )
93 - odbc? ( dlz )
94 - ldap? ( dlz )
95 - dnsrps? ( dlz )
96 - python? ( ${PYTHON_REQUIRED_USE} )
97 -"
98 -
99 -DEPEND="
100 - acct-group/named
101 - acct-user/named
102 - berkdb? ( sys-libs/db:= )
103 - dev-libs/openssl:=[-bindist(-)]
104 - mysql? ( dev-db/mysql-connector-c:0= )
105 - odbc? ( >=dev-db/unixODBC-2.2.6 )
106 - ldap? ( net-nds/openldap:= )
107 - postgres? ( dev-db/postgresql:= )
108 - caps? ( >=sys-libs/libcap-2.1.0 )
109 - xml? ( dev-libs/libxml2 )
110 - geoip? ( dev-libs/libmaxminddb:= )
111 - geoip2? ( dev-libs/libmaxminddb:= )
112 - gssapi? ( virtual/krb5 )
113 - json? ( dev-libs/json-c:= )
114 - lmdb? ( dev-db/lmdb:= )
115 - zlib? ( sys-libs/zlib )
116 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
117 - python? (
118 - ${PYTHON_DEPS}
119 - dev-python/ply[${PYTHON_USEDEP}]
120 - )
121 - dev-libs/libuv:=
122 -"
123 -
124 -RDEPEND="${DEPEND}
125 - selinux? ( sec-policy/selinux-bind )
126 - sys-process/psmisc"
127 -
128 -S="${WORKDIR}/${MY_P}"
129 -
130 -PATCHES=(
131 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
132 -)
133 -
134 -# bug 479092, requires networking
135 -# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
136 -#RESTRICT="test"
137 -
138 -src_prepare() {
139 - default
140 -
141 - # should be installed by bind-tools
142 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
143 -
144 - # Disable tests for now, bug 406399
145 - sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
146 -
147 - # bug #220361
148 - rm aclocal.m4 || die
149 - rm -rf libtool.m4/ || die
150 - eautoreconf
151 -
152 - use python && python_copy_sources
153 -}
154 -
155 -src_configure() {
156 - bind_configure --without-python
157 - use python && python_foreach_impl python_configure
158 -}
159 -
160 -bind_configure() {
161 - local myeconfargs=(
162 - AR="$(type -P $(tc-getAR))"
163 - --prefix="${EPREFIX}"/usr
164 - --sysconfdir=/etc/bind
165 - --localstatedir=/var
166 - --with-libtool
167 - --enable-full-report
168 - --without-readline
169 - --with-openssl="${ESYSROOT}"/usr
170 - --without-cmocka
171 - # Removed in 9.17, drags in libunwind dependency too
172 - --disable-backtrace
173 - $(use_enable caps linux-caps)
174 - $(use_enable dnsrps)
175 - $(use_enable dnstap)
176 - $(use_enable fixed-rrset)
177 - # $(use_enable static-libs static)
178 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
179 - $(use_with dlz dlopen)
180 - $(use_with dlz dlz-filesystem)
181 - $(use_with dlz dlz-stub)
182 - $(use_with gssapi)
183 - $(use_with json json-c)
184 - $(use_with ldap dlz-ldap)
185 - $(use_with mysql dlz-mysql)
186 - $(use_with odbc dlz-odbc)
187 - $(use_with postgres dlz-postgres)
188 - $(use_with lmdb)
189 - $(use_with xml libxml2)
190 - $(use_with zlib)
191 - "${@}"
192 - )
193 - # This is for users to start to migrate back to USE=geoip, rather than
194 - # USE=geoip2
195 - if use geoip ; then
196 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
197 - elif use geoip2 ; then
198 - # Added 2020/09/30
199 - # Remove USE=geoip2 support after 2020/03/01
200 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
201 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
202 - else
203 - myeconfargs+=( --without-maxminddb --disable-geoip )
204 - fi
205 -
206 - # bug #158664
207 -# gcc-specs-ssp && replace-flags -O[23s] -O
208 -
209 - # To include db.h from proper path
210 - use berkdb && append-flags "-I$(db_includedir)"
211 -
212 - export BUILD_CC=$(tc-getBUILD_CC)
213 - econf "${myeconfargs[@]}"
214 -
215 - # bug #151839
216 - echo '#undef SO_BSDCOMPAT' >> config.h
217 -}
218 -
219 -python_configure() {
220 - pushd "${BUILD_DIR}" >/dev/null || die
221 - bind_configure --with-python
222 - popd >/dev/null || die
223 -}
224 -
225 -src_compile() {
226 - default
227 - use python && python_foreach_impl python_compile
228 -}
229 -
230 -python_compile() {
231 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
232 - emake
233 - popd >/dev/null || die
234 -}
235 -
236 -src_install() {
237 - default
238 -
239 - dodoc CHANGES README
240 -
241 - if use doc; then
242 - docinto misc
243 - dodoc -r doc/misc/
244 -
245 - # might a 'html' useflag make sense?
246 - docinto html
247 - dodoc -r doc/arm/
248 -
249 - docinto contrib
250 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
251 -
252 - # some handy-dandy dynamic dns examples
253 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
254 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
255 - popd 1>/dev/null || die
256 - fi
257 -
258 - insinto /etc/bind
259 - newins "${FILESDIR}"/named.conf-r8 named.conf
260 -
261 - # ftp://ftp.rs.internic.net/domain/named.cache:
262 - insinto /var/bind
263 - newins "${FILESDIR}"/named.cache-r3 named.cache
264 -
265 - insinto /var/bind/pri
266 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
267 -
268 - newinitd "${FILESDIR}"/named.init-r14 named
269 - newconfd "${FILESDIR}"/named.confd-r7 named
270 -
271 - newenvd "${FILESDIR}"/10bind.env 10bind
272 -
273 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
274 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
275 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
276 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
277 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
278 - for tool in dsfromkey importkey keyfromlabel keygen \
279 - revoke settime signzone verify; do
280 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
281 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
282 - done
283 -
284 - # bug 405251, library archives aren't properly handled by --enable/disable-static
285 - if ! use static-libs; then
286 - find "${ED}" -type f -name '*.a' -delete || die
287 - fi
288 -
289 - # bug 405251
290 - find "${ED}" -type f -name '*.la' -delete || die
291 -
292 - use python && python_foreach_impl python_install
293 -
294 - # bug 450406
295 - dosym named.cache /var/bind/root.cache
296 -
297 - dosym ../../var/bind/pri /etc/bind/pri
298 - dosym ../../var/bind/sec /etc/bind/sec
299 - dosym ../../var/bind/dyn /etc/bind/dyn
300 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
301 -
302 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
303 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
304 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
305 - fperms 0750 /etc/bind /var/bind/pri
306 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
307 -
308 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
309 - dotmpfiles "${FILESDIR}"/named.conf
310 - exeinto /usr/libexec
311 - doexe "${FILESDIR}/generate-rndc-key.sh"
312 -}
313 -
314 -python_install() {
315 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
316 - emake DESTDIR="${D}" install
317 - python_scriptinto /usr/sbin
318 - python_doscript dnssec-{checkds,coverage}
319 - python_optimize
320 - popd >/dev/null || die
321 -}
322 -
323 -pkg_postinst() {
324 - tmpfiles_process named.conf
325 -
326 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
327 - einfo "Using /dev/urandom for generating rndc.key"
328 - /usr/sbin/rndc-confgen -a
329 - chown root:named /etc/bind/rndc.key || die
330 - chmod 0640 /etc/bind/rndc.key || die
331 - fi
332 -
333 - einfo
334 - einfo "You can edit /etc/conf.d/named to customize named settings"
335 - einfo
336 - use mysql || use postgres || use ldap && {
337 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
338 - elog "uncomment the specified rc_named_* lines in your"
339 - elog "/etc/conf.d/named config to ensure they'll start before bind"
340 - einfo
341 - }
342 - einfo "If you'd like to run bind in a chroot AND this is a new"
343 - einfo "install OR your bind doesn't already run in a chroot:"
344 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
345 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
346 - einfo
347 -
348 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
349 - if [[ -n ${CHROOT} ]]; then
350 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
351 - elog "To enable the old behaviour (without using mount) uncomment the"
352 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
353 - elog "If you decide to use the new/default method, ensure to make backup"
354 - elog "first and merge your existing configs/zones to /etc/bind and"
355 - elog "/var/bind because bind will now mount the needed directories into"
356 - elog "the chroot dir."
357 - fi
358 -}
359 -
360 -pkg_config() {
361 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
362 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
363 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
364 -
365 - if [[ -z "${CHROOT}" ]]; then
366 - eerror "This config script is designed to automate setting up"
367 - eerror "a chrooted bind/named. To do so, please first uncomment"
368 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
369 - die "Unset CHROOT"
370 - fi
371 - if [[ -d "${CHROOT}" ]]; then
372 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
373 - ewarn "To enable the old behaviour (without using mount) uncomment the"
374 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
375 - ewarn
376 - ewarn "${CHROOT} already exists... some things might become overridden"
377 - ewarn "press CTRL+C if you don't want to continue"
378 - sleep 10
379 - fi
380 -
381 - echo; einfo "Setting up the chroot directory..."
382 -
383 - mkdir -m 0750 -p ${CHROOT} || die
384 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
385 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
386 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
387 -
388 - chown root:named \
389 - ${CHROOT} \
390 - ${CHROOT}/var/{bind,log/named} \
391 - ${CHROOT}/run/named/ \
392 - ${CHROOT}/etc/bind \
393 - || die
394 -
395 - mknod ${CHROOT}/dev/null c 1 3 || die
396 - chmod 0666 ${CHROOT}/dev/null || die
397 -
398 - mknod ${CHROOT}/dev/zero c 1 5 || die
399 - chmod 0666 ${CHROOT}/dev/zero || die
400 -
401 - mknod ${CHROOT}/dev/urandom c 1 9 || die
402 - chmod 0666 ${CHROOT}/dev/urandom || die
403 -
404 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
405 - cp -a /etc/bind ${CHROOT}/etc/ || die
406 - cp -a /var/bind ${CHROOT}/var/ || die
407 - fi
408 -
409 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
410 - if use geoip; then
411 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
412 - elif use geoip2; then
413 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
414 - fi
415 - fi
416 -
417 - elog "You may need to add the following line to your syslog-ng.conf:"
418 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
419 -}
420
421 diff --git a/net-dns/bind/bind-9.16.29-r1.ebuild b/net-dns/bind/bind-9.16.29-r1.ebuild
422 deleted file mode 100644
423 index ab9d7f6ac2ec..000000000000
424 --- a/net-dns/bind/bind-9.16.29-r1.ebuild
425 +++ /dev/null
426 @@ -1,376 +0,0 @@
427 -# Copyright 1999-2022 Gentoo Authors
428 -# Distributed under the terms of the GNU General Public License v2
429 -
430 -# Re dlz/mysql and threads, needs to be verified..
431 -# MySQL uses thread local storage in its C api. Thus MySQL
432 -# requires that each thread of an application execute a MySQL
433 -# thread initialization to setup the thread local storage.
434 -# This is impossible to do safely while staying within the DLZ
435 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
436 -# Because of this BIND MUST only run with a single thread when
437 -# using the MySQL driver.
438 -
439 -EAPI=7
440 -
441 -PYTHON_COMPAT=( python3_{8..10} )
442 -
443 -inherit python-r1 autotools toolchain-funcs flag-o-matic db-use systemd tmpfiles
444 -
445 -MY_PV="${PV/_p/-P}"
446 -MY_PV="${MY_PV/_rc/rc}"
447 -MY_P="${PN}-${MY_PV}"
448 -
449 -SDB_LDAP_VER="1.1.0-fc14"
450 -
451 -RRL_PV="${MY_PV}"
452 -
453 -# SDB-LDAP: http://bind9-ldap.bayour.com/
454 -
455 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
456 -HOMEPAGE="https://www.isc.org/software/bind"
457 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
458 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
459 -
460 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
461 -SLOT="0"
462 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
463 -# -berkdb by default re bug 602682
464 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
465 -json ldap lmdb mysql odbc postgres python selinux static-libs xml +zlib"
466 -# sdb-ldap - patch broken
467 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
468 -
469 -# Upstream dropped the old geoip library, but the BIND configuration for using
470 -# GeoIP remained the same.
471 -REQUIRED_USE="
472 - postgres? ( dlz )
473 - berkdb? ( dlz )
474 - mysql? ( dlz )
475 - odbc? ( dlz )
476 - ldap? ( dlz )
477 - dnsrps? ( dlz )
478 - python? ( ${PYTHON_REQUIRED_USE} )
479 -"
480 -
481 -DEPEND="
482 - acct-group/named
483 - acct-user/named
484 - berkdb? ( sys-libs/db:= )
485 - dev-libs/openssl:=[-bindist(-)]
486 - mysql? ( dev-db/mysql-connector-c:0= )
487 - odbc? ( >=dev-db/unixODBC-2.2.6 )
488 - ldap? ( net-nds/openldap:= )
489 - postgres? ( dev-db/postgresql:= )
490 - caps? ( >=sys-libs/libcap-2.1.0 )
491 - xml? ( dev-libs/libxml2 )
492 - geoip? ( dev-libs/libmaxminddb:= )
493 - geoip2? ( dev-libs/libmaxminddb:= )
494 - gssapi? ( virtual/krb5 )
495 - json? ( dev-libs/json-c:= )
496 - lmdb? ( dev-db/lmdb:= )
497 - zlib? ( sys-libs/zlib )
498 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
499 - python? (
500 - ${PYTHON_DEPS}
501 - dev-python/ply[${PYTHON_USEDEP}]
502 - )
503 - dev-libs/libuv:=
504 -"
505 -
506 -RDEPEND="${DEPEND}
507 - selinux? ( sec-policy/selinux-bind )
508 - sys-process/psmisc"
509 -
510 -S="${WORKDIR}/${MY_P}"
511 -
512 -PATCHES=(
513 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
514 - "${FILESDIR}/${P}-fortify-source-3.patch"
515 -)
516 -
517 -# bug 479092, requires networking
518 -# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
519 -#RESTRICT="test"
520 -
521 -src_prepare() {
522 - default
523 -
524 - # should be installed by bind-tools
525 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
526 -
527 - # Disable tests for now, bug 406399
528 - sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
529 -
530 - # bug #220361
531 - rm aclocal.m4 || die
532 - rm -rf libtool.m4/ || die
533 - eautoreconf
534 -
535 - use python && python_copy_sources
536 -}
537 -
538 -src_configure() {
539 - bind_configure --without-python
540 - use python && python_foreach_impl python_configure
541 -}
542 -
543 -bind_configure() {
544 - local myeconfargs=(
545 - AR="$(type -P $(tc-getAR))"
546 - --prefix="${EPREFIX}"/usr
547 - --sysconfdir=/etc/bind
548 - --localstatedir=/var
549 - --with-libtool
550 - --enable-full-report
551 - --without-readline
552 - --with-openssl="${ESYSROOT}"/usr
553 - --without-cmocka
554 - # Removed in 9.17, drags in libunwind dependency too
555 - --disable-backtrace
556 - $(use_enable caps linux-caps)
557 - $(use_enable dnsrps)
558 - $(use_enable dnstap)
559 - $(use_enable fixed-rrset)
560 - # $(use_enable static-libs static)
561 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
562 - $(use_with dlz dlopen)
563 - $(use_with dlz dlz-filesystem)
564 - $(use_with dlz dlz-stub)
565 - $(use_with gssapi)
566 - $(use_with json json-c)
567 - $(use_with ldap dlz-ldap)
568 - $(use_with mysql dlz-mysql)
569 - $(use_with odbc dlz-odbc)
570 - $(use_with postgres dlz-postgres)
571 - $(use_with lmdb)
572 - $(use_with xml libxml2)
573 - $(use_with zlib)
574 - "${@}"
575 - )
576 - # This is for users to start to migrate back to USE=geoip, rather than
577 - # USE=geoip2
578 - if use geoip ; then
579 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
580 - elif use geoip2 ; then
581 - # Added 2020/09/30
582 - # Remove USE=geoip2 support after 2020/03/01
583 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
584 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
585 - else
586 - myeconfargs+=( --without-maxminddb --disable-geoip )
587 - fi
588 -
589 - # bug #158664
590 -# gcc-specs-ssp && replace-flags -O[23s] -O
591 -
592 - # To include db.h from proper path
593 - use berkdb && append-flags "-I$(db_includedir)"
594 -
595 - export BUILD_CC=$(tc-getBUILD_CC)
596 - econf "${myeconfargs[@]}"
597 -
598 - # bug #151839
599 - echo '#undef SO_BSDCOMPAT' >> config.h
600 -}
601 -
602 -python_configure() {
603 - pushd "${BUILD_DIR}" >/dev/null || die
604 - bind_configure --with-python
605 - popd >/dev/null || die
606 -}
607 -
608 -src_compile() {
609 - default
610 - use python && python_foreach_impl python_compile
611 -}
612 -
613 -python_compile() {
614 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
615 - emake
616 - popd >/dev/null || die
617 -}
618 -
619 -src_install() {
620 - default
621 -
622 - dodoc CHANGES README
623 -
624 - if use doc; then
625 - docinto misc
626 - dodoc -r doc/misc/
627 -
628 - # might a 'html' useflag make sense?
629 - docinto html
630 - dodoc -r doc/arm/
631 -
632 - docinto contrib
633 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
634 -
635 - # some handy-dandy dynamic dns examples
636 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
637 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
638 - popd 1>/dev/null || die
639 - fi
640 -
641 - insinto /etc/bind
642 - newins "${FILESDIR}"/named.conf-r8 named.conf
643 -
644 - # ftp://ftp.rs.internic.net/domain/named.cache:
645 - insinto /var/bind
646 - newins "${FILESDIR}"/named.cache-r3 named.cache
647 -
648 - insinto /var/bind/pri
649 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
650 -
651 - newinitd "${FILESDIR}"/named.init-r14 named
652 - newconfd "${FILESDIR}"/named.confd-r7 named
653 -
654 - newenvd "${FILESDIR}"/10bind.env 10bind
655 -
656 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
657 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
658 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
659 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
660 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
661 - for tool in dsfromkey importkey keyfromlabel keygen \
662 - revoke settime signzone verify; do
663 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
664 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
665 - done
666 -
667 - # bug 405251, library archives aren't properly handled by --enable/disable-static
668 - if ! use static-libs; then
669 - find "${ED}" -type f -name '*.a' -delete || die
670 - fi
671 -
672 - # bug 405251
673 - find "${ED}" -type f -name '*.la' -delete || die
674 -
675 - use python && python_foreach_impl python_install
676 -
677 - # bug 450406
678 - dosym named.cache /var/bind/root.cache
679 -
680 - dosym ../../var/bind/pri /etc/bind/pri
681 - dosym ../../var/bind/sec /etc/bind/sec
682 - dosym ../../var/bind/dyn /etc/bind/dyn
683 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
684 -
685 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
686 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
687 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
688 - fperms 0750 /etc/bind /var/bind/pri
689 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
690 -
691 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
692 - dotmpfiles "${FILESDIR}"/named.conf
693 - exeinto /usr/libexec
694 - doexe "${FILESDIR}/generate-rndc-key.sh"
695 -}
696 -
697 -python_install() {
698 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
699 - emake DESTDIR="${D}" install
700 - python_scriptinto /usr/sbin
701 - python_doscript dnssec-{checkds,coverage}
702 - python_optimize
703 - popd >/dev/null || die
704 -}
705 -
706 -pkg_postinst() {
707 - tmpfiles_process named.conf
708 -
709 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
710 - einfo "Using /dev/urandom for generating rndc.key"
711 - /usr/sbin/rndc-confgen -a
712 - chown root:named /etc/bind/rndc.key || die
713 - chmod 0640 /etc/bind/rndc.key || die
714 - fi
715 -
716 - einfo
717 - einfo "You can edit /etc/conf.d/named to customize named settings"
718 - einfo
719 - use mysql || use postgres || use ldap && {
720 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
721 - elog "uncomment the specified rc_named_* lines in your"
722 - elog "/etc/conf.d/named config to ensure they'll start before bind"
723 - einfo
724 - }
725 - einfo "If you'd like to run bind in a chroot AND this is a new"
726 - einfo "install OR your bind doesn't already run in a chroot:"
727 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
728 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
729 - einfo
730 -
731 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
732 - if [[ -n ${CHROOT} ]]; then
733 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
734 - elog "To enable the old behaviour (without using mount) uncomment the"
735 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
736 - elog "If you decide to use the new/default method, ensure to make backup"
737 - elog "first and merge your existing configs/zones to /etc/bind and"
738 - elog "/var/bind because bind will now mount the needed directories into"
739 - elog "the chroot dir."
740 - fi
741 -}
742 -
743 -pkg_config() {
744 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
745 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
746 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
747 -
748 - if [[ -z "${CHROOT}" ]]; then
749 - eerror "This config script is designed to automate setting up"
750 - eerror "a chrooted bind/named. To do so, please first uncomment"
751 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
752 - die "Unset CHROOT"
753 - fi
754 - if [[ -d "${CHROOT}" ]]; then
755 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
756 - ewarn "To enable the old behaviour (without using mount) uncomment the"
757 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
758 - ewarn
759 - ewarn "${CHROOT} already exists... some things might become overridden"
760 - ewarn "press CTRL+C if you don't want to continue"
761 - sleep 10
762 - fi
763 -
764 - echo; einfo "Setting up the chroot directory..."
765 -
766 - mkdir -m 0750 -p ${CHROOT} || die
767 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
768 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
769 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
770 -
771 - chown root:named \
772 - ${CHROOT} \
773 - ${CHROOT}/var/{bind,log/named} \
774 - ${CHROOT}/run/named/ \
775 - ${CHROOT}/etc/bind \
776 - || die
777 -
778 - mknod ${CHROOT}/dev/null c 1 3 || die
779 - chmod 0666 ${CHROOT}/dev/null || die
780 -
781 - mknod ${CHROOT}/dev/zero c 1 5 || die
782 - chmod 0666 ${CHROOT}/dev/zero || die
783 -
784 - mknod ${CHROOT}/dev/urandom c 1 9 || die
785 - chmod 0666 ${CHROOT}/dev/urandom || die
786 -
787 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
788 - cp -a /etc/bind ${CHROOT}/etc/ || die
789 - cp -a /var/bind ${CHROOT}/var/ || die
790 - fi
791 -
792 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
793 - if use geoip; then
794 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
795 - elif use geoip2; then
796 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
797 - fi
798 - fi
799 -
800 - elog "You may need to add the following line to your syslog-ng.conf:"
801 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
802 -}
803
804 diff --git a/net-dns/bind/bind-9.16.29.ebuild b/net-dns/bind/bind-9.16.29.ebuild
805 deleted file mode 100644
806 index fce1301fbdf3..000000000000
807 --- a/net-dns/bind/bind-9.16.29.ebuild
808 +++ /dev/null
809 @@ -1,375 +0,0 @@
810 -# Copyright 1999-2022 Gentoo Authors
811 -# Distributed under the terms of the GNU General Public License v2
812 -
813 -# Re dlz/mysql and threads, needs to be verified..
814 -# MySQL uses thread local storage in its C api. Thus MySQL
815 -# requires that each thread of an application execute a MySQL
816 -# thread initialization to setup the thread local storage.
817 -# This is impossible to do safely while staying within the DLZ
818 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
819 -# Because of this BIND MUST only run with a single thread when
820 -# using the MySQL driver.
821 -
822 -EAPI=7
823 -
824 -PYTHON_COMPAT=( python3_{8..10} )
825 -
826 -inherit python-r1 autotools toolchain-funcs flag-o-matic db-use systemd tmpfiles
827 -
828 -MY_PV="${PV/_p/-P}"
829 -MY_PV="${MY_PV/_rc/rc}"
830 -MY_P="${PN}-${MY_PV}"
831 -
832 -SDB_LDAP_VER="1.1.0-fc14"
833 -
834 -RRL_PV="${MY_PV}"
835 -
836 -# SDB-LDAP: http://bind9-ldap.bayour.com/
837 -
838 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
839 -HOMEPAGE="https://www.isc.org/software/bind"
840 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
841 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
842 -
843 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
844 -SLOT="0"
845 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
846 -# -berkdb by default re bug 602682
847 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
848 -json ldap lmdb mysql odbc postgres python selinux static-libs xml +zlib"
849 -# sdb-ldap - patch broken
850 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
851 -
852 -# Upstream dropped the old geoip library, but the BIND configuration for using
853 -# GeoIP remained the same.
854 -REQUIRED_USE="
855 - postgres? ( dlz )
856 - berkdb? ( dlz )
857 - mysql? ( dlz )
858 - odbc? ( dlz )
859 - ldap? ( dlz )
860 - dnsrps? ( dlz )
861 - python? ( ${PYTHON_REQUIRED_USE} )
862 -"
863 -
864 -DEPEND="
865 - acct-group/named
866 - acct-user/named
867 - berkdb? ( sys-libs/db:= )
868 - dev-libs/openssl:=[-bindist(-)]
869 - mysql? ( dev-db/mysql-connector-c:0= )
870 - odbc? ( >=dev-db/unixODBC-2.2.6 )
871 - ldap? ( net-nds/openldap:= )
872 - postgres? ( dev-db/postgresql:= )
873 - caps? ( >=sys-libs/libcap-2.1.0 )
874 - xml? ( dev-libs/libxml2 )
875 - geoip? ( dev-libs/libmaxminddb:= )
876 - geoip2? ( dev-libs/libmaxminddb:= )
877 - gssapi? ( virtual/krb5 )
878 - json? ( dev-libs/json-c:= )
879 - lmdb? ( dev-db/lmdb:= )
880 - zlib? ( sys-libs/zlib )
881 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
882 - python? (
883 - ${PYTHON_DEPS}
884 - dev-python/ply[${PYTHON_USEDEP}]
885 - )
886 - dev-libs/libuv:=
887 -"
888 -
889 -RDEPEND="${DEPEND}
890 - selinux? ( sec-policy/selinux-bind )
891 - sys-process/psmisc"
892 -
893 -S="${WORKDIR}/${MY_P}"
894 -
895 -PATCHES=(
896 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
897 -)
898 -
899 -# bug 479092, requires networking
900 -# bug 710840, cmocka fails LDFLAGS='-Wl,-O1'
901 -#RESTRICT="test"
902 -
903 -src_prepare() {
904 - default
905 -
906 - # should be installed by bind-tools
907 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
908 -
909 - # Disable tests for now, bug 406399
910 - sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
911 -
912 - # bug #220361
913 - rm aclocal.m4 || die
914 - rm -rf libtool.m4/ || die
915 - eautoreconf
916 -
917 - use python && python_copy_sources
918 -}
919 -
920 -src_configure() {
921 - bind_configure --without-python
922 - use python && python_foreach_impl python_configure
923 -}
924 -
925 -bind_configure() {
926 - local myeconfargs=(
927 - AR="$(type -P $(tc-getAR))"
928 - --prefix="${EPREFIX}"/usr
929 - --sysconfdir=/etc/bind
930 - --localstatedir=/var
931 - --with-libtool
932 - --enable-full-report
933 - --without-readline
934 - --with-openssl="${ESYSROOT}"/usr
935 - --without-cmocka
936 - # Removed in 9.17, drags in libunwind dependency too
937 - --disable-backtrace
938 - $(use_enable caps linux-caps)
939 - $(use_enable dnsrps)
940 - $(use_enable dnstap)
941 - $(use_enable fixed-rrset)
942 - # $(use_enable static-libs static)
943 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
944 - $(use_with dlz dlopen)
945 - $(use_with dlz dlz-filesystem)
946 - $(use_with dlz dlz-stub)
947 - $(use_with gssapi)
948 - $(use_with json json-c)
949 - $(use_with ldap dlz-ldap)
950 - $(use_with mysql dlz-mysql)
951 - $(use_with odbc dlz-odbc)
952 - $(use_with postgres dlz-postgres)
953 - $(use_with lmdb)
954 - $(use_with xml libxml2)
955 - $(use_with zlib)
956 - "${@}"
957 - )
958 - # This is for users to start to migrate back to USE=geoip, rather than
959 - # USE=geoip2
960 - if use geoip ; then
961 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
962 - elif use geoip2 ; then
963 - # Added 2020/09/30
964 - # Remove USE=geoip2 support after 2020/03/01
965 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
966 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
967 - else
968 - myeconfargs+=( --without-maxminddb --disable-geoip )
969 - fi
970 -
971 - # bug #158664
972 -# gcc-specs-ssp && replace-flags -O[23s] -O
973 -
974 - # To include db.h from proper path
975 - use berkdb && append-flags "-I$(db_includedir)"
976 -
977 - export BUILD_CC=$(tc-getBUILD_CC)
978 - econf "${myeconfargs[@]}"
979 -
980 - # bug #151839
981 - echo '#undef SO_BSDCOMPAT' >> config.h
982 -}
983 -
984 -python_configure() {
985 - pushd "${BUILD_DIR}" >/dev/null || die
986 - bind_configure --with-python
987 - popd >/dev/null || die
988 -}
989 -
990 -src_compile() {
991 - default
992 - use python && python_foreach_impl python_compile
993 -}
994 -
995 -python_compile() {
996 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
997 - emake
998 - popd >/dev/null || die
999 -}
1000 -
1001 -src_install() {
1002 - default
1003 -
1004 - dodoc CHANGES README
1005 -
1006 - if use doc; then
1007 - docinto misc
1008 - dodoc -r doc/misc/
1009 -
1010 - # might a 'html' useflag make sense?
1011 - docinto html
1012 - dodoc -r doc/arm/
1013 -
1014 - docinto contrib
1015 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
1016 -
1017 - # some handy-dandy dynamic dns examples
1018 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
1019 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
1020 - popd 1>/dev/null || die
1021 - fi
1022 -
1023 - insinto /etc/bind
1024 - newins "${FILESDIR}"/named.conf-r8 named.conf
1025 -
1026 - # ftp://ftp.rs.internic.net/domain/named.cache:
1027 - insinto /var/bind
1028 - newins "${FILESDIR}"/named.cache-r3 named.cache
1029 -
1030 - insinto /var/bind/pri
1031 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
1032 -
1033 - newinitd "${FILESDIR}"/named.init-r14 named
1034 - newconfd "${FILESDIR}"/named.confd-r7 named
1035 -
1036 - newenvd "${FILESDIR}"/10bind.env 10bind
1037 -
1038 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
1039 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
1040 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
1041 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
1042 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
1043 - for tool in dsfromkey importkey keyfromlabel keygen \
1044 - revoke settime signzone verify; do
1045 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
1046 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
1047 - done
1048 -
1049 - # bug 405251, library archives aren't properly handled by --enable/disable-static
1050 - if ! use static-libs; then
1051 - find "${ED}" -type f -name '*.a' -delete || die
1052 - fi
1053 -
1054 - # bug 405251
1055 - find "${ED}" -type f -name '*.la' -delete || die
1056 -
1057 - use python && python_foreach_impl python_install
1058 -
1059 - # bug 450406
1060 - dosym named.cache /var/bind/root.cache
1061 -
1062 - dosym ../../var/bind/pri /etc/bind/pri
1063 - dosym ../../var/bind/sec /etc/bind/sec
1064 - dosym ../../var/bind/dyn /etc/bind/dyn
1065 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
1066 -
1067 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
1068 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1069 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1070 - fperms 0750 /etc/bind /var/bind/pri
1071 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
1072 -
1073 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
1074 - dotmpfiles "${FILESDIR}"/named.conf
1075 - exeinto /usr/libexec
1076 - doexe "${FILESDIR}/generate-rndc-key.sh"
1077 -}
1078 -
1079 -python_install() {
1080 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
1081 - emake DESTDIR="${D}" install
1082 - python_scriptinto /usr/sbin
1083 - python_doscript dnssec-{checkds,coverage}
1084 - python_optimize
1085 - popd >/dev/null || die
1086 -}
1087 -
1088 -pkg_postinst() {
1089 - tmpfiles_process named.conf
1090 -
1091 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
1092 - einfo "Using /dev/urandom for generating rndc.key"
1093 - /usr/sbin/rndc-confgen -a
1094 - chown root:named /etc/bind/rndc.key || die
1095 - chmod 0640 /etc/bind/rndc.key || die
1096 - fi
1097 -
1098 - einfo
1099 - einfo "You can edit /etc/conf.d/named to customize named settings"
1100 - einfo
1101 - use mysql || use postgres || use ldap && {
1102 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
1103 - elog "uncomment the specified rc_named_* lines in your"
1104 - elog "/etc/conf.d/named config to ensure they'll start before bind"
1105 - einfo
1106 - }
1107 - einfo "If you'd like to run bind in a chroot AND this is a new"
1108 - einfo "install OR your bind doesn't already run in a chroot:"
1109 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
1110 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
1111 - einfo
1112 -
1113 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
1114 - if [[ -n ${CHROOT} ]]; then
1115 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1116 - elog "To enable the old behaviour (without using mount) uncomment the"
1117 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1118 - elog "If you decide to use the new/default method, ensure to make backup"
1119 - elog "first and merge your existing configs/zones to /etc/bind and"
1120 - elog "/var/bind because bind will now mount the needed directories into"
1121 - elog "the chroot dir."
1122 - fi
1123 -}
1124 -
1125 -pkg_config() {
1126 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
1127 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
1128 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
1129 -
1130 - if [[ -z "${CHROOT}" ]]; then
1131 - eerror "This config script is designed to automate setting up"
1132 - eerror "a chrooted bind/named. To do so, please first uncomment"
1133 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
1134 - die "Unset CHROOT"
1135 - fi
1136 - if [[ -d "${CHROOT}" ]]; then
1137 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1138 - ewarn "To enable the old behaviour (without using mount) uncomment the"
1139 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1140 - ewarn
1141 - ewarn "${CHROOT} already exists... some things might become overridden"
1142 - ewarn "press CTRL+C if you don't want to continue"
1143 - sleep 10
1144 - fi
1145 -
1146 - echo; einfo "Setting up the chroot directory..."
1147 -
1148 - mkdir -m 0750 -p ${CHROOT} || die
1149 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
1150 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
1151 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
1152 -
1153 - chown root:named \
1154 - ${CHROOT} \
1155 - ${CHROOT}/var/{bind,log/named} \
1156 - ${CHROOT}/run/named/ \
1157 - ${CHROOT}/etc/bind \
1158 - || die
1159 -
1160 - mknod ${CHROOT}/dev/null c 1 3 || die
1161 - chmod 0666 ${CHROOT}/dev/null || die
1162 -
1163 - mknod ${CHROOT}/dev/zero c 1 5 || die
1164 - chmod 0666 ${CHROOT}/dev/zero || die
1165 -
1166 - mknod ${CHROOT}/dev/urandom c 1 9 || die
1167 - chmod 0666 ${CHROOT}/dev/urandom || die
1168 -
1169 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
1170 - cp -a /etc/bind ${CHROOT}/etc/ || die
1171 - cp -a /var/bind ${CHROOT}/var/ || die
1172 - fi
1173 -
1174 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
1175 - if use geoip; then
1176 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
1177 - elif use geoip2; then
1178 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
1179 - fi
1180 - fi
1181 -
1182 - elog "You may need to add the following line to your syslog-ng.conf:"
1183 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
1184 -}
1185
1186 diff --git a/net-dns/bind/bind-9.16.30.ebuild b/net-dns/bind/bind-9.16.30.ebuild
1187 deleted file mode 100644
1188 index e4a306d6239e..000000000000
1189 --- a/net-dns/bind/bind-9.16.30.ebuild
1190 +++ /dev/null
1191 @@ -1,381 +0,0 @@
1192 -# Copyright 1999-2022 Gentoo Authors
1193 -# Distributed under the terms of the GNU General Public License v2
1194 -
1195 -# Re dlz/mysql and threads, needs to be verified..
1196 -# MySQL uses thread local storage in its C api. Thus MySQL
1197 -# requires that each thread of an application execute a MySQL
1198 -# thread initialization to setup the thread local storage.
1199 -# This is impossible to do safely while staying within the DLZ
1200 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
1201 -# Because of this BIND MUST only run with a single thread when
1202 -# using the MySQL driver.
1203 -
1204 -EAPI=8
1205 -
1206 -PYTHON_COMPAT=( python3_{8..10} )
1207 -
1208 -inherit python-r1 autotools multiprocessing toolchain-funcs flag-o-matic db-use systemd tmpfiles
1209 -
1210 -MY_PV="${PV/_p/-P}"
1211 -MY_PV="${MY_PV/_rc/rc}"
1212 -MY_P="${PN}-${MY_PV}"
1213 -
1214 -SDB_LDAP_VER="1.1.0-fc14"
1215 -
1216 -RRL_PV="${MY_PV}"
1217 -
1218 -# SDB-LDAP: http://bind9-ldap.bayour.com/
1219 -
1220 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
1221 -HOMEPAGE="https://www.isc.org/software/bind"
1222 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
1223 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
1224 -
1225 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
1226 -SLOT="0"
1227 -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
1228 -# -berkdb by default re bug 602682
1229 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
1230 -json ldap lmdb mysql odbc postgres python selinux static-libs test xml +zlib"
1231 -# sdb-ldap - patch broken
1232 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
1233 -RESTRICT="!test? ( test )"
1234 -
1235 -# Upstream dropped the old geoip library, but the BIND configuration for using
1236 -# GeoIP remained the same.
1237 -REQUIRED_USE="
1238 - postgres? ( dlz )
1239 - berkdb? ( dlz )
1240 - mysql? ( dlz )
1241 - odbc? ( dlz )
1242 - ldap? ( dlz )
1243 - dnsrps? ( dlz )
1244 - python? ( ${PYTHON_REQUIRED_USE} )
1245 -"
1246 -
1247 -DEPEND="
1248 - acct-group/named
1249 - acct-user/named
1250 - berkdb? ( sys-libs/db:= )
1251 - dev-libs/openssl:=[-bindist(-)]
1252 - mysql? ( dev-db/mysql-connector-c:0= )
1253 - odbc? ( >=dev-db/unixODBC-2.2.6 )
1254 - ldap? ( net-nds/openldap:= )
1255 - postgres? ( dev-db/postgresql:= )
1256 - caps? ( >=sys-libs/libcap-2.1.0 )
1257 - xml? ( dev-libs/libxml2 )
1258 - geoip? ( dev-libs/libmaxminddb:= )
1259 - geoip2? ( dev-libs/libmaxminddb:= )
1260 - gssapi? ( virtual/krb5 )
1261 - json? ( dev-libs/json-c:= )
1262 - lmdb? ( dev-db/lmdb:= )
1263 - zlib? ( sys-libs/zlib )
1264 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
1265 - python? (
1266 - ${PYTHON_DEPS}
1267 - dev-python/ply[${PYTHON_USEDEP}]
1268 - )
1269 - dev-libs/libuv:=
1270 -"
1271 -
1272 -RDEPEND="${DEPEND}
1273 - selinux? ( sec-policy/selinux-bind )
1274 - sys-process/psmisc"
1275 -
1276 -BDEPEND="
1277 - test? (
1278 - dev-util/cmocka
1279 - dev-util/kyua
1280 - )
1281 -"
1282 -
1283 -S="${WORKDIR}/${MY_P}"
1284 -
1285 -PATCHES=(
1286 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
1287 -)
1288 -
1289 -src_prepare() {
1290 - default
1291 -
1292 - # Should be installed by bind-tools
1293 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
1294 -
1295 - # bug #220361
1296 - rm aclocal.m4 || die
1297 - rm -rf libtool.m4/ || die
1298 - eautoreconf
1299 -
1300 - use python && python_copy_sources
1301 -}
1302 -
1303 -src_configure() {
1304 - bind_configure --without-python
1305 - use python && python_foreach_impl python_configure
1306 -}
1307 -
1308 -bind_configure() {
1309 - local myeconfargs=(
1310 - AR="$(type -P $(tc-getAR))"
1311 - --prefix="${EPREFIX}"/usr
1312 - --sysconfdir=/etc/bind
1313 - --localstatedir=/var
1314 - --with-libtool
1315 - --enable-full-report
1316 - --without-readline
1317 - --with-openssl="${ESYSROOT}"/usr
1318 - $(use_with test cmocka)
1319 - # Removed in 9.17, drags in libunwind dependency too
1320 - --disable-backtrace
1321 - $(use_enable caps linux-caps)
1322 - $(use_enable dnsrps)
1323 - $(use_enable dnstap)
1324 - $(use_enable fixed-rrset)
1325 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
1326 - $(use_with dlz dlopen)
1327 - $(use_with dlz dlz-filesystem)
1328 - $(use_with dlz dlz-stub)
1329 - $(use_with gssapi)
1330 - $(use_with json json-c)
1331 - $(use_with ldap dlz-ldap)
1332 - $(use_with mysql dlz-mysql)
1333 - $(use_with odbc dlz-odbc)
1334 - $(use_with postgres dlz-postgres)
1335 - $(use_with lmdb)
1336 - $(use_with xml libxml2)
1337 - $(use_with zlib)
1338 - "${@}"
1339 - )
1340 -
1341 - # This is for users to start to migrate back to USE=geoip, rather than
1342 - # USE=geoip2
1343 - if use geoip ; then
1344 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
1345 - elif use geoip2 ; then
1346 - # Added 2020/09/30
1347 - # Remove USE=geoip2 support after 2020/03/01
1348 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
1349 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
1350 - else
1351 - myeconfargs+=( --without-maxminddb --disable-geoip )
1352 - fi
1353 -
1354 - # bug #158664
1355 - #gcc-specs-ssp && replace-flags -O[23s] -O
1356 -
1357 - # To include db.h from proper path
1358 - use berkdb && append-flags "-I$(db_includedir)"
1359 -
1360 - export BUILD_CC=$(tc-getBUILD_CC)
1361 - econf "${myeconfargs[@]}"
1362 -
1363 - # bug #151839
1364 - echo '#undef SO_BSDCOMPAT' >> config.h || die
1365 -}
1366 -
1367 -python_configure() {
1368 - pushd "${BUILD_DIR}" >/dev/null || die
1369 - bind_configure --with-python
1370 - popd >/dev/null || die
1371 -}
1372 -
1373 -src_compile() {
1374 - default
1375 - use python && python_foreach_impl python_compile
1376 -}
1377 -
1378 -python_compile() {
1379 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
1380 - emake
1381 - popd >/dev/null || die
1382 -}
1383 -
1384 -src_test() {
1385 - # system tests ('emake test') require network configuration for IPs etc
1386 - TEST_PARALLEL_JOBS="$(makeopts_jobs)" emake unit
1387 -}
1388 -
1389 -src_install() {
1390 - default
1391 -
1392 - dodoc CHANGES README
1393 -
1394 - if use doc; then
1395 - docinto misc
1396 - dodoc -r doc/misc/
1397 -
1398 - # might a 'html' useflag make sense?
1399 - docinto html
1400 - dodoc -r doc/arm/
1401 -
1402 - docinto contrib
1403 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
1404 -
1405 - # some handy-dandy dynamic dns examples
1406 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
1407 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
1408 - popd 1>/dev/null || die
1409 - fi
1410 -
1411 - insinto /etc/bind
1412 - newins "${FILESDIR}"/named.conf-r8 named.conf
1413 -
1414 - # ftp://ftp.rs.internic.net/domain/named.cache:
1415 - insinto /var/bind
1416 - newins "${FILESDIR}"/named.cache-r3 named.cache
1417 -
1418 - insinto /var/bind/pri
1419 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
1420 -
1421 - newinitd "${FILESDIR}"/named.init-r14 named
1422 - newconfd "${FILESDIR}"/named.confd-r7 named
1423 -
1424 - newenvd "${FILESDIR}"/10bind.env 10bind
1425 -
1426 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
1427 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
1428 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
1429 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
1430 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
1431 - for tool in dsfromkey importkey keyfromlabel keygen \
1432 - revoke settime signzone verify; do
1433 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
1434 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
1435 - done
1436 -
1437 - # bug 405251, library archives aren't properly handled by --enable/disable-static
1438 - if ! use static-libs; then
1439 - find "${ED}" -type f -name '*.a' -delete || die
1440 - fi
1441 -
1442 - # bug 405251
1443 - find "${ED}" -type f -name '*.la' -delete || die
1444 -
1445 - use python && python_foreach_impl python_install
1446 -
1447 - # bug 450406
1448 - dosym named.cache /var/bind/root.cache
1449 -
1450 - dosym ../../var/bind/pri /etc/bind/pri
1451 - dosym ../../var/bind/sec /etc/bind/sec
1452 - dosym ../../var/bind/dyn /etc/bind/dyn
1453 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
1454 -
1455 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
1456 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1457 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1458 - fperms 0750 /etc/bind /var/bind/pri
1459 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
1460 -
1461 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
1462 - dotmpfiles "${FILESDIR}"/named.conf
1463 - exeinto /usr/libexec
1464 - doexe "${FILESDIR}/generate-rndc-key.sh"
1465 -}
1466 -
1467 -python_install() {
1468 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
1469 - emake DESTDIR="${D}" install
1470 - python_scriptinto /usr/sbin
1471 - python_doscript dnssec-{checkds,coverage}
1472 - python_optimize
1473 - popd >/dev/null || die
1474 -}
1475 -
1476 -pkg_postinst() {
1477 - tmpfiles_process named.conf
1478 -
1479 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
1480 - einfo "Using /dev/urandom for generating rndc.key"
1481 - /usr/sbin/rndc-confgen -a
1482 - chown root:named /etc/bind/rndc.key || die
1483 - chmod 0640 /etc/bind/rndc.key || die
1484 - fi
1485 -
1486 - einfo
1487 - einfo "You can edit /etc/conf.d/named to customize named settings"
1488 - einfo
1489 - use mysql || use postgres || use ldap && {
1490 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
1491 - elog "uncomment the specified rc_named_* lines in your"
1492 - elog "/etc/conf.d/named config to ensure they'll start before bind"
1493 - einfo
1494 - }
1495 - einfo "If you'd like to run bind in a chroot AND this is a new"
1496 - einfo "install OR your bind doesn't already run in a chroot:"
1497 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
1498 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
1499 - einfo
1500 -
1501 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
1502 - if [[ -n ${CHROOT} ]]; then
1503 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1504 - elog "To enable the old behaviour (without using mount) uncomment the"
1505 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1506 - elog "If you decide to use the new/default method, ensure to make backup"
1507 - elog "first and merge your existing configs/zones to /etc/bind and"
1508 - elog "/var/bind because bind will now mount the needed directories into"
1509 - elog "the chroot dir."
1510 - fi
1511 -}
1512 -
1513 -pkg_config() {
1514 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
1515 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
1516 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
1517 -
1518 - if [[ -z "${CHROOT}" ]]; then
1519 - eerror "This config script is designed to automate setting up"
1520 - eerror "a chrooted bind/named. To do so, please first uncomment"
1521 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
1522 - die "Unset CHROOT"
1523 - fi
1524 - if [[ -d "${CHROOT}" ]]; then
1525 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1526 - ewarn "To enable the old behaviour (without using mount) uncomment the"
1527 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1528 - ewarn
1529 - ewarn "${CHROOT} already exists... some things might become overridden"
1530 - ewarn "press CTRL+C if you don't want to continue"
1531 - sleep 10
1532 - fi
1533 -
1534 - echo; einfo "Setting up the chroot directory..."
1535 -
1536 - mkdir -m 0750 -p ${CHROOT} || die
1537 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
1538 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
1539 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
1540 -
1541 - chown root:named \
1542 - ${CHROOT} \
1543 - ${CHROOT}/var/{bind,log/named} \
1544 - ${CHROOT}/run/named/ \
1545 - ${CHROOT}/etc/bind \
1546 - || die
1547 -
1548 - mknod ${CHROOT}/dev/null c 1 3 || die
1549 - chmod 0666 ${CHROOT}/dev/null || die
1550 -
1551 - mknod ${CHROOT}/dev/zero c 1 5 || die
1552 - chmod 0666 ${CHROOT}/dev/zero || die
1553 -
1554 - mknod ${CHROOT}/dev/urandom c 1 9 || die
1555 - chmod 0666 ${CHROOT}/dev/urandom || die
1556 -
1557 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
1558 - cp -a /etc/bind ${CHROOT}/etc/ || die
1559 - cp -a /var/bind ${CHROOT}/var/ || die
1560 - fi
1561 -
1562 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
1563 - if use geoip; then
1564 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
1565 - elif use geoip2; then
1566 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
1567 - fi
1568 - fi
1569 -
1570 - elog "You may need to add the following line to your syslog-ng.conf:"
1571 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
1572 -}
1573
1574 diff --git a/net-dns/bind/bind-9.16.31.ebuild b/net-dns/bind/bind-9.16.31.ebuild
1575 deleted file mode 100644
1576 index 010d5b56b5d2..000000000000
1577 --- a/net-dns/bind/bind-9.16.31.ebuild
1578 +++ /dev/null
1579 @@ -1,382 +0,0 @@
1580 -# Copyright 1999-2022 Gentoo Authors
1581 -# Distributed under the terms of the GNU General Public License v2
1582 -
1583 -# Re dlz/mysql and threads, needs to be verified..
1584 -# MySQL uses thread local storage in its C api. Thus MySQL
1585 -# requires that each thread of an application execute a MySQL
1586 -# thread initialization to setup the thread local storage.
1587 -# This is impossible to do safely while staying within the DLZ
1588 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
1589 -# Because of this BIND MUST only run with a single thread when
1590 -# using the MySQL driver.
1591 -
1592 -EAPI=8
1593 -
1594 -PYTHON_COMPAT=( python3_{8..10} )
1595 -
1596 -inherit python-r1 autotools multiprocessing toolchain-funcs flag-o-matic db-use systemd tmpfiles
1597 -
1598 -MY_PV="${PV/_p/-P}"
1599 -MY_PV="${MY_PV/_rc/rc}"
1600 -MY_P="${PN}-${MY_PV}"
1601 -
1602 -SDB_LDAP_VER="1.1.0-fc14"
1603 -
1604 -RRL_PV="${MY_PV}"
1605 -
1606 -# SDB-LDAP: http://bind9-ldap.bayour.com/
1607 -
1608 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
1609 -HOMEPAGE="https://www.isc.org/software/bind https://gitlab.isc.org/isc-projects/bind9"
1610 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
1611 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
1612 -
1613 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
1614 -SLOT="0"
1615 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
1616 -# -berkdb by default re bug #602682
1617 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
1618 -json ldap lmdb mysql odbc postgres python selinux static-libs test xml +zlib"
1619 -# sdb-ldap - patch broken
1620 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
1621 -RESTRICT="!test? ( test )"
1622 -
1623 -# Upstream dropped the old geoip library, but the BIND configuration for using
1624 -# GeoIP remained the same.
1625 -REQUIRED_USE="
1626 - postgres? ( dlz )
1627 - berkdb? ( dlz )
1628 - mysql? ( dlz )
1629 - odbc? ( dlz )
1630 - ldap? ( dlz )
1631 - dnsrps? ( dlz )
1632 - python? ( ${PYTHON_REQUIRED_USE} )
1633 -"
1634 -
1635 -DEPEND="
1636 - acct-group/named
1637 - acct-user/named
1638 - berkdb? ( sys-libs/db:= )
1639 - dev-libs/openssl:=[-bindist(-)]
1640 - mysql? ( dev-db/mysql-connector-c:0= )
1641 - odbc? ( >=dev-db/unixODBC-2.2.6 )
1642 - ldap? ( net-nds/openldap:= )
1643 - postgres? ( dev-db/postgresql:= )
1644 - caps? ( >=sys-libs/libcap-2.1.0 )
1645 - xml? ( dev-libs/libxml2 )
1646 - geoip? ( dev-libs/libmaxminddb:= )
1647 - geoip2? ( dev-libs/libmaxminddb:= )
1648 - gssapi? ( virtual/krb5 )
1649 - json? ( dev-libs/json-c:= )
1650 - lmdb? ( dev-db/lmdb:= )
1651 - zlib? ( sys-libs/zlib )
1652 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
1653 - python? (
1654 - ${PYTHON_DEPS}
1655 - dev-python/ply[${PYTHON_USEDEP}]
1656 - )
1657 - dev-libs/libuv:=
1658 -"
1659 -
1660 -RDEPEND="${DEPEND}
1661 - selinux? ( sec-policy/selinux-bind )
1662 - sys-process/psmisc"
1663 -
1664 -BDEPEND="
1665 - test? (
1666 - dev-util/cmocka
1667 - dev-util/kyua
1668 - )
1669 -"
1670 -
1671 -S="${WORKDIR}/${MY_P}"
1672 -
1673 -PATCHES=(
1674 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
1675 -)
1676 -
1677 -src_prepare() {
1678 - default
1679 -
1680 - # Should be installed by bind-tools
1681 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
1682 -
1683 - # bug #220361
1684 - rm aclocal.m4 || die
1685 - rm -rf libtool.m4/ || die
1686 - eautoreconf
1687 -
1688 - use python && python_copy_sources
1689 -}
1690 -
1691 -src_configure() {
1692 - bind_configure --without-python
1693 - use python && python_foreach_impl python_configure
1694 -}
1695 -
1696 -bind_configure() {
1697 - local myeconfargs=(
1698 - AR="$(type -P $(tc-getAR))"
1699 - --prefix="${EPREFIX}"/usr
1700 - --sysconfdir=/etc/bind
1701 - --localstatedir=/var
1702 - --with-libtool
1703 - --enable-full-report
1704 - --without-readline
1705 - --with-openssl="${ESYSROOT}"/usr
1706 - $(use_with test cmocka)
1707 - # Removed in 9.17, drags in libunwind dependency too
1708 - --disable-backtrace
1709 - $(use_enable caps linux-caps)
1710 - $(use_enable dnsrps)
1711 - $(use_enable dnstap)
1712 - $(use_enable fixed-rrset)
1713 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
1714 - $(use_with dlz dlopen)
1715 - $(use_with dlz dlz-filesystem)
1716 - $(use_with dlz dlz-stub)
1717 - $(use_with gssapi)
1718 - $(use_with json json-c)
1719 - $(use_with ldap dlz-ldap)
1720 - $(use_with mysql dlz-mysql)
1721 - $(use_with odbc dlz-odbc)
1722 - $(use_with postgres dlz-postgres)
1723 - $(use_with lmdb)
1724 - $(use_with xml libxml2)
1725 - $(use_with zlib)
1726 - "${@}"
1727 - )
1728 -
1729 - # This is for users to start to migrate back to USE=geoip, rather than
1730 - # USE=geoip2
1731 - if use geoip ; then
1732 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
1733 - elif use geoip2 ; then
1734 - # Added 2020/09/30
1735 - # Remove USE=geoip2 support after 2020/03/01
1736 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
1737 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
1738 - else
1739 - myeconfargs+=( --without-maxminddb --disable-geoip )
1740 - fi
1741 -
1742 - # bug #158664
1743 - #gcc-specs-ssp && replace-flags -O[23s] -O
1744 -
1745 - # To include db.h from proper path
1746 - use berkdb && append-flags "-I$(db_includedir)"
1747 -
1748 - export BUILD_CC=$(tc-getBUILD_CC)
1749 - econf "${myeconfargs[@]}"
1750 -
1751 - # bug #151839
1752 - echo '#undef SO_BSDCOMPAT' >> config.h || die
1753 -}
1754 -
1755 -python_configure() {
1756 - pushd "${BUILD_DIR}" >/dev/null || die
1757 - bind_configure --with-python
1758 - popd >/dev/null || die
1759 -}
1760 -
1761 -src_compile() {
1762 - default
1763 - use python && python_foreach_impl python_compile
1764 -}
1765 -
1766 -python_compile() {
1767 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
1768 - emake
1769 - popd >/dev/null || die
1770 -}
1771 -
1772 -src_test() {
1773 - # system tests ('emake test') require network configuration for IPs etc
1774 - # so we run the unit tests instead.
1775 - TEST_PARALLEL_JOBS="$(makeopts_jobs)" emake unit
1776 -}
1777 -
1778 -src_install() {
1779 - default
1780 -
1781 - dodoc CHANGES README
1782 -
1783 - if use doc; then
1784 - docinto misc
1785 - dodoc -r doc/misc/
1786 -
1787 - # might a 'html' useflag make sense?
1788 - docinto html
1789 - dodoc -r doc/arm/
1790 -
1791 - docinto contrib
1792 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
1793 -
1794 - # some handy-dandy dynamic dns examples
1795 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
1796 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
1797 - popd 1>/dev/null || die
1798 - fi
1799 -
1800 - insinto /etc/bind
1801 - newins "${FILESDIR}"/named.conf-r8 named.conf
1802 -
1803 - # ftp://ftp.rs.internic.net/domain/named.cache:
1804 - insinto /var/bind
1805 - newins "${FILESDIR}"/named.cache-r3 named.cache
1806 -
1807 - insinto /var/bind/pri
1808 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
1809 -
1810 - newinitd "${FILESDIR}"/named.init-r14 named
1811 - newconfd "${FILESDIR}"/named.confd-r7 named
1812 -
1813 - newenvd "${FILESDIR}"/10bind.env 10bind
1814 -
1815 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
1816 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
1817 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
1818 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
1819 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
1820 - for tool in dsfromkey importkey keyfromlabel keygen \
1821 - revoke settime signzone verify; do
1822 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
1823 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
1824 - done
1825 -
1826 - # bug 405251, library archives aren't properly handled by --enable/disable-static
1827 - if ! use static-libs; then
1828 - find "${ED}" -type f -name '*.a' -delete || die
1829 - fi
1830 -
1831 - # bug 405251
1832 - find "${ED}" -type f -name '*.la' -delete || die
1833 -
1834 - use python && python_foreach_impl python_install
1835 -
1836 - # bug 450406
1837 - dosym named.cache /var/bind/root.cache
1838 -
1839 - dosym ../../var/bind/pri /etc/bind/pri
1840 - dosym ../../var/bind/sec /etc/bind/sec
1841 - dosym ../../var/bind/dyn /etc/bind/dyn
1842 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
1843 -
1844 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
1845 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1846 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
1847 - fperms 0750 /etc/bind /var/bind/pri
1848 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
1849 -
1850 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
1851 - dotmpfiles "${FILESDIR}"/named.conf
1852 - exeinto /usr/libexec
1853 - doexe "${FILESDIR}/generate-rndc-key.sh"
1854 -}
1855 -
1856 -python_install() {
1857 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
1858 - emake DESTDIR="${D}" install
1859 - python_scriptinto /usr/sbin
1860 - python_doscript dnssec-{checkds,coverage}
1861 - python_optimize
1862 - popd >/dev/null || die
1863 -}
1864 -
1865 -pkg_postinst() {
1866 - tmpfiles_process named.conf
1867 -
1868 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
1869 - einfo "Using /dev/urandom for generating rndc.key"
1870 - /usr/sbin/rndc-confgen -a
1871 - chown root:named /etc/bind/rndc.key || die
1872 - chmod 0640 /etc/bind/rndc.key || die
1873 - fi
1874 -
1875 - einfo
1876 - einfo "You can edit /etc/conf.d/named to customize named settings"
1877 - einfo
1878 - use mysql || use postgres || use ldap && {
1879 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
1880 - elog "uncomment the specified rc_named_* lines in your"
1881 - elog "/etc/conf.d/named config to ensure they'll start before bind"
1882 - einfo
1883 - }
1884 - einfo "If you'd like to run bind in a chroot AND this is a new"
1885 - einfo "install OR your bind doesn't already run in a chroot:"
1886 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
1887 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
1888 - einfo
1889 -
1890 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
1891 - if [[ -n ${CHROOT} ]]; then
1892 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1893 - elog "To enable the old behaviour (without using mount) uncomment the"
1894 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1895 - elog "If you decide to use the new/default method, ensure to make backup"
1896 - elog "first and merge your existing configs/zones to /etc/bind and"
1897 - elog "/var/bind because bind will now mount the needed directories into"
1898 - elog "the chroot dir."
1899 - fi
1900 -}
1901 -
1902 -pkg_config() {
1903 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
1904 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
1905 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
1906 -
1907 - if [[ -z "${CHROOT}" ]]; then
1908 - eerror "This config script is designed to automate setting up"
1909 - eerror "a chrooted bind/named. To do so, please first uncomment"
1910 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
1911 - die "Unset CHROOT"
1912 - fi
1913 - if [[ -d "${CHROOT}" ]]; then
1914 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
1915 - ewarn "To enable the old behaviour (without using mount) uncomment the"
1916 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
1917 - ewarn
1918 - ewarn "${CHROOT} already exists... some things might become overridden"
1919 - ewarn "press CTRL+C if you don't want to continue"
1920 - sleep 10
1921 - fi
1922 -
1923 - echo; einfo "Setting up the chroot directory..."
1924 -
1925 - mkdir -m 0750 -p ${CHROOT} || die
1926 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
1927 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
1928 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
1929 -
1930 - chown root:named \
1931 - ${CHROOT} \
1932 - ${CHROOT}/var/{bind,log/named} \
1933 - ${CHROOT}/run/named/ \
1934 - ${CHROOT}/etc/bind \
1935 - || die
1936 -
1937 - mknod ${CHROOT}/dev/null c 1 3 || die
1938 - chmod 0666 ${CHROOT}/dev/null || die
1939 -
1940 - mknod ${CHROOT}/dev/zero c 1 5 || die
1941 - chmod 0666 ${CHROOT}/dev/zero || die
1942 -
1943 - mknod ${CHROOT}/dev/urandom c 1 9 || die
1944 - chmod 0666 ${CHROOT}/dev/urandom || die
1945 -
1946 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
1947 - cp -a /etc/bind ${CHROOT}/etc/ || die
1948 - cp -a /var/bind ${CHROOT}/var/ || die
1949 - fi
1950 -
1951 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
1952 - if use geoip; then
1953 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
1954 - elif use geoip2; then
1955 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
1956 - fi
1957 - fi
1958 -
1959 - elog "You may need to add the following line to your syslog-ng.conf:"
1960 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
1961 -}
1962
1963 diff --git a/net-dns/bind/bind-9.16.32.ebuild b/net-dns/bind/bind-9.16.32.ebuild
1964 deleted file mode 100644
1965 index 010d5b56b5d2..000000000000
1966 --- a/net-dns/bind/bind-9.16.32.ebuild
1967 +++ /dev/null
1968 @@ -1,382 +0,0 @@
1969 -# Copyright 1999-2022 Gentoo Authors
1970 -# Distributed under the terms of the GNU General Public License v2
1971 -
1972 -# Re dlz/mysql and threads, needs to be verified..
1973 -# MySQL uses thread local storage in its C api. Thus MySQL
1974 -# requires that each thread of an application execute a MySQL
1975 -# thread initialization to setup the thread local storage.
1976 -# This is impossible to do safely while staying within the DLZ
1977 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
1978 -# Because of this BIND MUST only run with a single thread when
1979 -# using the MySQL driver.
1980 -
1981 -EAPI=8
1982 -
1983 -PYTHON_COMPAT=( python3_{8..10} )
1984 -
1985 -inherit python-r1 autotools multiprocessing toolchain-funcs flag-o-matic db-use systemd tmpfiles
1986 -
1987 -MY_PV="${PV/_p/-P}"
1988 -MY_PV="${MY_PV/_rc/rc}"
1989 -MY_P="${PN}-${MY_PV}"
1990 -
1991 -SDB_LDAP_VER="1.1.0-fc14"
1992 -
1993 -RRL_PV="${MY_PV}"
1994 -
1995 -# SDB-LDAP: http://bind9-ldap.bayour.com/
1996 -
1997 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
1998 -HOMEPAGE="https://www.isc.org/software/bind https://gitlab.isc.org/isc-projects/bind9"
1999 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.xz
2000 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
2001 -
2002 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
2003 -SLOT="0"
2004 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
2005 -# -berkdb by default re bug #602682
2006 -IUSE="berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
2007 -json ldap lmdb mysql odbc postgres python selinux static-libs test xml +zlib"
2008 -# sdb-ldap - patch broken
2009 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
2010 -RESTRICT="!test? ( test )"
2011 -
2012 -# Upstream dropped the old geoip library, but the BIND configuration for using
2013 -# GeoIP remained the same.
2014 -REQUIRED_USE="
2015 - postgres? ( dlz )
2016 - berkdb? ( dlz )
2017 - mysql? ( dlz )
2018 - odbc? ( dlz )
2019 - ldap? ( dlz )
2020 - dnsrps? ( dlz )
2021 - python? ( ${PYTHON_REQUIRED_USE} )
2022 -"
2023 -
2024 -DEPEND="
2025 - acct-group/named
2026 - acct-user/named
2027 - berkdb? ( sys-libs/db:= )
2028 - dev-libs/openssl:=[-bindist(-)]
2029 - mysql? ( dev-db/mysql-connector-c:0= )
2030 - odbc? ( >=dev-db/unixODBC-2.2.6 )
2031 - ldap? ( net-nds/openldap:= )
2032 - postgres? ( dev-db/postgresql:= )
2033 - caps? ( >=sys-libs/libcap-2.1.0 )
2034 - xml? ( dev-libs/libxml2 )
2035 - geoip? ( dev-libs/libmaxminddb:= )
2036 - geoip2? ( dev-libs/libmaxminddb:= )
2037 - gssapi? ( virtual/krb5 )
2038 - json? ( dev-libs/json-c:= )
2039 - lmdb? ( dev-db/lmdb:= )
2040 - zlib? ( sys-libs/zlib )
2041 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c:= )
2042 - python? (
2043 - ${PYTHON_DEPS}
2044 - dev-python/ply[${PYTHON_USEDEP}]
2045 - )
2046 - dev-libs/libuv:=
2047 -"
2048 -
2049 -RDEPEND="${DEPEND}
2050 - selinux? ( sec-policy/selinux-bind )
2051 - sys-process/psmisc"
2052 -
2053 -BDEPEND="
2054 - test? (
2055 - dev-util/cmocka
2056 - dev-util/kyua
2057 - )
2058 -"
2059 -
2060 -S="${WORKDIR}/${MY_P}"
2061 -
2062 -PATCHES=(
2063 - "${FILESDIR}/ldap-library-path-on-multilib-machines.patch"
2064 -)
2065 -
2066 -src_prepare() {
2067 - default
2068 -
2069 - # Should be installed by bind-tools
2070 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
2071 -
2072 - # bug #220361
2073 - rm aclocal.m4 || die
2074 - rm -rf libtool.m4/ || die
2075 - eautoreconf
2076 -
2077 - use python && python_copy_sources
2078 -}
2079 -
2080 -src_configure() {
2081 - bind_configure --without-python
2082 - use python && python_foreach_impl python_configure
2083 -}
2084 -
2085 -bind_configure() {
2086 - local myeconfargs=(
2087 - AR="$(type -P $(tc-getAR))"
2088 - --prefix="${EPREFIX}"/usr
2089 - --sysconfdir=/etc/bind
2090 - --localstatedir=/var
2091 - --with-libtool
2092 - --enable-full-report
2093 - --without-readline
2094 - --with-openssl="${ESYSROOT}"/usr
2095 - $(use_with test cmocka)
2096 - # Removed in 9.17, drags in libunwind dependency too
2097 - --disable-backtrace
2098 - $(use_enable caps linux-caps)
2099 - $(use_enable dnsrps)
2100 - $(use_enable dnstap)
2101 - $(use_enable fixed-rrset)
2102 - $(use_with berkdb dlz-bdb "${ESYSROOT}"/usr)
2103 - $(use_with dlz dlopen)
2104 - $(use_with dlz dlz-filesystem)
2105 - $(use_with dlz dlz-stub)
2106 - $(use_with gssapi)
2107 - $(use_with json json-c)
2108 - $(use_with ldap dlz-ldap)
2109 - $(use_with mysql dlz-mysql)
2110 - $(use_with odbc dlz-odbc)
2111 - $(use_with postgres dlz-postgres)
2112 - $(use_with lmdb)
2113 - $(use_with xml libxml2)
2114 - $(use_with zlib)
2115 - "${@}"
2116 - )
2117 -
2118 - # This is for users to start to migrate back to USE=geoip, rather than
2119 - # USE=geoip2
2120 - if use geoip ; then
2121 - myeconfargs+=( $(use_with geoip maxminddb) --enable-geoip )
2122 - elif use geoip2 ; then
2123 - # Added 2020/09/30
2124 - # Remove USE=geoip2 support after 2020/03/01
2125 - ewarn "USE=geoip2 is deprecated; update your USE flags!"
2126 - myeconfargs+=( $(use_with geoip2 maxminddb) --enable-geoip )
2127 - else
2128 - myeconfargs+=( --without-maxminddb --disable-geoip )
2129 - fi
2130 -
2131 - # bug #158664
2132 - #gcc-specs-ssp && replace-flags -O[23s] -O
2133 -
2134 - # To include db.h from proper path
2135 - use berkdb && append-flags "-I$(db_includedir)"
2136 -
2137 - export BUILD_CC=$(tc-getBUILD_CC)
2138 - econf "${myeconfargs[@]}"
2139 -
2140 - # bug #151839
2141 - echo '#undef SO_BSDCOMPAT' >> config.h || die
2142 -}
2143 -
2144 -python_configure() {
2145 - pushd "${BUILD_DIR}" >/dev/null || die
2146 - bind_configure --with-python
2147 - popd >/dev/null || die
2148 -}
2149 -
2150 -src_compile() {
2151 - default
2152 - use python && python_foreach_impl python_compile
2153 -}
2154 -
2155 -python_compile() {
2156 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
2157 - emake
2158 - popd >/dev/null || die
2159 -}
2160 -
2161 -src_test() {
2162 - # system tests ('emake test') require network configuration for IPs etc
2163 - # so we run the unit tests instead.
2164 - TEST_PARALLEL_JOBS="$(makeopts_jobs)" emake unit
2165 -}
2166 -
2167 -src_install() {
2168 - default
2169 -
2170 - dodoc CHANGES README
2171 -
2172 - if use doc; then
2173 - docinto misc
2174 - dodoc -r doc/misc/
2175 -
2176 - # might a 'html' useflag make sense?
2177 - docinto html
2178 - dodoc -r doc/arm/
2179 -
2180 - docinto contrib
2181 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
2182 -
2183 - # some handy-dandy dynamic dns examples
2184 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
2185 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
2186 - popd 1>/dev/null || die
2187 - fi
2188 -
2189 - insinto /etc/bind
2190 - newins "${FILESDIR}"/named.conf-r8 named.conf
2191 -
2192 - # ftp://ftp.rs.internic.net/domain/named.cache:
2193 - insinto /var/bind
2194 - newins "${FILESDIR}"/named.cache-r3 named.cache
2195 -
2196 - insinto /var/bind/pri
2197 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
2198 -
2199 - newinitd "${FILESDIR}"/named.init-r14 named
2200 - newconfd "${FILESDIR}"/named.confd-r7 named
2201 -
2202 - newenvd "${FILESDIR}"/10bind.env 10bind
2203 -
2204 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
2205 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup,delv,nsupdate}.1* || die
2206 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
2207 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
2208 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
2209 - for tool in dsfromkey importkey keyfromlabel keygen \
2210 - revoke settime signzone verify; do
2211 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
2212 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
2213 - done
2214 -
2215 - # bug 405251, library archives aren't properly handled by --enable/disable-static
2216 - if ! use static-libs; then
2217 - find "${ED}" -type f -name '*.a' -delete || die
2218 - fi
2219 -
2220 - # bug 405251
2221 - find "${ED}" -type f -name '*.la' -delete || die
2222 -
2223 - use python && python_foreach_impl python_install
2224 -
2225 - # bug 450406
2226 - dosym named.cache /var/bind/root.cache
2227 -
2228 - dosym ../../var/bind/pri /etc/bind/pri
2229 - dosym ../../var/bind/sec /etc/bind/sec
2230 - dosym ../../var/bind/dyn /etc/bind/dyn
2231 - keepdir /var/bind/{pri,sec,dyn} /var/log/named
2232 -
2233 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
2234 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
2235 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
2236 - fperms 0750 /etc/bind /var/bind/pri
2237 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
2238 -
2239 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
2240 - dotmpfiles "${FILESDIR}"/named.conf
2241 - exeinto /usr/libexec
2242 - doexe "${FILESDIR}/generate-rndc-key.sh"
2243 -}
2244 -
2245 -python_install() {
2246 - pushd "${BUILD_DIR}"/bin/python >/dev/null || die
2247 - emake DESTDIR="${D}" install
2248 - python_scriptinto /usr/sbin
2249 - python_doscript dnssec-{checkds,coverage}
2250 - python_optimize
2251 - popd >/dev/null || die
2252 -}
2253 -
2254 -pkg_postinst() {
2255 - tmpfiles_process named.conf
2256 -
2257 - if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
2258 - einfo "Using /dev/urandom for generating rndc.key"
2259 - /usr/sbin/rndc-confgen -a
2260 - chown root:named /etc/bind/rndc.key || die
2261 - chmod 0640 /etc/bind/rndc.key || die
2262 - fi
2263 -
2264 - einfo
2265 - einfo "You can edit /etc/conf.d/named to customize named settings"
2266 - einfo
2267 - use mysql || use postgres || use ldap && {
2268 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
2269 - elog "uncomment the specified rc_named_* lines in your"
2270 - elog "/etc/conf.d/named config to ensure they'll start before bind"
2271 - einfo
2272 - }
2273 - einfo "If you'd like to run bind in a chroot AND this is a new"
2274 - einfo "install OR your bind doesn't already run in a chroot:"
2275 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
2276 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
2277 - einfo
2278 -
2279 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
2280 - if [[ -n ${CHROOT} ]]; then
2281 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
2282 - elog "To enable the old behaviour (without using mount) uncomment the"
2283 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
2284 - elog "If you decide to use the new/default method, ensure to make backup"
2285 - elog "first and merge your existing configs/zones to /etc/bind and"
2286 - elog "/var/bind because bind will now mount the needed directories into"
2287 - elog "the chroot dir."
2288 - fi
2289 -}
2290 -
2291 -pkg_config() {
2292 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
2293 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
2294 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
2295 -
2296 - if [[ -z "${CHROOT}" ]]; then
2297 - eerror "This config script is designed to automate setting up"
2298 - eerror "a chrooted bind/named. To do so, please first uncomment"
2299 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
2300 - die "Unset CHROOT"
2301 - fi
2302 - if [[ -d "${CHROOT}" ]]; then
2303 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
2304 - ewarn "To enable the old behaviour (without using mount) uncomment the"
2305 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
2306 - ewarn
2307 - ewarn "${CHROOT} already exists... some things might become overridden"
2308 - ewarn "press CTRL+C if you don't want to continue"
2309 - sleep 10
2310 - fi
2311 -
2312 - echo; einfo "Setting up the chroot directory..."
2313 -
2314 - mkdir -m 0750 -p ${CHROOT} || die
2315 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
2316 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
2317 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
2318 -
2319 - chown root:named \
2320 - ${CHROOT} \
2321 - ${CHROOT}/var/{bind,log/named} \
2322 - ${CHROOT}/run/named/ \
2323 - ${CHROOT}/etc/bind \
2324 - || die
2325 -
2326 - mknod ${CHROOT}/dev/null c 1 3 || die
2327 - chmod 0666 ${CHROOT}/dev/null || die
2328 -
2329 - mknod ${CHROOT}/dev/zero c 1 5 || die
2330 - chmod 0666 ${CHROOT}/dev/zero || die
2331 -
2332 - mknod ${CHROOT}/dev/urandom c 1 9 || die
2333 - chmod 0666 ${CHROOT}/dev/urandom || die
2334 -
2335 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
2336 - cp -a /etc/bind ${CHROOT}/etc/ || die
2337 - cp -a /var/bind ${CHROOT}/var/ || die
2338 - fi
2339 -
2340 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
2341 - if use geoip; then
2342 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
2343 - elif use geoip2; then
2344 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
2345 - fi
2346 - fi
2347 -
2348 - elog "You may need to add the following line to your syslog-ng.conf:"
2349 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
2350 -}
2351
2352 diff --git a/net-dns/bind/files/bind-9.16.29-fortify-source-3.patch b/net-dns/bind/files/bind-9.16.29-fortify-source-3.patch
2353 deleted file mode 100644
2354 index d084d6e62ce8..000000000000
2355 --- a/net-dns/bind/files/bind-9.16.29-fortify-source-3.patch
2356 +++ /dev/null
2357 @@ -1,35 +0,0 @@
2358 -https://gitlab.isc.org/isc-projects/bind9/-/commit/b6670787d25743ddf39dfe8e615828efc928f50d
2359 -https://gitlab.isc.org/isc-projects/bind9/-/issues/3351
2360 -https://bugs.gentoo.org/847295
2361 -
2362 -From: Evan Hunt <each@×××.org>
2363 -Date: Fri, 13 May 2022 19:59:58 -0700
2364 -Subject: [PATCH] prevent a possible buffer overflow in configuration check
2365 -
2366 -corrected code that could have allowed a buffer overfow while
2367 -parsing named.conf.
2368 -
2369 -(cherry picked from commit 921043b54161c7a3e6dc4036b038ca4dbc5fe472)
2370 ---- a/lib/bind9/check.c
2371 -+++ b/lib/bind9/check.c
2372 -@@ -2500,8 +2500,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
2373 - } else if (dns_name_isula(zname)) {
2374 - ula = true;
2375 - }
2376 -- tmp += strlen(tmp);
2377 - len -= strlen(tmp);
2378 -+ tmp += strlen(tmp);
2379 - (void)snprintf(tmp, len, "%u/%s", zclass,
2380 - (ztype == CFG_ZONE_INVIEW) ? target
2381 - : (viewname != NULL) ? viewname
2382 -@@ -3247,8 +3247,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
2383 - char *tmp = keydirbuf;
2384 - size_t len = sizeof(keydirbuf);
2385 - dns_name_format(zname, keydirbuf, sizeof(keydirbuf));
2386 -- tmp += strlen(tmp);
2387 - len -= strlen(tmp);
2388 -+ tmp += strlen(tmp);
2389 - (void)snprintf(tmp, len, "/%s", (dir == NULL) ? "(null)" : dir);
2390 - tresult = keydirexist(zconfig, (const char *)keydirbuf,
2391 - kaspname, keydirs, logctx, mctx);
2392 -GitLab