Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/bind/
Date: Fri, 27 Sep 2019 18:00:35
Message-Id: 1569607216.504550c59d28f3bfd2706cc429f654d090f827c4.zlogene@gentoo
1 commit: 504550c59d28f3bfd2706cc429f654d090f827c4
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 27 18:00:16 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 27 18:00:16 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=504550c5
7
8 net-dns/bind: Drop old
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 2 -
14 net-dns/bind/bind-9.15.2.ebuild | 380 ----------------------------------------
15 net-dns/bind/bind-9.15.3.ebuild | 380 ----------------------------------------
16 3 files changed, 762 deletions(-)
17
18 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
19 index 2d511d14c03..4f56c02633a 100644
20 --- a/net-dns/bind/Manifest
21 +++ b/net-dns/bind/Manifest
22 @@ -1,7 +1,5 @@
23 DIST bind-9.14.4.tar.gz 6295768 BLAKE2B c433344d2b431ebb2e9920a6d0af1dc6cf65df1e347c2a77882a7dd2ea165f9a91324edbd7171e6bab7487e13049e38d23a514323f1b4cc74a6ce1f5377f1589 SHA512 f5f4dc9b6a1d60838b59ce57ad37dc1e51fa26719aa203405a73850780f06bdc6ecea71c762efd464f946bdcce5a7c324de98caea36d2fe2781cce116fcd4932
24 DIST bind-9.14.5.tar.gz 6313555 BLAKE2B 46bde0f6f78ee15357bca0129022a6dd88941f633513a8d768b53d9c3bc0f4f7af4d8dc8cc4b1d6119d148700703b2fa27b6834671dcb5df9b544e4a2025452b SHA512 1b18eda5dea639f9b34e1c41b534704b0d5f64c036b766c9cfccf9bbeb586ce4ea7f0d098a5b2747e88aa403e48ad8ae0b6e560e93348f0dc7616f914671d084
25 DIST bind-9.14.6.tar.gz 6314291 BLAKE2B f114cf3516e863656d1b0f3bbc634c5b5f5c539ffa4591cbe09f7cc1e26f30b0bff2d4913297b73304387944ba249b847b7983d4279d625645ec64387a0121ed SHA512 129cb6c8e18fabf9f9fda91afa06fccf65e7009b2e8f9f7c1960f0039d35c22614986fbea36ca0b7bbc74995e380df083a641cf51601a0cf0c87e7dbb77a0366
26 -DIST bind-9.15.2.tar.gz 6303402 BLAKE2B c8a16a80c9f690adb61284b27a619b4dbe120eadad7b38138da099a1d5a1171443da6e1c717e876e2739ee4d543cb00665c07fac460a256b178bace96510f4a3 SHA512 df7499bc3eeabf39eebfe346efe15631929cd7287e12fc6b04baea90c332a02fc4b9a8d40f043e308ebd61a82baafb5cf9e69654511dc9a2dcb7415597d5a646
27 -DIST bind-9.15.3.tar.gz 6296471 BLAKE2B 30815330f4273b7b6df34857fdd7d03490e03e3d340986c01c1d382927480bcd6c01cefdb689c7c397cbb1495b1f06503dbeb425a823a5c676211d45b7b6663a SHA512 2c594c48f1e06c6ab2e0977473fbdb8d3bdbf089bc5c727424510f1bec3fc6dac9a21206724e886f6a88d1e8098aa3b03aed226a92ae91a6c7f3528187288cc0
28 DIST bind-9.15.4.tar.gz 6307930 BLAKE2B e57c5874b18abb8daddee03ecca35ecc422106428b408f078b3e7beb42d986165f853c985996b70343c0cea113389edd2ea4fc53440328b352818def913d4bd7 SHA512 bd6ac320c553253f4c6befe9c5237f31e1172c35b14e34946b5082b333621f246755b2d2856542bee68f4cc411e955ac7dd4c84e2c7155949cbcfe469b5ae709
29 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
30
31 diff --git a/net-dns/bind/bind-9.15.2.ebuild b/net-dns/bind/bind-9.15.2.ebuild
32 deleted file mode 100644
33 index 72177642171..00000000000
34 --- a/net-dns/bind/bind-9.15.2.ebuild
35 +++ /dev/null
36 @@ -1,380 +0,0 @@
37 -# Copyright 1999-2019 Gentoo Authors
38 -# Distributed under the terms of the GNU General Public License v2
39 -
40 -# Re dlz/mysql and threads, needs to be verified..
41 -# MySQL uses thread local storage in its C api. Thus MySQL
42 -# requires that each thread of an application execute a MySQL
43 -# thread initialization to setup the thread local storage.
44 -# This is impossible to do safely while staying within the DLZ
45 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
46 -# Because of this BIND MUST only run with a single thread when
47 -# using the MySQL driver.
48 -
49 -EAPI=7
50 -
51 -PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
52 -
53 -inherit python-r1 eutils autotools toolchain-funcs flag-o-matic multilib db-use user systemd
54 -
55 -MY_PV="${PV/_p/-P}"
56 -MY_PV="${MY_PV/_rc/rc}"
57 -MY_P="${PN}-${MY_PV}"
58 -
59 -SDB_LDAP_VER="1.1.0-fc14"
60 -
61 -RRL_PV="${MY_PV}"
62 -
63 -# SDB-LDAP: http://bind9-ldap.bayour.com/
64 -
65 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
66 -HOMEPAGE="https://www.isc.org/software/bind"
67 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.gz
68 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
69 -# sdb-ldap? (
70 -# http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2
71 -# )"
72 -
73 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
74 -SLOT="0"
75 -KEYWORDS=""
76 -# -berkdb by default re bug 602682
77 -IUSE="-berkdb +caps dlz dnstap doc dnsrps fixed-rrset geoip gost gssapi
78 -json ldap libressl lmdb mysql odbc postgres python selinux static-libs
79 -urandom xml +zlib"
80 -# sdb-ldap - patch broken
81 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
82 -
83 -REQUIRED_USE="
84 - postgres? ( dlz )
85 - berkdb? ( dlz )
86 - mysql? ( dlz )
87 - odbc? ( dlz )
88 - ldap? ( dlz )
89 - python? ( ${PYTHON_REQUIRED_USE} )"
90 -# sdb-ldap? ( dlz )
91 -
92 -DEPEND="!libressl? ( dev-libs/openssl:0[-bindist] )
93 - libressl? ( dev-libs/libressl )
94 - mysql? ( dev-db/mysql-connector-c:0= )
95 - odbc? ( >=dev-db/unixODBC-2.2.6 )
96 - ldap? ( net-nds/openldap )
97 - postgres? ( dev-db/postgresql:= )
98 - caps? ( >=sys-libs/libcap-2.1.0 )
99 - xml? ( dev-libs/libxml2 )
100 - geoip? ( >=dev-libs/geoip-1.4.6 )
101 - gssapi? ( virtual/krb5 )
102 - json? ( dev-libs/json-c:= )
103 - lmdb? ( dev-db/lmdb )
104 - zlib? ( sys-libs/zlib )
105 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c )
106 - python? (
107 - ${PYTHON_DEPS}
108 - dev-python/ply[${PYTHON_USEDEP}]
109 - )"
110 -# sdb-ldap? ( net-nds/openldap )
111 -
112 -RDEPEND="${DEPEND}
113 - selinux? ( sec-policy/selinux-bind )
114 - || ( sys-process/psmisc >=sys-freebsd/freebsd-ubin-9.0_rc )"
115 -
116 -S="${WORKDIR}/${MY_P}"
117 -
118 -# bug 479092, requires networking
119 -RESTRICT="test"
120 -
121 -pkg_setup() {
122 - ebegin "Creating named group and user"
123 - enewgroup named 40
124 - enewuser named 40 -1 /etc/bind named
125 - eend ${?}
126 -}
127 -
128 -src_prepare() {
129 - default
130 -
131 - export LDFLAGS="${LDFLAGS} -L${EPREFIX}/usr/$(get_libdir)"
132 -
133 - # Adjusting PATHs in manpages
134 - for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
135 - sed -i \
136 - -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
137 - -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
138 - -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
139 - "${i}" || die "sed failed, ${i} doesn't exist"
140 - done
141 -
142 -# if use dlz; then
143 -# # sdb-ldap patch as per bug #160567
144 -# # Upstream URL: http://bind9-ldap.bayour.com/
145 -# # New patch take from bug 302735
146 -# if use sdb-ldap; then
147 -# epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
148 -# cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
149 -# cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
150 -# cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
151 -# fi
152 -# fi
153 -
154 - # should be installed by bind-tools
155 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
156 -
157 - # Disable tests for now, bug 406399
158 - sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
159 -
160 - # bug #220361
161 - rm aclocal.m4 || die
162 - rm -rf libtool.m4/ || die
163 - eautoreconf
164 -}
165 -
166 -src_configure() {
167 - local myeconfargs=(
168 - --sysconfdir=/etc/bind
169 - --localstatedir=/var
170 - --with-libtool
171 - --enable-full-report
172 - --without-readline
173 - --with-openssl="${EPREFIX}"/usr
174 - $(use_enable caps linux-caps)
175 - $(use_enable dnsrps)
176 - $(use_enable dnstap)
177 - $(use_enable fixed-rrset)
178 - # $(use_enable static-libs static)
179 - $(use_with berkdb dlz-bdb)
180 - $(use_with dlz dlopen)
181 - $(use_with dlz dlz-filesystem)
182 - $(use_with dlz dlz-stub)
183 - $(use_with gssapi)
184 - $(use_with json libjson)
185 - $(use_with ldap dlz-ldap)
186 - $(use_with mysql dlz-mysql)
187 - $(use_with odbc dlz-odbc)
188 - $(use_with postgres dlz-postgres)
189 - $(use_with lmdb)
190 - $(use_with python)
191 - $(use_with xml libxml2)
192 - $(use_with zlib)
193 - )
194 -
195 - use geoip && myeconfargs+=( --enable-geoip )
196 -
197 - # bug #158664
198 -# gcc-specs-ssp && replace-flags -O[23s] -O
199 -
200 - # To include db.h from proper path
201 - use berkdb && append-flags "-I$(db_includedir)"
202 -
203 - export BUILD_CC=$(tc-getBUILD_CC)
204 - econf "${myeconfargs[@]}"
205 -
206 - # bug #151839
207 - echo '#undef SO_BSDCOMPAT' >> config.h
208 -}
209 -
210 -src_install() {
211 - default
212 -
213 - dodoc CHANGES README
214 -
215 - if use doc; then
216 - dodoc doc/arm/Bv9ARM.pdf
217 -
218 - docinto misc
219 - dodoc -r doc/misc/
220 -
221 - # might a 'html' useflag make sense?
222 - docinto html
223 - dodoc -r doc/arm/
224 -
225 - docinto contrib
226 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
227 -
228 - # some handy-dandy dynamic dns examples
229 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
230 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
231 - popd 1>/dev/null || die
232 - fi
233 -
234 - insinto /etc/bind
235 - newins "${FILESDIR}"/named.conf-r8 named.conf
236 -
237 - # ftp://ftp.rs.internic.net/domain/named.cache:
238 - insinto /var/bind
239 - newins "${FILESDIR}"/named.cache-r3 named.cache
240 -
241 - insinto /var/bind/pri
242 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
243 -
244 - newinitd "${FILESDIR}"/named.init-r13 named
245 - newconfd "${FILESDIR}"/named.confd-r7 named
246 -
247 - if use gost; then
248 - sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' \
249 - -i "${ED%/}/etc/init.d/named" || die
250 - else
251 - sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' \
252 - -i "${ED%/}/etc/init.d/named" || die
253 - fi
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}.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 - if use python; then
277 - install_python_tools() {
278 - dosbin bin/python/dnssec-{checkds,coverage}
279 - }
280 - python_foreach_impl install_python_tools
281 -
282 - python_replicate_script "${ED}/usr/sbin/dnssec-checkds"
283 - python_replicate_script "${ED}/usr/sbin/dnssec-coverage"
284 - fi
285 -
286 - # bug 450406
287 - dosym named.cache /var/bind/root.cache
288 -
289 - dosym "${ED}"/var/bind/pri /etc/bind/pri
290 - dosym "${ED}"/var/bind/sec /etc/bind/sec
291 - dosym "${ED}"/var/bind/dyn /etc/bind/dyn
292 - keepdir /var/bind/{pri,sec,dyn}
293 -
294 - dodir /var/log/named
295 -
296 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
297 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
298 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
299 - fperms 0750 /etc/bind /var/bind/pri
300 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
301 -
302 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
303 - systemd_dotmpfilesd "${FILESDIR}"/named.conf
304 - exeinto /usr/libexec
305 - doexe "${FILESDIR}/generate-rndc-key.sh"
306 -}
307 -
308 -pkg_postinst() {
309 - if [ ! -f '/etc/bind/rndc.key' ]; then
310 - if use urandom; then
311 - einfo "Using /dev/urandom for generating rndc.key"
312 - /usr/sbin/rndc-confgen -r /dev/urandom -a
313 - echo
314 - else
315 - einfo "Using /dev/random for generating rndc.key"
316 - /usr/sbin/rndc-confgen -a
317 - echo
318 - fi
319 - chown root:named /etc/bind/rndc.key || die
320 - chmod 0640 /etc/bind/rndc.key || die
321 - fi
322 -
323 - einfo
324 - einfo "You can edit /etc/conf.d/named to customize named settings"
325 - einfo
326 - use mysql || use postgres || use ldap && {
327 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
328 - elog "uncomment the specified rc_named_* lines in your"
329 - elog "/etc/conf.d/named config to ensure they'll start before bind"
330 - einfo
331 - }
332 - einfo "If you'd like to run bind in a chroot AND this is a new"
333 - einfo "install OR your bind doesn't already run in a chroot:"
334 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
335 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
336 - einfo
337 -
338 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
339 - if [[ -n ${CHROOT} ]]; then
340 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
341 - elog "To enable the old behaviour (without using mount) uncomment the"
342 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
343 - elog "If you decide to use the new/default method, ensure to make backup"
344 - elog "first and merge your existing configs/zones to /etc/bind and"
345 - elog "/var/bind because bind will now mount the needed directories into"
346 - elog "the chroot dir."
347 - fi
348 -}
349 -
350 -pkg_config() {
351 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
352 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
353 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
354 -
355 - if [[ -z "${CHROOT}" ]]; then
356 - eerror "This config script is designed to automate setting up"
357 - eerror "a chrooted bind/named. To do so, please first uncomment"
358 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
359 - die "Unset CHROOT"
360 - fi
361 - if [[ -d "${CHROOT}" ]]; then
362 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
363 - ewarn "To enable the old behaviour (without using mount) uncomment the"
364 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
365 - ewarn
366 - ewarn "${CHROOT} already exists... some things might become overridden"
367 - ewarn "press CTRL+C if you don't want to continue"
368 - sleep 10
369 - fi
370 -
371 - echo; einfo "Setting up the chroot directory..."
372 -
373 - mkdir -m 0750 -p ${CHROOT} || die
374 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
375 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
376 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
377 - # As of bind 9.8.0
378 - if has_version net-dns/bind[gost]; then
379 - mkdir -m 0755 -p ${CHROOT}/usr/$(get_libdir)/engines || die
380 - if [ "$(get_libdir)" = "lib64" ]; then
381 - ln -s lib64 ${CHROOT}/usr/lib || die
382 - fi
383 - fi
384 - chown root:named \
385 - ${CHROOT} \
386 - ${CHROOT}/var/{bind,log/named} \
387 - ${CHROOT}/run/named/ \
388 - ${CHROOT}/etc/bind \
389 - || die
390 -
391 - mknod ${CHROOT}/dev/null c 1 3 || die
392 - chmod 0666 ${CHROOT}/dev/null || die
393 -
394 - mknod ${CHROOT}/dev/zero c 1 5 || die
395 - chmod 0666 ${CHROOT}/dev/zero || die
396 -
397 - if use urandom; then
398 - mknod ${CHROOT}/dev/urandom c 1 9 || die
399 - chmod 0666 ${CHROOT}/dev/urandom || die
400 - else
401 - mknod ${CHROOT}/dev/random c 1 8 || die
402 - chmod 0666 ${CHROOT}/dev/random || die
403 - fi
404 -
405 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
406 - cp -a /etc/bind ${CHROOT}/etc/ || die
407 - cp -a /var/bind ${CHROOT}/var/ || die
408 - fi
409 -
410 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
411 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
412 - fi
413 -
414 - elog "You may need to add the following line to your syslog-ng.conf:"
415 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
416 -}
417
418 diff --git a/net-dns/bind/bind-9.15.3.ebuild b/net-dns/bind/bind-9.15.3.ebuild
419 deleted file mode 100644
420 index bfdb5db3d25..00000000000
421 --- a/net-dns/bind/bind-9.15.3.ebuild
422 +++ /dev/null
423 @@ -1,380 +0,0 @@
424 -# Copyright 1999-2019 Gentoo Authors
425 -# Distributed under the terms of the GNU General Public License v2
426 -
427 -# Re dlz/mysql and threads, needs to be verified..
428 -# MySQL uses thread local storage in its C api. Thus MySQL
429 -# requires that each thread of an application execute a MySQL
430 -# thread initialization to setup the thread local storage.
431 -# This is impossible to do safely while staying within the DLZ
432 -# driver API. This is a limitation caused by MySQL, and not the DLZ API.
433 -# Because of this BIND MUST only run with a single thread when
434 -# using the MySQL driver.
435 -
436 -EAPI=7
437 -
438 -PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
439 -
440 -inherit python-r1 eutils autotools toolchain-funcs flag-o-matic multilib db-use user systemd
441 -
442 -MY_PV="${PV/_p/-P}"
443 -MY_PV="${MY_PV/_rc/rc}"
444 -MY_P="${PN}-${MY_PV}"
445 -
446 -SDB_LDAP_VER="1.1.0-fc14"
447 -
448 -RRL_PV="${MY_PV}"
449 -
450 -# SDB-LDAP: http://bind9-ldap.bayour.com/
451 -
452 -DESCRIPTION="Berkeley Internet Name Domain - Name Server"
453 -HOMEPAGE="https://www.isc.org/software/bind"
454 -SRC_URI="https://downloads.isc.org/isc/bind9/${PV}/${P}.tar.gz
455 - doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
456 -# sdb-ldap? (
457 -# http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2
458 -# )"
459 -
460 -LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
461 -SLOT="0"
462 -KEYWORDS=""
463 -# -berkdb by default re bug 602682
464 -IUSE="-berkdb +caps dlz dnstap doc dnsrps fixed-rrset geoip gost gssapi
465 -json ldap libressl lmdb mysql odbc postgres python selinux static-libs
466 -urandom xml +zlib"
467 -# sdb-ldap - patch broken
468 -# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
469 -
470 -REQUIRED_USE="
471 - postgres? ( dlz )
472 - berkdb? ( dlz )
473 - mysql? ( dlz )
474 - odbc? ( dlz )
475 - ldap? ( dlz )
476 - python? ( ${PYTHON_REQUIRED_USE} )"
477 -# sdb-ldap? ( dlz )
478 -
479 -DEPEND="!libressl? ( dev-libs/openssl:0[-bindist] )
480 - libressl? ( dev-libs/libressl )
481 - mysql? ( dev-db/mysql-connector-c:0= )
482 - odbc? ( >=dev-db/unixODBC-2.2.6 )
483 - ldap? ( net-nds/openldap )
484 - postgres? ( dev-db/postgresql:= )
485 - caps? ( >=sys-libs/libcap-2.1.0 )
486 - xml? ( dev-libs/libxml2 )
487 - geoip? ( >=dev-libs/geoip-1.4.6 )
488 - gssapi? ( virtual/krb5 )
489 - json? ( dev-libs/json-c:= )
490 - lmdb? ( dev-db/lmdb )
491 - zlib? ( sys-libs/zlib )
492 - dnstap? ( dev-libs/fstrm dev-libs/protobuf-c )
493 - python? (
494 - ${PYTHON_DEPS}
495 - dev-python/ply[${PYTHON_USEDEP}]
496 - )"
497 -# sdb-ldap? ( net-nds/openldap )
498 -
499 -RDEPEND="${DEPEND}
500 - selinux? ( sec-policy/selinux-bind )
501 - || ( sys-process/psmisc >=sys-freebsd/freebsd-ubin-9.0_rc )"
502 -
503 -S="${WORKDIR}/${MY_P}"
504 -
505 -# bug 479092, requires networking
506 -RESTRICT="test"
507 -
508 -pkg_setup() {
509 - ebegin "Creating named group and user"
510 - enewgroup named 40
511 - enewuser named 40 -1 /etc/bind named
512 - eend ${?}
513 -}
514 -
515 -src_prepare() {
516 - default
517 -
518 - export LDFLAGS="${LDFLAGS} -L${EPREFIX}/usr/$(get_libdir)"
519 -
520 - # Adjusting PATHs in manpages
521 - for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
522 - sed -i \
523 - -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
524 - -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
525 - -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
526 - "${i}" || die "sed failed, ${i} doesn't exist"
527 - done
528 -
529 -# if use dlz; then
530 -# # sdb-ldap patch as per bug #160567
531 -# # Upstream URL: http://bind9-ldap.bayour.com/
532 -# # New patch take from bug 302735
533 -# if use sdb-ldap; then
534 -# epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
535 -# cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
536 -# cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
537 -# cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
538 -# fi
539 -# fi
540 -
541 - # should be installed by bind-tools
542 - sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
543 -
544 - # Disable tests for now, bug 406399
545 - sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
546 -
547 - # bug #220361
548 - rm aclocal.m4 || die
549 - rm -rf libtool.m4/ || die
550 - eautoreconf
551 -}
552 -
553 -src_configure() {
554 - local myeconfargs=(
555 - --sysconfdir=/etc/bind
556 - --localstatedir=/var
557 - --with-libtool
558 - --enable-full-report
559 - --without-readline
560 - --with-openssl="${EPREFIX}"/usr
561 - $(use_enable caps linux-caps)
562 - $(use_enable dnsrps)
563 - $(use_enable dnstap)
564 - $(use_enable fixed-rrset)
565 - # $(use_enable static-libs static)
566 - $(use_with berkdb dlz-bdb)
567 - $(use_with dlz dlopen)
568 - $(use_with dlz dlz-filesystem)
569 - $(use_with dlz dlz-stub)
570 - $(use_with gssapi)
571 - $(use_with json libjson)
572 - $(use_with ldap dlz-ldap)
573 - $(use_with mysql dlz-mysql)
574 - $(use_with odbc dlz-odbc)
575 - $(use_with postgres dlz-postgres)
576 - $(use_with lmdb)
577 - $(use_with python)
578 - $(use_with xml libxml2)
579 - $(use_with zlib)
580 - )
581 -
582 - use geoip && myeconfargs+=( --enable-geoip )
583 -
584 - # bug #158664
585 -# gcc-specs-ssp && replace-flags -O[23s] -O
586 -
587 - # To include db.h from proper path
588 - use berkdb && append-flags "-I$(db_includedir)"
589 -
590 - export BUILD_CC=$(tc-getBUILD_CC)
591 - econf "${myeconfargs[@]}"
592 -
593 - # bug #151839
594 - echo '#undef SO_BSDCOMPAT' >> config.h
595 -}
596 -
597 -src_install() {
598 - default
599 -
600 - dodoc CHANGES README
601 -
602 - if use doc; then
603 - dodoc doc/arm/Bv9ARM.pdf
604 -
605 - docinto misc
606 - dodoc -r doc/misc/
607 -
608 - # might a 'html' useflag make sense?
609 - docinto html
610 - dodoc -r doc/arm/
611 -
612 - docinto contrib
613 - dodoc contrib/scripts/{nanny.pl,named-bootconf.sh}
614 -
615 - # some handy-dandy dynamic dns examples
616 - pushd "${ED}"/usr/share/doc/${PF} 1>/dev/null || die
617 - tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
618 - popd 1>/dev/null || die
619 - fi
620 -
621 - insinto /etc/bind
622 - newins "${FILESDIR}"/named.conf-r8 named.conf
623 -
624 - # ftp://ftp.rs.internic.net/domain/named.cache:
625 - insinto /var/bind
626 - newins "${FILESDIR}"/named.cache-r3 named.cache
627 -
628 - insinto /var/bind/pri
629 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
630 -
631 - newinitd "${FILESDIR}"/named.init-r13 named
632 - newconfd "${FILESDIR}"/named.confd-r7 named
633 -
634 - if use gost; then
635 - sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' \
636 - -i "${ED%/}/etc/init.d/named" || die
637 - else
638 - sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' \
639 - -i "${ED%/}/etc/init.d/named" || die
640 - fi
641 -
642 - newenvd "${FILESDIR}"/10bind.env 10bind
643 -
644 - # Let's get rid of those tools and their manpages since they're provided by bind-tools
645 - rm -f "${ED}"/usr/share/man/man1/{dig,host,nslookup}.1* || die
646 - rm -f "${ED}"/usr/share/man/man8/nsupdate.8* || die
647 - rm -f "${ED}"/usr/bin/{dig,host,nslookup,nsupdate} || die
648 - rm -f "${ED}"/usr/sbin/{dig,host,nslookup,nsupdate} || die
649 - for tool in dsfromkey importkey keyfromlabel keygen \
650 - revoke settime signzone verify; do
651 - rm -f "${ED}"/usr/{,s}bin/dnssec-"${tool}" || die
652 - rm -f "${ED}"/usr/share/man/man8/dnssec-"${tool}".8* || die
653 - done
654 -
655 - # bug 405251, library archives aren't properly handled by --enable/disable-static
656 - if ! use static-libs; then
657 - find "${ED}" -type f -name '*.a' -delete || die
658 - fi
659 -
660 - # bug 405251
661 - find "${ED}" -type f -name '*.la' -delete || die
662 -
663 - if use python; then
664 - install_python_tools() {
665 - dosbin bin/python/dnssec-{checkds,coverage}
666 - }
667 - python_foreach_impl install_python_tools
668 -
669 - python_replicate_script "${ED%/}/usr/sbin/dnssec-checkds"
670 - python_replicate_script "${ED%/}/usr/sbin/dnssec-coverage"
671 - fi
672 -
673 - # bug 450406
674 - dosym named.cache /var/bind/root.cache
675 -
676 - dosym "${ED}"/var/bind/pri /etc/bind/pri
677 - dosym "${ED}"/var/bind/sec /etc/bind/sec
678 - dosym "${ED}"/var/bind/dyn /etc/bind/dyn
679 - keepdir /var/bind/{pri,sec,dyn}
680 -
681 - dodir /var/log/named
682 -
683 - fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
684 - fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
685 - fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
686 - fperms 0750 /etc/bind /var/bind/pri
687 - fperms 0770 /var/log/named /var/bind/{,sec,dyn}
688 -
689 - systemd_newunit "${FILESDIR}/named.service-r1" named.service
690 - systemd_dotmpfilesd "${FILESDIR}"/named.conf
691 - exeinto /usr/libexec
692 - doexe "${FILESDIR}/generate-rndc-key.sh"
693 -}
694 -
695 -pkg_postinst() {
696 - if [ ! -f '/etc/bind/rndc.key' ]; then
697 - if use urandom; then
698 - einfo "Using /dev/urandom for generating rndc.key"
699 - /usr/sbin/rndc-confgen -r /dev/urandom -a
700 - echo
701 - else
702 - einfo "Using /dev/random for generating rndc.key"
703 - /usr/sbin/rndc-confgen -a
704 - echo
705 - fi
706 - chown root:named /etc/bind/rndc.key || die
707 - chmod 0640 /etc/bind/rndc.key || die
708 - fi
709 -
710 - einfo
711 - einfo "You can edit /etc/conf.d/named to customize named settings"
712 - einfo
713 - use mysql || use postgres || use ldap && {
714 - elog "If your named depends on MySQL/PostgreSQL or LDAP,"
715 - elog "uncomment the specified rc_named_* lines in your"
716 - elog "/etc/conf.d/named config to ensure they'll start before bind"
717 - einfo
718 - }
719 - einfo "If you'd like to run bind in a chroot AND this is a new"
720 - einfo "install OR your bind doesn't already run in a chroot:"
721 - einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
722 - einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
723 - einfo
724 -
725 - CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
726 - if [[ -n ${CHROOT} ]]; then
727 - elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
728 - elog "To enable the old behaviour (without using mount) uncomment the"
729 - elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
730 - elog "If you decide to use the new/default method, ensure to make backup"
731 - elog "first and merge your existing configs/zones to /etc/bind and"
732 - elog "/var/bind because bind will now mount the needed directories into"
733 - elog "the chroot dir."
734 - fi
735 -}
736 -
737 -pkg_config() {
738 - CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
739 - CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
740 - CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
741 -
742 - if [[ -z "${CHROOT}" ]]; then
743 - eerror "This config script is designed to automate setting up"
744 - eerror "a chrooted bind/named. To do so, please first uncomment"
745 - eerror "and set the CHROOT variable in '/etc/conf.d/named'."
746 - die "Unset CHROOT"
747 - fi
748 - if [[ -d "${CHROOT}" ]]; then
749 - ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
750 - ewarn "To enable the old behaviour (without using mount) uncomment the"
751 - ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
752 - ewarn
753 - ewarn "${CHROOT} already exists... some things might become overridden"
754 - ewarn "press CTRL+C if you don't want to continue"
755 - sleep 10
756 - fi
757 -
758 - echo; einfo "Setting up the chroot directory..."
759 -
760 - mkdir -m 0750 -p ${CHROOT} || die
761 - mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
762 - mkdir -m 0750 -p ${CHROOT}/etc/bind || die
763 - mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
764 - # As of bind 9.8.0
765 - if has_version net-dns/bind[gost]; then
766 - mkdir -m 0755 -p ${CHROOT}/usr/$(get_libdir)/engines || die
767 - if [ "$(get_libdir)" = "lib64" ]; then
768 - ln -s lib64 ${CHROOT}/usr/lib || die
769 - fi
770 - fi
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 - if use urandom; then
785 - mknod ${CHROOT}/dev/urandom c 1 9 || die
786 - chmod 0666 ${CHROOT}/dev/urandom || die
787 - else
788 - mknod ${CHROOT}/dev/random c 1 8 || die
789 - chmod 0666 ${CHROOT}/dev/random || die
790 - fi
791 -
792 - if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
793 - cp -a /etc/bind ${CHROOT}/etc/ || die
794 - cp -a /var/bind ${CHROOT}/var/ || die
795 - fi
796 -
797 - if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
798 - mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
799 - fi
800 -
801 - elog "You may need to add the following line to your syslog-ng.conf:"
802 - elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
803 -}