Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-dns/bind: ChangeLog bind-9.9.0.ebuild bind-9.7.5.ebuild bind-9.8.2.ebuild
Date: Sat, 07 Apr 2012 17:37:36
Message-Id: 20120407173726.991D12004B@flycatcher.gentoo.org
1 idl0r 12/04/07 17:37:26
2
3 Modified: ChangeLog bind-9.9.0.ebuild
4 Added: bind-9.7.5.ebuild bind-9.8.2.ebuild
5 Log:
6 Version bumps.
7
8 (Portage version: 2.1.10.44/cvs/Linux i686)
9
10 Revision Changes Path
11 1.380 net-dns/bind/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?rev=1.380&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?rev=1.380&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?r1=1.379&r2=1.380
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v
20 retrieving revision 1.379
21 retrieving revision 1.380
22 diff -u -r1.379 -r1.380
23 --- ChangeLog 1 Apr 2012 15:30:35 -0000 1.379
24 +++ ChangeLog 7 Apr 2012 17:37:26 -0000 1.380
25 @@ -1,6 +1,13 @@
26 # ChangeLog for net-dns/bind
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.379 2012/04/01 15:30:35 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.380 2012/04/07 17:37:26 idl0r Exp $
30 +
31 +*bind-9.8.2 (07 Apr 2012)
32 +*bind-9.7.5 (07 Apr 2012)
33 +
34 + 07 Apr 2012; Christian Ruppert <idl0r@g.o> +bind-9.7.5.ebuild,
35 + +bind-9.8.2.ebuild, bind-9.9.0.ebuild:
36 + Version bumps.
37
38 01 Apr 2012; Raúl Porcel <armin76@g.o> bind-9.8.1_p1.ebuild:
39 alpha/ia64/s390/sh/sparc stable wrt #405149
40
41
42
43 1.4 net-dns/bind/bind-9.9.0.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild?rev=1.4&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild?rev=1.4&content-type=text/plain
47 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild?r1=1.3&r2=1.4
48
49 Index: bind-9.9.0.ebuild
50 ===================================================================
51 RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild,v
52 retrieving revision 1.3
53 retrieving revision 1.4
54 diff -u -r1.3 -r1.4
55 --- bind-9.9.0.ebuild 2 Mar 2012 00:51:33 -0000 1.3
56 +++ bind-9.9.0.ebuild 7 Apr 2012 17:37:26 -0000 1.4
57 @@ -1,6 +1,6 @@
58 # Copyright 1999-2012 Gentoo Foundation
59 # Distributed under the terms of the GNU General Public License v2
60 -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild,v 1.3 2012/03/02 00:51:33 idl0r Exp $
61 +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.9.0.ebuild,v 1.4 2012/04/07 17:37:26 idl0r Exp $
62
63 # Re dlz/mysql and threads, needs to be verified..
64 # MySQL uses thread local storage in its C api. Thus MySQL
65 @@ -165,36 +165,37 @@
66 $(use_with pkcs11) \
67 $(use_enable caps linux-caps) \
68 $(use_with gost) \
69 - $(use_enable static-libs static) \
70 --without-readline \
71 ${myconf}
72
73 + # $(use_enable static-libs static) \
74 +
75 # bug #151839
76 echo '#undef SO_BSDCOMPAT' >> config.h
77 }
78
79 src_install() {
80 - emake DESTDIR="${D}" install || die
81 + emake DESTDIR="${D}" install
82
83 dodoc CHANGES FAQ README
84
85 if use idn; then
86 - dodoc contrib/idn/README.idnkit || die
87 + dodoc contrib/idn/README.idnkit
88 fi
89
90 if use doc; then
91 - dodoc doc/arm/Bv9ARM.pdf || die
92 + dodoc doc/arm/Bv9ARM.pdf
93
94 docinto misc
95 - dodoc doc/misc/* || die
96 + dodoc doc/misc/*
97
98 # might a 'html' useflag make sense?
99 docinto html
100 - dohtml -r doc/arm/* || die
101 + dohtml -r doc/arm/*
102
103 docinto contrib
104 dodoc contrib/named-bootconf/named-bootconf.sh \
105 - contrib/nanny/nanny.pl || die
106 + contrib/nanny/nanny.pl
107
108 # some handy-dandy dynamic dns examples
109 cd "${D}"/usr/share/doc/${PF}
110 @@ -204,18 +205,18 @@
111 use geoip && dodoc "${DISTDIR}"/${GEOIP_DOC_A}
112
113 insinto /etc/bind
114 - newins "${FILESDIR}"/named.conf-r5 named.conf || die
115 + newins "${FILESDIR}"/named.conf-r5 named.conf
116
117 # ftp://ftp.rs.internic.net/domain/named.cache:
118 insinto /var/bind
119 - doins "${FILESDIR}"/named.cache || die
120 + doins "${FILESDIR}"/named.cache
121
122 insinto /var/bind/pri
123 - newins "${FILESDIR}"/127.zone-r1 127.zone || die
124 - newins "${FILESDIR}"/localhost.zone-r3 localhost.zone || die
125 + newins "${FILESDIR}"/127.zone-r1 127.zone
126 + newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
127
128 - newinitd "${FILESDIR}"/named.init-r11 named || die
129 - newconfd "${FILESDIR}"/named.confd-r6 named || die
130 + newinitd "${FILESDIR}"/named.init-r11 named
131 + newconfd "${FILESDIR}"/named.confd-r6 named
132
133 if use gost; then
134 sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' "${D}/etc/init.d/named" || die
135 @@ -223,7 +224,7 @@
136 sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' "${D}/etc/init.d/named" || die
137 fi
138
139 - newenvd "${FILESDIR}"/10bind.env 10bind || die
140 + newenvd "${FILESDIR}"/10bind.env 10bind
141
142 # Let's get rid of those tools and their manpages since they're provided by bind-tools
143 rm -f "${D}"/usr/share/man/man1/{dig,host,nslookup}.1*
144 @@ -236,13 +237,13 @@
145 find "${D}" -type f -name '*.la' -delete || die
146 fi
147
148 - dosym /var/bind/named.cache /var/bind/root.cache || die
149 - dosym /var/bind/pri /etc/bind/pri || die
150 - dosym /var/bind/sec /etc/bind/sec || die
151 - dosym /var/bind/dyn /etc/bind/dyn || die
152 + dosym /var/bind/named.cache /var/bind/root.cache
153 + dosym /var/bind/pri /etc/bind/pri
154 + dosym /var/bind/sec /etc/bind/sec
155 + dosym /var/bind/dyn /etc/bind/dyn
156 keepdir /var/bind/{pri,sec,dyn}
157
158 - dodir /var/{run,log}/named || die
159 + dodir /var/{run,log}/named
160
161 fowners root:named /{etc,var}/bind /var/{run,log}/named /var/bind/{sec,pri,dyn}
162 fowners root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}
163
164
165
166 1.1 net-dns/bind/bind-9.7.5.ebuild
167
168 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.7.5.ebuild?rev=1.1&view=markup
169 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.7.5.ebuild?rev=1.1&content-type=text/plain
170
171 Index: bind-9.7.5.ebuild
172 ===================================================================
173 # Copyright 1999-2012 Gentoo Foundation
174 # Distributed under the terms of the GNU General Public License v2
175 # $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.7.5.ebuild,v 1.1 2012/04/07 17:37:26 idl0r Exp $
176
177 # Re dlz/mysql and threads, needs to be verified..
178 # MySQL uses thread local storage in its C api. Thus MySQL
179 # requires that each thread of an application execute a MySQL
180 # thread initialization to setup the thread local storage.
181 # This is impossible to do safely while staying within the DLZ
182 # driver API. This is a limitation caused by MySQL, and not the DLZ API.
183 # Because of this BIND MUST only run with a single thread when
184 # using the MySQL driver.
185
186 EAPI="4"
187
188 inherit eutils autotools toolchain-funcs flag-o-matic db-use
189
190 MY_PV="${PV/_p/-P}"
191 MY_P="${PN}-${MY_PV}"
192
193 SDB_LDAP_VER="1.1.0-fc14"
194
195 GEOIP_PV=1.3
196 GEOIP_PV_AGAINST="9.7.2-P2"
197 GEOIP_P="bind-geoip-${GEOIP_PV}-${GEOIP_PV_AGAINST}"
198 GEOIP_PATCH_A="${GEOIP_P}.patch"
199 GEOIP_DOC_A="bind-geoip-1.3-readme.txt"
200 GEOIP_SRC_URI_BASE="http://bind-geoip.googlecode.com/"
201
202 DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
203 HOMEPAGE="http://www.isc.org/software/bind"
204 SRC_URI="ftp://ftp.isc.org/isc/bind9/${MY_PV}/${MY_P}.tar.gz
205 doc? ( mirror://gentoo/dyndns-samples.tbz2 )
206 geoip? ( ${GEOIP_SRC_URI_BASE}/files/${GEOIP_DOC_A}
207 ${GEOIP_SRC_URI_BASE}/files/${GEOIP_PATCH_A} )
208 sdb-ldap? ( http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2 )"
209
210 LICENSE="as-is"
211 SLOT="0"
212 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
213 IUSE="berkdb caps dlz doc geoip gssapi idn ipv6 ldap mysql odbc pkcs11
214 postgres sdb-ldap selinux ssl static-libs threads urandom xml"
215
216 REQUIRED_USE="postgres? ( dlz )
217 berkdb? ( dlz )
218 mysql? ( dlz !threads )
219 odbc? ( dlz )
220 ldap? ( dlz )
221 sdb-ldap? ( dlz )
222 threads? ( caps )"
223
224 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6g )
225 mysql? ( >=virtual/mysql-4.0 )
226 odbc? ( >=dev-db/unixODBC-2.2.6 )
227 ldap? ( net-nds/openldap )
228 idn? ( net-dns/idnkit )
229 postgres? ( dev-db/postgresql-base )
230 caps? ( >=sys-libs/libcap-2.1.0 )
231 xml? ( dev-libs/libxml2 )
232 geoip? ( >=dev-libs/geoip-1.4.6 )
233 gssapi? ( virtual/krb5 )
234 sdb-ldap? ( net-nds/openldap )"
235
236 RDEPEND="${DEPEND}
237 selinux? ( sec-policy/selinux-bind )
238 || ( sys-process/psmisc sys-process/fuser-bsd )"
239
240 S="${WORKDIR}/${MY_P}"
241
242 pkg_setup() {
243 ebegin "Creating named group and user"
244 enewgroup named 40
245 enewuser named 40 -1 /etc/bind named
246 eend ${?}
247 }
248
249 src_prepare() {
250 # Adjusting PATHs in manpages
251 for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
252 sed -i \
253 -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
254 -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
255 -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
256 "${i}" || die "sed failed, ${i} doesn't exist"
257 done
258
259 if use dlz; then
260 # bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse
261 # (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/)
262 if use mysql && has_version ">=dev-db/mysql-5"; then
263 epatch "${FILESDIR}"/bind-dlzmysql5-reconnect.patch
264 fi
265
266 if use odbc; then
267 epatch "${FILESDIR}/bind-9.7.3-odbc-dlz-detect.patch"
268 fi
269
270 # sdb-ldap patch as per bug #160567
271 # Upstream URL: http://bind9-ldap.bayour.com/
272 # New patch take from bug 302735
273 if use sdb-ldap; then
274 epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
275 cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
276 cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
277 cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
278 fi
279 fi
280
281 # should be installed by bind-tools
282 sed -i -r -e "s:(nsupdate|dig) ::g" bin/Makefile.in || die
283
284 if use geoip; then
285 cp "${DISTDIR}"/${GEOIP_PATCH_A} "${S}" || die
286 sed -i -e 's:^ RELEASETYPE=-P: RELEASETYPE=:' \
287 -e 's:RELEASEVER=2:RELEASEVER=:' \
288 ${GEOIP_PATCH_A} || die
289 epatch ${GEOIP_PATCH_A}
290 fi
291
292 # bug #220361
293 rm {aclocal,libtool}.m4
294 eautoreconf
295 }
296
297 src_configure() {
298 local myconf=""
299
300 if use urandom; then
301 myconf="${myconf} --with-randomdev=/dev/urandom"
302 else
303 myconf="${myconf} --with-randomdev=/dev/random"
304 fi
305
306 use geoip && myconf="${myconf} --with-geoip"
307
308 # bug #158664
309 # gcc-specs-ssp && replace-flags -O[23s] -O
310
311 # To include db.h from proper path
312 use berkdb && append-flags "-I$(db_includedir)"
313
314 export BUILD_CC=$(tc-getBUILD_CC)
315 econf \
316 --sysconfdir=/etc/bind \
317 --localstatedir=/var \
318 --with-libtool \
319 $(use_enable threads) \
320 $(use_with dlz dlz-filesystem) \
321 $(use_with dlz dlz-stub) \
322 $(use_with postgres dlz-postgres) \
323 $(use_with mysql dlz-mysql) \
324 $(use_with berkdb dlz-bdb) \
325 $(use_with ldap dlz-ldap) \
326 $(use_with odbc dlz-odbc) \
327 $(use_with ssl openssl) \
328 $(use_with idn) \
329 $(use_enable ipv6) \
330 $(use_with xml libxml2) \
331 $(use_with gssapi) \
332 $(use_with pkcs11) \
333 $(use_enable caps linux-caps) \
334 ${myconf}
335
336 # bug #151839
337 echo '#undef SO_BSDCOMPAT' >> config.h
338 }
339
340 src_install() {
341 emake DESTDIR="${D}" install
342
343 dodoc CHANGES FAQ README
344
345 if use idn; then
346 dodoc contrib/idn/README.idnkit
347 fi
348
349 if use doc; then
350 dodoc doc/arm/Bv9ARM.pdf
351
352 docinto misc
353 dodoc doc/misc/*
354
355 # might a 'html' useflag make sense?
356 docinto html
357 dohtml -r doc/arm/*
358
359 docinto contrib
360 dodoc contrib/named-bootconf/named-bootconf.sh \
361 contrib/nanny/nanny.pl
362
363 # some handy-dandy dynamic dns examples
364 cd "${D}"/usr/share/doc/${PF}
365 tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
366 fi
367
368 use geoip && dodoc "${DISTDIR}"/${GEOIP_DOC_A}
369
370 insinto /etc/bind
371 newins "${FILESDIR}"/named.conf-r5 named.conf
372
373 # ftp://ftp.rs.internic.net/domain/named.cache:
374 insinto /var/bind
375 doins "${FILESDIR}"/named.cache
376
377 insinto /var/bind/pri
378 newins "${FILESDIR}"/127.zone-r1 127.zone
379 newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
380
381 newinitd "${FILESDIR}"/named.init-r11 named
382 newconfd "${FILESDIR}"/named.confd-r6 named
383
384 newenvd "${FILESDIR}"/10bind.env 10bind
385
386 # Let's get rid of those tools and their manpages since they're provided by bind-tools
387 rm -f "${D}"/usr/share/man/man1/{dig,host,nslookup}.1*
388 rm -f "${D}"/usr/share/man/man8/{dnssec-keygen,nsupdate}.8*
389 rm -f "${D}"/usr/bin/{dig,host,nslookup,dnssec-keygen,nsupdate}
390 rm -f "${D}"/usr/sbin/{dig,host,nslookup,dnssec-keygen,nsupdate}
391
392 # bug 405251, library archives aren't properly handled by --enable/disable-static
393 if ! use static-libs; then
394 find "${D}" -type f -name '*.la' -delete || die
395 fi
396
397 dosym /var/bind/named.cache /var/bind/root.cache
398 dosym /var/bind/pri /etc/bind/pri
399 dosym /var/bind/sec /etc/bind/sec
400 dosym /var/bind/dyn /etc/bind/dyn
401 keepdir /var/bind/{pri,sec,dyn}
402
403 dodir /var/{run,log}/named
404
405 fowners root:named /{etc,var}/bind /var/{run,log}/named /var/bind/{sec,pri,dyn}
406 fowners root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}
407 fperms 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}
408 fperms 0750 /etc/bind /var/bind/pri
409 fperms 0770 /var/{run,log}/named /var/bind/{,sec,dyn}
410 }
411
412 pkg_postinst() {
413 if [ ! -f '/etc/bind/rndc.key' ]; then
414 if use urandom; then
415 einfo "Using /dev/urandom for generating rndc.key"
416 /usr/sbin/rndc-confgen -r /dev/urandom -a
417 echo
418 else
419 einfo "Using /dev/random for generating rndc.key"
420 /usr/sbin/rndc-confgen -a
421 echo
422 fi
423 chown root:named /etc/bind/rndc.key
424 chmod 0640 /etc/bind/rndc.key
425 fi
426
427 einfo
428 einfo "You can edit /etc/conf.d/named to customize named settings"
429 einfo
430 use mysql || use postgres || use ldap && {
431 elog "If your named depends on MySQL/PostgreSQL or LDAP,"
432 elog "uncomment the specified rc_named_* lines in your"
433 elog "/etc/conf.d/named config to ensure they'll start before bind"
434 einfo
435 }
436 einfo "If you'd like to run bind in a chroot AND this is a new"
437 einfo "install OR your bind doesn't already run in a chroot:"
438 einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
439 einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
440 einfo
441
442 CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
443 if [[ -n ${CHROOT} ]]; then
444 elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
445 elog "To enable the old behaviour (without using mount) uncomment the"
446 elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
447 elog "If you decide to use the new/default method, ensure to make backup"
448 elog "first and merge your existing configs/zones to /etc/bind and"
449 elog "/var/bind because bind will now mount the needed directories into"
450 elog "the chroot dir."
451 fi
452
453 ewarn
454 ewarn "NOTE: /var/bind/named.ca has been renamed to /var/bind/named.cache"
455 ewarn "you may need to fix your named.conf!"
456 ewarn
457 ewarn "NOTE: If you upgrade from <net-dns/bind-9.4.3_p5-r1, you may encounter permission problems"
458 ewarn "To fix the permissions do:"
459 ewarn "chown root:named /{etc,var}/bind /var/{run,log}/named /var/bind/{sec,pri,dyn}"
460 ewarn "chown root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}"
461 ewarn "chmod 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}"
462 ewarn "chmod 0750 /etc/bind /var/bind/pri"
463 ewarn "chmod 0770 /var/{run,log}/named /var/bind/{,sec,dyn}"
464 ewarn
465 }
466
467 pkg_config() {
468 CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
469 CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
470 CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
471
472 if [[ -z "${CHROOT}" ]]; then
473 eerror "This config script is designed to automate setting up"
474 eerror "a chrooted bind/named. To do so, please first uncomment"
475 eerror "and set the CHROOT variable in '/etc/conf.d/named'."
476 die "Unset CHROOT"
477 fi
478 if [[ -d "${CHROOT}" ]]; then
479 ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
480 ewarn "To enable the old behaviour (without using mount) uncomment the"
481 ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
482 ewarn
483 ewarn "${CHROOT} already exists... some things might become overridden"
484 ewarn "press CTRL+C if you don't want to continue"
485 sleep 10
486 fi
487
488 echo; einfo "Setting up the chroot directory..."
489
490 mkdir -m 0750 -p ${CHROOT}
491 mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/{run,log}}
492 mkdir -m 0750 -p ${CHROOT}/etc/bind
493 mkdir -m 0770 -p ${CHROOT}/var/{bind,{run,log}/named}
494 chown root:named ${CHROOT} ${CHROOT}/var/{bind,{run,log}/named} ${CHROOT}/etc/bind
495
496 mknod ${CHROOT}/dev/null c 1 3
497 chmod 0666 ${CHROOT}/dev/null
498
499 mknod ${CHROOT}/dev/zero c 1 5
500 chmod 0666 ${CHROOT}/dev/zero
501
502 if use urandom; then
503 mknod ${CHROOT}/dev/urandom c 1 9
504 chmod 0666 ${CHROOT}/dev/urandom
505 else
506 mknod ${CHROOT}/dev/random c 1 8
507 chmod 0666 ${CHROOT}/dev/random
508 fi
509
510 if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
511 cp -a /etc/bind ${CHROOT}/etc/
512 cp -a /var/bind ${CHROOT}/var/
513 fi
514
515 if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
516 mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP
517 fi
518
519 elog "You may need to add the following line to your syslog-ng.conf:"
520 elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
521 }
522
523
524
525 1.1 net-dns/bind/bind-9.8.2.ebuild
526
527 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.8.2.ebuild?rev=1.1&view=markup
528 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.8.2.ebuild?rev=1.1&content-type=text/plain
529
530 Index: bind-9.8.2.ebuild
531 ===================================================================
532 # Copyright 1999-2012 Gentoo Foundation
533 # Distributed under the terms of the GNU General Public License v2
534 # $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.8.2.ebuild,v 1.1 2012/04/07 17:37:26 idl0r Exp $
535
536 # Re dlz/mysql and threads, needs to be verified..
537 # MySQL uses thread local storage in its C api. Thus MySQL
538 # requires that each thread of an application execute a MySQL
539 # thread initialization to setup the thread local storage.
540 # This is impossible to do safely while staying within the DLZ
541 # driver API. This is a limitation caused by MySQL, and not the DLZ API.
542 # Because of this BIND MUST only run with a single thread when
543 # using the MySQL driver.
544
545 EAPI="4"
546
547 inherit eutils autotools toolchain-funcs flag-o-matic multilib db-use
548
549 MY_PV="${PV/_p/-P}"
550 MY_PV="${MY_PV/_rc/rc}"
551 MY_P="${PN}-${MY_PV}"
552
553 SDB_LDAP_VER="1.1.0-fc14"
554
555 # bind-9.8.0-P1-geoip-1.3.patch
556 GEOIP_PV=1.3
557 #GEOIP_PV_AGAINST="${MY_PV}"
558 GEOIP_PV_AGAINST="9.8.0-P1"
559 GEOIP_P="bind-${GEOIP_PV_AGAINST}-geoip-${GEOIP_PV}"
560 GEOIP_PATCH_A="${GEOIP_P}.patch"
561 GEOIP_DOC_A="bind-geoip-1.3-readme.txt"
562 GEOIP_SRC_URI_BASE="http://bind-geoip.googlecode.com/"
563
564 DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
565 HOMEPAGE="http://www.isc.org/software/bind"
566 SRC_URI="ftp://ftp.isc.org/isc/bind9/${MY_PV}/${MY_P}.tar.gz
567 doc? ( mirror://gentoo/dyndns-samples.tbz2 )
568 geoip? ( ${GEOIP_SRC_URI_BASE}/files/${GEOIP_DOC_A}
569 ${GEOIP_SRC_URI_BASE}/files/${GEOIP_PATCH_A} )
570 sdb-ldap? ( http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2 )"
571
572 LICENSE="as-is"
573 SLOT="0"
574 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
575 IUSE="berkdb caps dlz doc geoip gost gssapi idn ipv6 ldap mysql odbc pkcs11 postgres rpz sdb-ldap
576 selinux ssl static-libs threads urandom xml"
577
578 REQUIRED_USE="postgres? ( dlz )
579 berkdb? ( dlz )
580 mysql? ( dlz !threads )
581 odbc? ( dlz )
582 ldap? ( dlz )
583 sdb-ldap? ( dlz )
584 gost? ( ssl )
585 threads? ( caps )"
586
587 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6g )
588 mysql? ( >=virtual/mysql-4.0 )
589 odbc? ( >=dev-db/unixODBC-2.2.6 )
590 ldap? ( net-nds/openldap )
591 idn? ( net-dns/idnkit )
592 postgres? ( dev-db/postgresql-base )
593 caps? ( >=sys-libs/libcap-2.1.0 )
594 xml? ( dev-libs/libxml2 )
595 geoip? ( >=dev-libs/geoip-1.4.6 )
596 gssapi? ( virtual/krb5 )
597 sdb-ldap? ( net-nds/openldap )
598 gost? ( >=dev-libs/openssl-1.0.0 )"
599
600 RDEPEND="${DEPEND}
601 selinux? ( sec-policy/selinux-bind )
602 || ( sys-process/psmisc sys-process/fuser-bsd )"
603
604 S="${WORKDIR}/${MY_P}"
605
606 pkg_setup() {
607 ebegin "Creating named group and user"
608 enewgroup named 40
609 enewuser named 40 -1 /etc/bind named
610 eend ${?}
611 }
612
613 src_prepare() {
614 # Adjusting PATHs in manpages
615 for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
616 sed -i \
617 -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
618 -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
619 -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
620 "${i}" || die "sed failed, ${i} doesn't exist"
621 done
622
623 if use dlz; then
624 # bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse
625 # (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/)
626 if use mysql && has_version ">=dev-db/mysql-5"; then
627 epatch "${FILESDIR}"/bind-dlzmysql5-reconnect.patch
628 fi
629
630 if use odbc; then
631 epatch "${FILESDIR}/${PN}-9.7.3-odbc-dlz-detect.patch"
632 fi
633
634 # sdb-ldap patch as per bug #160567
635 # Upstream URL: http://bind9-ldap.bayour.com/
636 # New patch take from bug 302735
637 if use sdb-ldap; then
638 epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
639 cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/
640 cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/
641 cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/
642 fi
643 fi
644
645 # should be installed by bind-tools
646 sed -i -r -e "s:(nsupdate|dig) ::g" bin/Makefile.in || die
647
648 if use geoip; then
649 cp "${DISTDIR}"/${GEOIP_PATCH_A} "${S}" || die
650 sed -i -e 's:^ RELEASETYPE=-P: RELEASETYPE=:' \
651 -e 's:RELEASEVER=1:RELEASEVER=:' \
652 ${GEOIP_PATCH_A} || die
653 epatch ${GEOIP_PATCH_A}
654 fi
655
656 # bug #220361
657 rm {aclocal,libtool}.m4
658 eautoreconf
659 }
660
661 src_configure() {
662 local myconf=""
663
664 if use urandom; then
665 myconf="${myconf} --with-randomdev=/dev/urandom"
666 else
667 myconf="${myconf} --with-randomdev=/dev/random"
668 fi
669
670 use geoip && myconf="${myconf} --with-geoip"
671
672 # bug #158664
673 # gcc-specs-ssp && replace-flags -O[23s] -O
674
675 # To include db.h from proper path
676 use berkdb && append-flags "-I$(db_includedir)"
677
678 export BUILD_CC=$(tc-getBUILD_CC)
679 econf \
680 --sysconfdir=/etc/bind \
681 --localstatedir=/var \
682 --with-libtool \
683 $(use_enable threads) \
684 $(use_with dlz dlopen) \
685 $(use_with dlz dlz-filesystem) \
686 $(use_with dlz dlz-stub) \
687 $(use_with postgres dlz-postgres) \
688 $(use_with mysql dlz-mysql) \
689 $(use_with berkdb dlz-bdb) \
690 $(use_with ldap dlz-ldap) \
691 $(use_with odbc dlz-odbc) \
692 $(use_with ssl openssl) \
693 $(use_with idn) \
694 $(use_enable ipv6) \
695 $(use_with xml libxml2) \
696 $(use_with gssapi) \
697 $(use_enable rpz rpz-nsip) \
698 $(use_enable rpz rpz-nsdname) \
699 $(use_with pkcs11) \
700 $(use_enable caps linux-caps) \
701 $(use_with gost) \
702 ${myconf}
703
704 # bug #151839
705 echo '#undef SO_BSDCOMPAT' >> config.h
706 }
707
708 src_install() {
709 emake DESTDIR="${D}" install
710
711 dodoc CHANGES FAQ README
712
713 if use idn; then
714 dodoc contrib/idn/README.idnkit
715 fi
716
717 if use doc; then
718 dodoc doc/arm/Bv9ARM.pdf
719
720 docinto misc
721 dodoc doc/misc/*
722
723 # might a 'html' useflag make sense?
724 docinto html
725 dohtml -r doc/arm/*
726
727 docinto contrib
728 dodoc contrib/named-bootconf/named-bootconf.sh \
729 contrib/nanny/nanny.pl
730
731 # some handy-dandy dynamic dns examples
732 cd "${D}"/usr/share/doc/${PF}
733 tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die
734 fi
735
736 use geoip && dodoc "${DISTDIR}"/${GEOIP_DOC_A}
737
738 insinto /etc/bind
739 newins "${FILESDIR}"/named.conf-r5 named.conf
740
741 # ftp://ftp.rs.internic.net/domain/named.cache:
742 insinto /var/bind
743 doins "${FILESDIR}"/named.cache
744
745 insinto /var/bind/pri
746 newins "${FILESDIR}"/127.zone-r1 127.zone
747 newins "${FILESDIR}"/localhost.zone-r3 localhost.zone
748
749 newinitd "${FILESDIR}"/named.init-r11 named
750 newconfd "${FILESDIR}"/named.confd-r6 named
751
752 if use gost; then
753 sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' "${D}/etc/init.d/named" || die
754 else
755 sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' "${D}/etc/init.d/named" || die
756 fi
757
758 newenvd "${FILESDIR}"/10bind.env 10bind
759
760 # Let's get rid of those tools and their manpages since they're provided by bind-tools
761 rm -f "${D}"/usr/share/man/man1/{dig,host,nslookup}.1*
762 rm -f "${D}"/usr/share/man/man8/{dnssec-keygen,nsupdate}.8*
763 rm -f "${D}"/usr/bin/{dig,host,nslookup,dnssec-keygen,nsupdate}
764 rm -f "${D}"/usr/sbin/{dig,host,nslookup,dnssec-keygen,nsupdate}
765
766 # bug 405251, library archives aren't properly handled by --enable/disable-static
767 if ! use static-libs; then
768 find "${D}" -type f -name '*.la' -delete || die
769 fi
770
771 dosym /var/bind/named.cache /var/bind/root.cache
772 dosym /var/bind/pri /etc/bind/pri
773 dosym /var/bind/sec /etc/bind/sec
774 dosym /var/bind/dyn /etc/bind/dyn
775 keepdir /var/bind/{pri,sec,dyn}
776
777 dodir /var/{run,log}/named
778
779 fowners root:named /{etc,var}/bind /var/{run,log}/named /var/bind/{sec,pri,dyn}
780 fowners root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}
781 fperms 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}
782 fperms 0750 /etc/bind /var/bind/pri
783 fperms 0770 /var/{run,log}/named /var/bind/{,sec,dyn}
784 }
785
786 pkg_postinst() {
787 if [ ! -f '/etc/bind/rndc.key' ]; then
788 if use urandom; then
789 einfo "Using /dev/urandom for generating rndc.key"
790 /usr/sbin/rndc-confgen -r /dev/urandom -a
791 echo
792 else
793 einfo "Using /dev/random for generating rndc.key"
794 /usr/sbin/rndc-confgen -a
795 echo
796 fi
797 chown root:named /etc/bind/rndc.key
798 chmod 0640 /etc/bind/rndc.key
799 fi
800
801 einfo
802 einfo "You can edit /etc/conf.d/named to customize named settings"
803 einfo
804 use mysql || use postgres || use ldap && {
805 elog "If your named depends on MySQL/PostgreSQL or LDAP,"
806 elog "uncomment the specified rc_named_* lines in your"
807 elog "/etc/conf.d/named config to ensure they'll start before bind"
808 einfo
809 }
810 einfo "If you'd like to run bind in a chroot AND this is a new"
811 einfo "install OR your bind doesn't already run in a chroot:"
812 einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named."
813 einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
814 einfo
815
816 CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
817 if [[ -n ${CHROOT} ]]; then
818 elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
819 elog "To enable the old behaviour (without using mount) uncomment the"
820 elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
821 elog "If you decide to use the new/default method, ensure to make backup"
822 elog "first and merge your existing configs/zones to /etc/bind and"
823 elog "/var/bind because bind will now mount the needed directories into"
824 elog "the chroot dir."
825 fi
826
827 ewarn
828 ewarn "NOTE: /var/bind/named.ca has been renamed to /var/bind/named.cache"
829 ewarn "you may need to fix your named.conf!"
830 ewarn
831 ewarn "NOTE: If you upgrade from <net-dns/bind-9.4.3_p5-r1, you may encounter permission problems"
832 ewarn "To fix the permissions do:"
833 ewarn "chown root:named /{etc,var}/bind /var/{run,log}/named /var/bind/{sec,pri,dyn}"
834 ewarn "chown root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}"
835 ewarn "chmod 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}"
836 ewarn "chmod 0750 /etc/bind /var/bind/pri"
837 ewarn "chmod 0770 /var/{run,log}/named /var/bind/{,sec,dyn}"
838 ewarn
839 }
840
841 pkg_config() {
842 CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
843 CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
844 CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
845
846 if [[ -z "${CHROOT}" ]]; then
847 eerror "This config script is designed to automate setting up"
848 eerror "a chrooted bind/named. To do so, please first uncomment"
849 eerror "and set the CHROOT variable in '/etc/conf.d/named'."
850 die "Unset CHROOT"
851 fi
852 if [[ -d "${CHROOT}" ]]; then
853 ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
854 ewarn "To enable the old behaviour (without using mount) uncomment the"
855 ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config."
856 ewarn
857 ewarn "${CHROOT} already exists... some things might become overridden"
858 ewarn "press CTRL+C if you don't want to continue"
859 sleep 10
860 fi
861
862 echo; einfo "Setting up the chroot directory..."
863
864 mkdir -m 0750 -p ${CHROOT}
865 mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/{run,log}}
866 mkdir -m 0750 -p ${CHROOT}/etc/bind
867 mkdir -m 0770 -p ${CHROOT}/var/{bind,{run,log}/named}
868 # As of bind 9.8.0
869 if has_version net-dns/bind[gost]; then
870 if [ "$(get_libdir)" = "lib64" ]; then
871 mkdir -m 0755 -p ${CHROOT}/usr/lib64/engines
872 ln -s lib64 ${CHROOT}/usr/lib
873 else
874 mkdir -m 0755 -p ${CHROOT}/usr/lib/engines
875 fi
876 fi
877 chown root:named ${CHROOT} ${CHROOT}/var/{bind,{run,log}/named} ${CHROOT}/etc/bind
878
879 mknod ${CHROOT}/dev/null c 1 3
880 chmod 0666 ${CHROOT}/dev/null
881
882 mknod ${CHROOT}/dev/zero c 1 5
883 chmod 0666 ${CHROOT}/dev/zero
884
885 if use urandom; then
886 mknod ${CHROOT}/dev/urandom c 1 9
887 chmod 0666 ${CHROOT}/dev/urandom
888 else
889 mknod ${CHROOT}/dev/random c 1 8
890 chmod 0666 ${CHROOT}/dev/random
891 fi
892
893 if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
894 cp -a /etc/bind ${CHROOT}/etc/
895 cp -a /var/bind ${CHROOT}/var/
896 fi
897
898 if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then
899 mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP
900 fi
901
902 elog "You may need to add the following line to your syslog-ng.conf:"
903 elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };"
904 }