Gentoo Archives: gentoo-commits

From: Christian Ruppert <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/bind/
Date: Thu, 24 Jan 2019 10:25:20
Message-Id: 1548325488.ad4cde0fb105c15837c8402c11e5346ee661c5ea.idl0r@gentoo
1 commit: ad4cde0fb105c15837c8402c11e5346ee661c5ea
2 Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 24 10:21:20 2019 +0000
4 Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 24 10:24:48 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad4cde0f
7
8 net-dns/bind: Version bump. Also fixes bug 659562 and bug 674692
9
10 Package-Manager: Portage-2.3.56, Repoman-2.3.12
11 Signed-off-by: Christian Ruppert <idl0r <AT> gentoo.org>
12
13 net-dns/bind/Manifest | 1 +
14 net-dns/bind/bind-9.12.3_p1.ebuild | 407 +++++++++++++++++++++++++++++++++++++
15 2 files changed, 408 insertions(+)
16
17 diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
18 index b31effa9c8f..c66ef2d610f 100644
19 --- a/net-dns/bind/Manifest
20 +++ b/net-dns/bind/Manifest
21 @@ -2,4 +2,5 @@ DIST bind-9.11.2_p1.tar.gz 9783329 BLAKE2B 5a3bbd87112064231bd5e6b09ebb4014f9d5c
22 DIST bind-9.11.3.tar.gz 9523375 BLAKE2B 978986e02767b8ac9f015b52e87b3bc161a7ea72f59f343dcb23f50fbe8474528c4b27ee4fd54bdbe6bd825ce6e8b164e8ad145260b2cdcd004e8892bacd313b SHA512 1f0da13165d1ee872800fe10bb8b0f69c6c76515f9861c1528fb6005213bb71b21a1270906d2ea9ded3eaf6df1a1bac0f2c80aa511683b8d57dcff4f278d8c35
23 DIST bind-9.11.4_p2.tar.gz 9617963 BLAKE2B 409cad7e0976f2e46406d45e87241d61d4d4f00bf08442c4dddbad490ea3d6e42eaad5851fddb83c61a897689a8fdba0cd920aaa0d36329868d26100ba48f946 SHA512 6c01810526fc40485a6c0403d1ddc3b76d2e59b3426b5789436bd671f158d2fa0ea7c0aef2de81998ec715dabd06683fed7b17224d5c794c61e7100a69d4cb60
24 DIST bind-9.12.2_p2.tar.gz 9422128 BLAKE2B c7d56f025f381a0136aa67ccd49a3254fcfe566d5e3601410e5cada26ccab32a901fe6e14bc14e6e287fa2b3904a4eee8e3ef63329f9bc4cb11f204590ff3623 SHA512 458adf6b3d0df286e7d345a21c40b639efcb275e76f9e0bf4e40a5d76dcac875016324393e129f29397be326d1017367c506ec9cbb35871c98fad4281bc4e05a
25 +DIST bind-9.12.3_p1.tar.gz 8625693 BLAKE2B 1899e04e409d3dafe63494fb7a0d8b813a6487754149bbfd01888cddc5e134ac675e9ac790684fb6fd8de4b1484e23ed7f1881c01234c9f16b27180c9a4594a9 SHA512 c1c91de88e4297e79b527775edd525c6fa948f169977563ab2e6ca93cac7317f8ca85863567f5cc151d4c6e3c081864ab1cf813bcfdd1165b52e9471b8317c28
26 DIST dyndns-samples.tbz2 22866 BLAKE2B 409890653c6536cb9c0e3ba809d2bfde0e0ae73a2a101b4f229b46c01568466bc022bbbc37712171adbd08c572733e93630feab95a0fcd1ac50a7d37da1d1108 SHA512 83b0bf99f8e9ff709e8e9336d8c5231b98a4b5f0c60c10792f34931e32cc638d261967dfa5a83151ec3740977d94ddd6e21e9ce91267b3e279b88affdbc18cac
27
28 diff --git a/net-dns/bind/bind-9.12.3_p1.ebuild b/net-dns/bind/bind-9.12.3_p1.ebuild
29 new file mode 100644
30 index 00000000000..0bc4957e187
31 --- /dev/null
32 +++ b/net-dns/bind/bind-9.12.3_p1.ebuild
33 @@ -0,0 +1,407 @@
34 +# Copyright 1999-2019 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +# Re dlz/mysql and threads, needs to be verified..
38 +# MySQL uses thread local storage in its C api. Thus MySQL
39 +# requires that each thread of an application execute a MySQL
40 +# thread initialization to setup the thread local storage.
41 +# This is impossible to do safely while staying within the DLZ
42 +# driver API. This is a limitation caused by MySQL, and not the DLZ API.
43 +# Because of this BIND MUST only run with a single thread when
44 +# using the MySQL driver.
45 +
46 +EAPI=7
47 +
48 +PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
49 +
50 +inherit python-r1 eutils autotools toolchain-funcs flag-o-matic multilib db-use user systemd
51 +
52 +MY_PV="${PV/_p/-P}"
53 +MY_PV="${MY_PV/_rc/rc}"
54 +MY_P="${PN}-${MY_PV}"
55 +
56 +SDB_LDAP_VER="1.1.0-fc14"
57 +
58 +RRL_PV="${MY_PV}"
59 +
60 +# SDB-LDAP: http://bind9-ldap.bayour.com/
61 +
62 +DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
63 +HOMEPAGE="http://www.isc.org/software/bind"
64 +SRC_URI="https://www.isc.org/downloads/file/${MY_P}/?version=tar-gz -> ${P}.tar.gz
65 + doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
66 +# sdb-ldap? (
67 +# http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2
68 +# )"
69 +
70 +LICENSE="Apache-2.0 BSD BSD-2 GPL-2 HPND ISC MPL-2.0"
71 +SLOT="0"
72 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
73 +# -berkdb by default re bug 602682
74 +IUSE="-berkdb +caps dlz dnstap doc dnsrps fixed-rrset geoip gost gssapi ipv6
75 +json ldap libressl lmdb mysql odbc postgres python rpz seccomp selinux ssl static-libs
76 ++threads urandom xml +zlib"
77 +# sdb-ldap - patch broken
78 +# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687
79 +
80 +REQUIRED_USE="
81 + postgres? ( dlz )
82 + berkdb? ( dlz )
83 + mysql? ( dlz !threads )
84 + odbc? ( dlz )
85 + ldap? ( dlz )
86 + gost? ( !libressl ssl )
87 + threads? ( caps )
88 + dnstap? ( threads )
89 + python? ( ${PYTHON_REQUIRED_USE} )"
90 +# sdb-ldap? ( dlz )
91 +
92 +DEPEND="
93 + ssl? (
94 + !libressl? ( dev-libs/openssl:0[-bindist] )
95 + libressl? ( dev-libs/libressl )
96 + )
97 + mysql? ( >=virtual/mysql-4.0 )
98 + odbc? ( >=dev-db/unixODBC-2.2.6 )
99 + ldap? ( net-nds/openldap )
100 + postgres? ( dev-db/postgresql:= )
101 + caps? ( >=sys-libs/libcap-2.1.0 )
102 + xml? ( dev-libs/libxml2 )
103 + geoip? ( >=dev-libs/geoip-1.4.6 )
104 + gssapi? ( virtual/krb5 )
105 + gost? (
106 + || (
107 + =dev-libs/openssl-1.0*[-bindist]
108 + (
109 + >=dev-libs/openssl-1.1
110 + dev-libs/gost-engine
111 + )
112 + )
113 + )
114 + seccomp? ( sys-libs/libseccomp )
115 + json? ( dev-libs/json-c:= )
116 + lmdb? ( dev-db/lmdb )
117 + zlib? ( sys-libs/zlib )
118 + dnstap? ( dev-libs/fstrm dev-libs/protobuf-c )
119 + python? (
120 + ${PYTHON_DEPS}
121 + dev-python/ply[${PYTHON_USEDEP}]
122 + )"
123 +# sdb-ldap? ( net-nds/openldap )
124 +
125 +RDEPEND="${DEPEND}
126 + selinux? ( sec-policy/selinux-bind )
127 + || ( sys-process/psmisc >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd )"
128 +
129 +S="${WORKDIR}/${MY_P}"
130 +
131 +# bug 479092, requires networking
132 +RESTRICT="test"
133 +
134 +pkg_setup() {
135 + ebegin "Creating named group and user"
136 + enewgroup named 40
137 + enewuser named 40 -1 /etc/bind named
138 + eend ${?}
139 +}
140 +
141 +src_prepare() {
142 + default
143 +
144 + # Adjusting PATHs in manpages
145 + for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
146 + sed -i \
147 + -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
148 + -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
149 + -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
150 + "${i}" || die "sed failed, ${i} doesn't exist"
151 + done
152 +
153 +# if use dlz; then
154 +# # sdb-ldap patch as per bug #160567
155 +# # Upstream URL: http://bind9-ldap.bayour.com/
156 +# # New patch take from bug 302735
157 +# if use sdb-ldap; then
158 +# epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
159 +# cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
160 +# cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
161 +# cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
162 +# fi
163 +# fi
164 +
165 + # should be installed by bind-tools
166 + sed -i -r -e "s:(nsupdate|dig|delv) ::g" bin/Makefile.in || die
167 +
168 + # Disable tests for now, bug 406399
169 + sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die
170 +
171 + # bug #220361
172 + rm aclocal.m4
173 + rm -rf libtool.m4/
174 + eautoreconf
175 +}
176 +
177 +src_configure() {
178 + local myeconfargs=(
179 + --sysconfdir=/etc/bind
180 + --localstatedir=/var
181 + --with-libtool
182 + --enable-full-report
183 + --without-readline
184 + $(use_enable caps linux-caps)
185 + $(use_enable dnsrps)
186 + $(use_enable dnstap)
187 + $(use_enable fixed-rrset)
188 + $(use_enable ipv6)
189 + $(use_enable rpz rpz-nsdname)
190 + $(use_enable rpz rpz-nsip)
191 + $(use_enable seccomp)
192 + # $(use_enable static-libs static)
193 + $(use_enable threads)
194 + $(use_with berkdb dlz-bdb)
195 + $(use_with dlz dlopen)
196 + $(use_with dlz dlz-filesystem)
197 + $(use_with dlz dlz-stub)
198 + $(use_with gost)
199 + $(use_with gssapi)
200 + $(use_with json libjson)
201 + $(use_with ldap dlz-ldap)
202 + $(use_with mysql dlz-mysql)
203 + $(use_with odbc dlz-odbc)
204 + $(use_with postgres dlz-postgres)
205 + $(use_with lmdb)
206 + $(use_with python)
207 + $(use_with ssl ecdsa)
208 + $(use_with ssl openssl "${EPREFIX}"/usr)
209 + $(use_with xml libxml2)
210 + $(use_with zlib)
211 + )
212 +
213 + if use urandom; then
214 + myeconfargs+=( --with-randomdev=/dev/urandom )
215 + else
216 + myeconfargs+=( --with-randomdev=/dev/random )
217 + fi
218 +
219 + use geoip && myeconfargs+=( --with-geoip )
220 +
221 + # bug #158664
222 +# gcc-specs-ssp && replace-flags -O[23s] -O
223 +
224 + # To include db.h from proper path
225 + use berkdb && append-flags "-I$(db_includedir)"
226 +
227 + export BUILD_CC=$(tc-getBUILD_CC)
228 + econf "${myeconfargs[@]}"
229 +
230 + # bug #151839
231 + echo '#undef SO_BSDCOMPAT' >> config.h
232 +}
233 +
234 +src_install() {
235 + emake DESTDIR="${D}" install
236 +
237 + dodoc CHANGES README
238 +
239 + if use doc; then
240 + dodoc doc/arm/Bv9ARM.pdf
241 +
242 + docinto misc
243 + dodoc 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-r13 named
269 + newconfd "${FILESDIR}"/named.confd-r7 named
270 +
271 + if use gost; then
272 + sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' \
273 + -i "${ED%/}/etc/init.d/named" || die
274 + else
275 + sed -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' \
276 + -i "${ED%/}/etc/init.d/named" || die
277 + fi
278 +
279 + newenvd "${FILESDIR}"/10bind.env 10bind
280 +
281 + # Let's get rid of those tools and their manpages since they're provided by bind-tools
282 + rm -f "${ED%/}"/usr/share/man/man1/{dig,host,nslookup}.1*
283 + rm -f "${ED%/}"/usr/share/man/man8/nsupdate.8*
284 + rm -f "${ED%/}"/usr/bin/{dig,host,nslookup,nsupdate}
285 + rm -f "${ED%/}"/usr/sbin/{dig,host,nslookup,nsupdate}
286 + for tool in dsfromkey importkey keyfromlabel keygen \
287 + revoke settime signzone verify; do
288 + rm -f "${ED%/}"/usr/{,s}bin/dnssec-"${tool}"
289 + rm -f "${ED%/}"/usr/share/man/man8/dnssec-"${tool}".8*
290 + done
291 +
292 + # bug 405251, library archives aren't properly handled by --enable/disable-static
293 + if ! use static-libs; then
294 + find "${ED}" -type f -name '*.a' -delete || die
295 + fi
296 +
297 + # bug 405251
298 + find "${ED}" -type f -name '*.la' -delete || die
299 +
300 + if use python; then
301 + install_python_tools() {
302 + dosbin bin/python/dnssec-{checkds,coverage}
303 + }
304 + python_foreach_impl install_python_tools
305 +
306 + python_replicate_script "${ED%/}/usr/sbin/dnssec-checkds"
307 + python_replicate_script "${ED%/}/usr/sbin/dnssec-coverage"
308 + fi
309 +
310 + # bug 450406
311 + dosym named.cache /var/bind/root.cache
312 +
313 + dosym /var/bind/pri /etc/bind/pri
314 + dosym /var/bind/sec /etc/bind/sec
315 + dosym /var/bind/dyn /etc/bind/dyn
316 + keepdir /var/bind/{pri,sec,dyn}
317 +
318 + dodir /var/log/named
319 +
320 + fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn}
321 + fowners root:named /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
322 + fperms 0640 /var/bind/named.cache /var/bind/pri/localhost.zone /etc/bind/{bind.keys,named.conf}
323 + fperms 0750 /etc/bind /var/bind/pri
324 + fperms 0770 /var/log/named /var/bind/{,sec,dyn}
325 +
326 + systemd_newunit "${FILESDIR}/named.service-r1" named.service
327 + systemd_dotmpfilesd "${FILESDIR}"/named.conf
328 + exeinto /usr/libexec
329 + doexe "${FILESDIR}/generate-rndc-key.sh"
330 +}
331 +
332 +pkg_postinst() {
333 + if [ ! -f '/etc/bind/rndc.key' ]; then
334 + if use urandom; then
335 + einfo "Using /dev/urandom for generating rndc.key"
336 + /usr/sbin/rndc-confgen -r /dev/urandom -a
337 + echo
338 + else
339 + einfo "Using /dev/random for generating rndc.key"
340 + /usr/sbin/rndc-confgen -a
341 + echo
342 + fi
343 + chown root:named /etc/bind/rndc.key || die
344 + chmod 0640 /etc/bind/rndc.key || die
345 + fi
346 +
347 + einfo
348 + einfo "You can edit /etc/conf.d/named to customize named settings"
349 + einfo
350 + use mysql || use postgres || use ldap && {
351 + elog "If your named depends on MySQL/PostgreSQL or LDAP,"
352 + elog "uncomment the specified rc_named_* lines in your"
353 + elog "/etc/conf.d/named config to ensure they'll start before bind"
354 + einfo
355 + }
356 + einfo "If you'd like to run bind in a chroot AND this is a new"
357 + einfo "install OR your bind doesn't already run in a chroot:"
358 + einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
359 + einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
360 + einfo
361 +
362 + CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
363 + if [[ -n ${CHROOT} ]]; then
364 + elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
365 + elog "To enable the old behaviour (without using mount) uncomment the"
366 + elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
367 + elog "If you decide to use the new/default method, ensure to make backup"
368 + elog "first and merge your existing configs/zones to /etc/bind and"
369 + elog "/var/bind because bind will now mount the needed directories into"
370 + elog "the chroot dir."
371 + fi
372 +}
373 +
374 +pkg_config() {
375 + CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
376 + CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
377 + CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
378 +
379 + if [[ -z "${CHROOT}" ]]; then
380 + eerror "This config script is designed to automate setting up"
381 + eerror "a chrooted bind/named. To do so, please first uncomment"
382 + eerror "and set the CHROOT variable in '/etc/conf.d/named'."
383 + die "Unset CHROOT"
384 + fi
385 + if [[ -d "${CHROOT}" ]]; then
386 + ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
387 + ewarn "To enable the old behaviour (without using mount) uncomment the"
388 + ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
389 + ewarn
390 + ewarn "${CHROOT} already exists... some things might become overridden"
391 + ewarn "press CTRL+C if you don't want to continue"
392 + sleep 10
393 + fi
394 +
395 + echo; einfo "Setting up the chroot directory..."
396 +
397 + mkdir -m 0750 -p ${CHROOT} || die
398 + mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
399 + mkdir -m 0750 -p ${CHROOT}/etc/bind || die
400 + mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
401 + # As of bind 9.8.0
402 + if has_version net-dns/bind[gost]; then
403 + mkdir -m 0755 -p ${CHROOT}/usr/$(get_libdir)/engines || die
404 + if [ "$(get_libdir)" = "lib64" ]; then
405 + ln -s lib64 ${CHROOT}/usr/lib || die
406 + fi
407 + fi
408 + chown root:named \
409 + ${CHROOT} \
410 + ${CHROOT}/var/{bind,log/named} \
411 + ${CHROOT}/run/named/ \
412 + ${CHROOT}/etc/bind \
413 + || die
414 +
415 + mknod ${CHROOT}/dev/null c 1 3 || die
416 + chmod 0666 ${CHROOT}/dev/null || die
417 +
418 + mknod ${CHROOT}/dev/zero c 1 5 || die
419 + chmod 0666 ${CHROOT}/dev/zero || die
420 +
421 + if use urandom; then
422 + mknod ${CHROOT}/dev/urandom c 1 9 || die
423 + chmod 0666 ${CHROOT}/dev/urandom || die
424 + else
425 + mknod ${CHROOT}/dev/random c 1 8 || die
426 + chmod 0666 ${CHROOT}/dev/random || die
427 + fi
428 +
429 + if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
430 + cp -a /etc/bind ${CHROOT}/etc/ || die
431 + cp -a /var/bind ${CHROOT}/var/ || die
432 + fi
433 +
434 + if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
435 + mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
436 + fi
437 +
438 + elog "You may need to add the following line to your syslog-ng.conf:"
439 + elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
440 +}