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