Gentoo Archives: gentoo-commits

From: "Tobias Scherbaum (dertobi123)" <dertobi123@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-dns/bind: ChangeLog bind-9.4.2_p2-r1.ebuild bind-9.5.0_p2-r1.ebuild bind-9.5.0_p2.ebuild
Date: Sun, 03 Aug 2008 15:59:52
Message-Id: E1KPfzo-00039N-To@stork.gentoo.org
1 dertobi123 08/08/03 15:59:48
2
3 Modified: ChangeLog
4 Added: bind-9.4.2_p2-r1.ebuild bind-9.5.0_p2-r1.ebuild
5 Removed: bind-9.5.0_p2.ebuild
6 Log:
7 Fix threading, add dep on libcap (#220167)
8 (Portage version: 2.2_rc6/cvs/Linux 2.6.25-gentoo-r6 x86_64)
9
10 Revision Changes Path
11 1.210 net-dns/bind/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/ChangeLog?rev=1.210&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/ChangeLog?rev=1.210&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/ChangeLog?r1=1.209&r2=1.210
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v
20 retrieving revision 1.209
21 retrieving revision 1.210
22 diff -u -r1.209 -r1.210
23 --- ChangeLog 2 Aug 2008 20:03:45 -0000 1.209
24 +++ ChangeLog 3 Aug 2008 15:59:48 -0000 1.210
25 @@ -1,6 +1,13 @@
26 # ChangeLog for net-dns/bind
27 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.209 2008/08/02 20:03:45 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.210 2008/08/03 15:59:48 dertobi123 Exp $
30 +
31 +*bind-9.5.0_p2-r1 (03 Aug 2008)
32 +*bind-9.4.2_p2-r1 (03 Aug 2008)
33 +
34 + 03 Aug 2008; Tobias Scherbaum <dertobi123@g.o> +files/libcap.patch,
35 + +bind-9.4.2_p2-r1.ebuild, -bind-9.5.0_p2.ebuild, +bind-9.5.0_p2-r1.ebuild:
36 + Fix threading, add dep on libcap (#220167)
37
38 02 Aug 2008; Raúl Porcel <armin76@g.o> bind-9.4.2_p2.ebuild:
39 alpha/ia64/sparc/x86 stable wrt #233675
40
41
42
43 1.1 net-dns/bind/bind-9.4.2_p2-r1.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/bind-9.4.2_p2-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/bind-9.4.2_p2-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: bind-9.4.2_p2-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2008 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.4.2_p2-r1.ebuild,v 1.1 2008/08/03 15:59:48 dertobi123 Exp $
53
54 inherit eutils libtool autotools toolchain-funcs flag-o-matic
55
56 DLZ_VERSION="9.3.3"
57 MY_PV="${PV/_p2/-P2}"
58
59 DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
60 HOMEPAGE="http://www.isc.org/products/BIND/bind9.html"
61 SRC_URI="ftp://ftp.isc.org/isc/bind9/${MY_PV}/${PN}-${MY_PV}.tar.gz
62 doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
63
64 LICENSE="as-is"
65 SLOT="0"
66 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
67 IUSE="ssl ipv6 doc dlz postgres berkdb mysql odbc ldap selinux idn threads resolvconf urandom"
68
69 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6g )
70 mysql? ( >=virtual/mysql-4.0 )
71 odbc? ( >=dev-db/unixODBC-2.2.6 )
72 ldap? ( net-nds/openldap )
73 idn? ( net-dns/idnkit )
74 threads? ( >=sys-libs/libcap-2.1.0 )"
75
76 RDEPEND="${DEPEND}
77 selinux? ( sec-policy/selinux-bind )
78 resolvconf? ( || ( net-dns/openresolv net-dns/resolvconf-gentoo ) )"
79
80 S="${WORKDIR}/${PN}-${MY_PV}"
81
82 pkg_setup() {
83 use threads && {
84 echo
85 ewarn "If you're in vserver enviroment, you're probably want to"
86 ewarn "disable threads support because of linux capabilities dependency"
87 echo
88 }
89
90 ebegin "Creating named group and user"
91 enewgroup named 40
92 enewuser named 40 -1 /etc/bind named
93 eend ${?}
94 }
95
96 src_unpack() {
97 unpack ${A}
98 cd "${S}"
99
100 # Adjusting PATHs in manpages
101 for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
102 sed -i \
103 -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
104 -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
105 -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
106 "${i}"
107 done
108
109 # bind needs a newer libcap #220167
110 use threads && epatch "${FILESDIR}"/libcap.patch
111
112 use dlz && epatch "${FILESDIR}"/${PN}-9.4.0-dlzbdb-close_cursor.patch
113
114 # bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse
115 # (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/)
116 use dlz && use mysql && epatch "${FILESDIR}"/bind-dlzmysql5-reconnect.patch
117
118 # should be installed by bind-tools
119 sed -e "s:nsupdate ::g" -i "${S}"/bin/Makefile.in
120
121 # bug #220361
122 rm "${S}"/aclocal.m4 "${S}"/libtool.m4
123 WANT_AUTOCONF=2.5 AT_NO_RECURSIVE=1 eautoreconf
124
125 # bug #151839
126 sed -e \
127 's:struct isc_socket {:#undef SO_BSDCOMPAT\n\nstruct isc_socket {:' \
128 -i lib/isc/unix/socket.c
129
130 # remove useless c++ checks
131 epunt_cxx
132 }
133
134 src_compile() {
135 local myconf=""
136
137 use ssl && myconf="${myconf} --with-openssl"
138 use idn && myconf="${myconf} --with-idn"
139
140 use dlz && {
141 myconf="${myconf} --with-dlz-filesystem --with-dlz-stub"
142 use postgres && myconf="${myconf} --with-dlz-postgres"
143 use mysql && myconf="${myconf} --with-dlz-mysql"
144 use berkdb && myconf="${myconf} --with-dlz-bdb"
145 use ldap && myconf="${myconf} --with-dlz-ldap"
146 use odbc && myconf="${myconf} --with-dlz-odbc"
147 }
148
149 if use threads; then
150 if use dlz && use mysql; then
151 echo
152 ewarn
153 ewarn "MySQL uses thread local storage in its C api. Thus MySQL"
154 ewarn "requires that each thread of an application execute a MySQL"
155 ewarn "\"thread initialization\" to setup the thread local storage."
156 ewarn "This is impossible to do safely while staying within the DLZ"
157 ewarn "driver API. This is a limitation caused by MySQL, and not"
158 ewarn "the DLZ API."
159 ewarn "Because of this BIND MUST only run with a single thread when"
160 ewarn "using the MySQL driver."
161 ewarn
162 myconf="${myconf} --disable-linux-caps --disable-threads"
163 ewarn "Threading support disabled"
164 epause 10
165 else
166 myconf="${myconf} --enable-linux-caps --enable-threads"
167 einfo "Threading support enabled"
168 fi
169 else
170 myconf="${myconf} --disable-linux-caps --disable-threads"
171 fi
172
173 if use urandom; then
174 myconf="${myconf} --with-randomdev=/dev/urandom"
175 else
176 myconf="${myconf} --with-randomdev=/dev/random"
177 fi
178
179 # bug #158664
180 gcc-specs-ssp && replace-flags -O[23s] -O
181 export BUILD_CC="${CBUILD}-gcc"
182 econf \
183 --sysconfdir=/etc/bind \
184 --localstatedir=/var \
185 --with-libtool \
186 `use_enable ipv6` \
187 ${myconf} || die "econf failed"
188
189 emake -j1 || die "failed to compile bind"
190 }
191
192 src_install() {
193 einstall || die "failed to install bind"
194
195 dodoc CHANGES COPYRIGHT FAQ README
196
197 use doc && {
198 docinto misc
199 dodoc doc/misc/*
200
201 docinto html
202 dohtml doc/arm/*
203
204 docinto draft
205 dodoc doc/draft/*
206
207 docinto rfc
208 dodoc doc/rfc/*
209
210 docinto contrib
211 dodoc contrib/named-bootconf/named-bootconf.sh \
212 contrib/nanny/nanny.pl
213
214 # some handy-dandy dynamic dns examples
215 cd "${D}"/usr/share/doc/${PF}
216 tar pjxf ${DISTFILES}/dyndns-samples.tbz2
217 }
218
219 newenvd "${FILESDIR}"/10bind.env 10bind
220
221 dodir /etc/bind /var/bind/{pri,sec}
222 keepdir /var/bind/sec
223
224 insinto /etc/bind ; newins "${FILESDIR}"/named.conf-r3 named.conf
225
226 # ftp://ftp.rs.internic.net/domain/named.ca:
227 insinto /var/bind ; doins "${FILESDIR}"/named.ca
228
229 insinto /var/bind/pri
230 doins "${FILESDIR}"/127.zone
231 newins "${FILESDIR}"/localhost.zone-r2 localhost.zone
232
233 newinitd "${FILESDIR}"/named.init-r5 named
234 newconfd "${FILESDIR}"/named.confd-r2 named
235
236 dosym ../../var/bind/named.ca /var/bind/root.cache
237 dosym ../../var/bind/pri /etc/bind/pri
238 dosym ../../var/bind/sec /etc/bind/sec
239
240 # Let's get rid of those tools and their manpages since they're provided by bind-tools
241 rm -f "${D}"/usr/share/man/man1/{dig.1,host.1,nslookup.1}
242 rm -f "${D}"/usr/share/man/man8/{dnssec-keygen.8,nsupdate.8}
243 rm -f "${D}"/usr/bin/{dig,host,nslookup,dnssec-keygen,nsupdate}
244
245 use resolvconf && {
246 exeinto /etc/resolvconf/update.d
247 newexe "${FILESDIR}"/resolvconf.bind bind
248 }
249 }
250
251 pkg_postinst() {
252 if [ ! -f '/etc/bind/rndc.key' ]; then
253 if [ -c /dev/urandom ]; then
254 einfo "Using /dev/urandom for generating rndc.key"
255 /usr/sbin/rndc-confgen -r /dev/urandom -a -u named
256 echo
257 else
258 einfo "Using /dev/random for generating rndc.key"
259 /usr/sbin/rndc-confgen -a -u named
260 echo
261 fi
262 fi
263
264 install -d -o named -g named "${ROOT}"/var/run/named \
265 "${ROOT}"/var/bind/pri "${ROOT}"/var/bind/sec
266 chown -R named:named "${ROOT}"/var/bind
267
268 elog "The default zone files are now installed as *.zone,"
269 elog "be careful merging config files if you have modified"
270 elog "/var/bind/pri/127 or /var/bind/pri/localhost"
271 elog
272 elog "You can edit /etc/conf.d/named to customize named settings"
273 elog
274 elog "The BIND ebuild now includes chroot support."
275 elog "If you like to run bind in chroot AND this is a new install OR"
276 elog "your bind doesn't already run in chroot, simply run:"
277 elog "\`emerge --config '=${CATEGORY}/${PF}'\`"
278 elog "Before running the above command you might want to change the chroot"
279 elog "dir in /etc/conf.d/named. Otherwise /chroot/dns will be used."
280 elog
281 elog "Recently verisign added a wildcard A record to the .COM and .NET TLD"
282 elog "zones making all .com and .net domains appear to be registered"
283 elog "This causes many problems such as breaking important anti-spam checks"
284 elog "which verify source domains exist. ISC released a patch for BIND which"
285 elog "adds 'delegation-only' zones to allow admins to return the .com and .net"
286 elog "domain resolution to their normal function."
287 elog
288 elog "There is no need to create a com or net data file. Just the"
289 elog "entries to the named.conf file is enough."
290 elog
291 elog " zone "com" IN { type delegation-only; };"
292 elog " zone "net" IN { type delegation-only; };"
293
294 echo
295 ewarn "BIND >=9.2.5 makes the priority argument to MX records mandatory"
296 ewarn "when it was previously optional. If the priority is missing, BIND"
297 ewarn "won't load the zone file at all."
298 echo
299 }
300
301 pkg_config() {
302 CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/named 2>/dev/null`
303 EXISTS="no"
304
305 if [ -z "${CHROOT}" -a ! -d "/chroot/dns" ]; then
306 CHROOT="/chroot/dns"
307 elif [ -d ${CHROOT} ]; then
308 eerror; eerror "${CHROOT:-/chroot/dns} already exists. Quitting."; eerror; EXISTS="yes"
309 fi
310
311 if [ ! "$EXISTS" = yes ]; then
312 einfo ; einfon "Setting up the chroot directory..."
313 mkdir -m 700 -p ${CHROOT}
314 mkdir -p ${CHROOT}/{dev,etc,var/run/named}
315 chown -R named:named ${CHROOT}/var/run/named
316 cp -R /etc/bind ${CHROOT}/etc/
317 cp /etc/localtime ${CHROOT}/etc/localtime
318 chown named:named ${CHROOT}/etc/bind/rndc.key
319 cp -R /var/bind ${CHROOT}/var/
320 chown -R named:named ${CHROOT}/var/
321 mknod ${CHROOT}/dev/zero c 1 5
322 mknod ${CHROOT}/dev/random c 1 8
323 chmod 666 ${CHROOT}/dev/{random,zero}
324 chown root:named ${CHROOT}
325 chmod 0750 ${CHROOT}
326
327 grep -q "^#[[:blank:]]\?CHROOT" /etc/conf.d/named ; RETVAL=$?
328 if [ $RETVAL = 0 ]; then
329 sed 's/^# \?\(CHROOT.*\)$/\1/' /etc/conf.d/named > /etc/conf.d/named.orig 2>/dev/null
330 mv --force /etc/conf.d/named.orig /etc/conf.d/named
331 fi
332
333 sleep 1; echo " Done."; sleep 1
334 einfo
335 einfo "Add the following to your root .bashrc or .bash_profile: "
336 einfo " alias rndc='rndc -k ${CHROOT}/etc/bind/rndc.key'"
337 einfo "Then do the following: "
338 einfo " source /root/.bashrc or .bash_profile"
339 einfo
340 fi
341 }
342
343
344
345 1.1 net-dns/bind/bind-9.5.0_p2-r1.ebuild
346
347 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/bind-9.5.0_p2-r1.ebuild?rev=1.1&view=markup
348 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/bind-9.5.0_p2-r1.ebuild?rev=1.1&content-type=text/plain
349
350 Index: bind-9.5.0_p2-r1.ebuild
351 ===================================================================
352 # Copyright 1999-2008 Gentoo Foundation
353 # Distributed under the terms of the GNU General Public License v2
354 # $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.5.0_p2-r1.ebuild,v 1.1 2008/08/03 15:59:48 dertobi123 Exp $
355
356 inherit eutils libtool autotools toolchain-funcs flag-o-matic
357
358 MY_PV="${PV/_p2/-P2}"
359 SDB_LDAP_VER="1.1.0"
360
361 DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
362 HOMEPAGE="http://www.isc.org/products/BIND/bind9.html"
363 SRC_URI="ftp://ftp.isc.org/isc/bind9/${MY_PV}/${PN}-${MY_PV}.tar.gz
364 sdb-ldap? ( mirror://gentoo/bind-sdb-ldap-${SDB_LDAP_VER}.tar.bz2 )
365 doc? ( mirror://gentoo/dyndns-samples.tbz2 )"
366
367 LICENSE="as-is"
368 SLOT="0"
369 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
370 IUSE="ssl ipv6 doc dlz postgres berkdb mysql odbc ldap selinux idn threads resolvconf urandom sdb-ldap"
371
372 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6g )
373 mysql? ( >=virtual/mysql-4.0 )
374 odbc? ( >=dev-db/unixODBC-2.2.6 )
375 ldap? ( net-nds/openldap )
376 idn? ( net-dns/idnkit )
377 threads? ( >=sys-libs/libcap-2.1.0 )"
378
379 RDEPEND="${DEPEND}
380 selinux? ( sec-policy/selinux-bind )
381 resolvconf? ( || ( net-dns/openresolv net-dns/resolvconf-gentoo ) )"
382
383 S="${WORKDIR}/${PN}-${MY_PV}"
384
385 pkg_setup() {
386 use threads && {
387 echo
388 ewarn "If you're in vserver enviroment, you're probably want to"
389 ewarn "disable threads support because of linux capabilities dependency"
390 echo
391 }
392
393 ebegin "Creating named group and user"
394 enewgroup named 40
395 enewuser named 40 -1 /etc/bind named
396 eend ${?}
397 }
398
399 src_unpack() {
400 unpack ${A}
401 cd "${S}"
402
403 # Adjusting PATHs in manpages
404 for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do
405 sed -i \
406 -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
407 -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
408 -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
409 "${i}"
410 done
411
412 # bind needs a newer libcap #220167
413 use threads && epatch "${FILESDIR}"/libcap.patch
414
415 use dlz && epatch "${FILESDIR}"/${PN}-9.4.0-dlzbdb-close_cursor.patch
416
417 # bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse
418 # (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/)
419 use dlz && use mysql && has_version ">=dev-db/mysql-5" && epatch "${FILESDIR}"/bind-dlzmysql5-reconnect.patch
420
421 # should be installed by bind-tools
422 sed -e "s:nsupdate ::g" -i "${S}"/bin/Makefile.in
423
424 # sdb-ldap patch as per bug #160567
425 # Upstream URL: http://bind9-ldap.bayour.com/
426 use sdb-ldap && epatch "${WORKDIR}"/sdb-ldap/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch
427
428 # bug #220361
429 rm "${S}"/aclocal.m4 "${S}"/libtool.m4
430 WANT_AUTOCONF=2.5 AT_NO_RECURSIVE=1 eautoreconf
431
432 # bug #151839
433 sed -e \
434 's:struct isc_socket {:#undef SO_BSDCOMPAT\n\nstruct isc_socket {:' \
435 -i lib/isc/unix/socket.c
436
437 # remove useless c++ checks
438 epunt_cxx
439 }
440
441 src_compile() {
442 local myconf=""
443
444 use ssl && myconf="${myconf} --with-openssl"
445 use idn && myconf="${myconf} --with-idn"
446
447 use dlz && {
448 myconf="${myconf} --with-dlz-filesystem --with-dlz-stub"
449 use postgres && myconf="${myconf} --with-dlz-postgres"
450 use mysql && myconf="${myconf} --with-dlz-mysql"
451 use berkdb && myconf="${myconf} --with-dlz-bdb"
452 use ldap && myconf="${myconf} --with-dlz-ldap"
453 use odbc && myconf="${myconf} --with-dlz-odbc"
454 }
455
456 if use threads; then
457 if use dlz && use mysql; then
458 echo
459 ewarn
460 ewarn "MySQL uses thread local storage in its C api. Thus MySQL"
461 ewarn "requires that each thread of an application execute a MySQL"
462 ewarn "\"thread initialization\" to setup the thread local storage."
463 ewarn "This is impossible to do safely while staying within the DLZ"
464 ewarn "driver API. This is a limitation caused by MySQL, and not"
465 ewarn "the DLZ API."
466 ewarn "Because of this BIND MUST only run with a single thread when"
467 ewarn "using the MySQL driver."
468 ewarn
469 myconf="${myconf} --disable-linux-caps --disable-threads"
470 ewarn "Threading support disabled"
471 epause 10
472 else
473 myconf="${myconf} --enable-linux-caps --enable-threads"
474 einfo "Threading support enabled"
475 fi
476 else
477 myconf="${myconf} --disable-linux-caps --disable-threads"
478 fi
479
480 if use urandom; then
481 myconf="${myconf} --with-randomdev=/dev/urandom"
482 else
483 myconf="${myconf} --with-randomdev=/dev/random"
484 fi
485
486 # bug #227333
487 append-flags -D_GNU_SOURCE
488
489 # bug #158664
490 gcc-specs-ssp && replace-flags -O[23s] -O
491 export BUILD_CC="${CBUILD}-gcc"
492 econf \
493 --sysconfdir=/etc/bind \
494 --localstatedir=/var \
495 --with-libtool \
496 `use_enable ipv6` \
497 ${myconf} || die "econf failed"
498
499 emake -j1 || die "failed to compile bind"
500 }
501
502 src_install() {
503 einstall || die "failed to install bind"
504
505 dodoc CHANGES COPYRIGHT FAQ README
506
507 use doc && {
508 docinto misc
509 dodoc doc/misc/*
510
511 docinto html
512 dohtml doc/arm/*
513
514 docinto draft
515 dodoc doc/draft/*
516
517 docinto rfc
518 dodoc doc/rfc/*
519
520 docinto contrib
521 dodoc contrib/named-bootconf/named-bootconf.sh \
522 contrib/nanny/nanny.pl
523
524 # some handy-dandy dynamic dns examples
525 cd "${D}"/usr/share/doc/${PF}
526 tar pjxf ${DISTFILES}/dyndns-samples.tbz2
527 }
528
529 newenvd "${FILESDIR}"/10bind.env 10bind
530
531 dodir /etc/bind /var/bind/{pri,sec}
532 keepdir /var/bind/sec
533
534 insinto /etc/bind ; newins "${FILESDIR}"/named.conf-r3 named.conf
535
536 # ftp://ftp.rs.internic.net/domain/named.ca:
537 insinto /var/bind ; doins "${FILESDIR}"/named.ca
538
539 insinto /var/bind/pri
540 doins "${FILESDIR}"/127.zone
541 newins "${FILESDIR}"/localhost.zone-r2 localhost.zone
542
543 newinitd "${FILESDIR}"/named.init-r5 named
544 newconfd "${FILESDIR}"/named.confd-r2 named
545
546 dosym ../../var/bind/named.ca /var/bind/root.cache
547 dosym ../../var/bind/pri /etc/bind/pri
548 dosym ../../var/bind/sec /etc/bind/sec
549
550 # Let's get rid of those tools and their manpages since they're provided by bind-tools
551 rm -f "${D}"/usr/share/man/man1/{dig.1,host.1,nslookup.1}
552 rm -f "${D}"/usr/share/man/man8/{dnssec-keygen.8,nsupdate.8}
553 rm -f "${D}"/usr/bin/{dig,host,nslookup,dnssec-keygen,nsupdate}
554
555 use resolvconf && {
556 exeinto /etc/resolvconf/update.d
557 newexe "${FILESDIR}"/resolvconf.bind bind
558 }
559 }
560
561 pkg_postinst() {
562 if [ ! -f '/etc/bind/rndc.key' ]; then
563 if [ -c /dev/urandom ]; then
564 einfo "Using /dev/urandom for generating rndc.key"
565 /usr/sbin/rndc-confgen -r /dev/urandom -a -u named
566 echo
567 else
568 einfo "Using /dev/random for generating rndc.key"
569 /usr/sbin/rndc-confgen -a -u named
570 echo
571 fi
572 fi
573
574 install -d -o named -g named "${ROOT}"/var/run/named \
575 "${ROOT}"/var/bind/pri "${ROOT}"/var/bind/sec
576 chown -R named:named "${ROOT}"/var/bind
577
578 elog "The default zone files are now installed as *.zone,"
579 elog "be careful merging config files if you have modified"
580 elog "/var/bind/pri/127 or /var/bind/pri/localhost"
581 elog
582 elog "You can edit /etc/conf.d/named to customize named settings"
583 elog
584 elog "The BIND ebuild now includes chroot support."
585 elog "If you like to run bind in chroot AND this is a new install OR"
586 elog "your bind doesn't already run in chroot, simply run:"
587 elog "\`emerge --config '=${CATEGORY}/${PF}'\`"
588 elog "Before running the above command you might want to change the chroot"
589 elog "dir in /etc/conf.d/named. Otherwise /chroot/dns will be used."
590 elog
591 elog "Recently verisign added a wildcard A record to the .COM and .NET TLD"
592 elog "zones making all .com and .net domains appear to be registered"
593 elog "This causes many problems such as breaking important anti-spam checks"
594 elog "which verify source domains exist. ISC released a patch for BIND which"
595 elog "adds 'delegation-only' zones to allow admins to return the .com and .net"
596 elog "domain resolution to their normal function."
597 elog
598 elog "There is no need to create a com or net data file. Just the"
599 elog "entries to the named.conf file is enough."
600 elog
601 elog " zone "com" IN { type delegation-only; };"
602 elog " zone "net" IN { type delegation-only; };"
603
604 echo
605 ewarn "BIND >=9.2.5 makes the priority argument to MX records mandatory"
606 ewarn "when it was previously optional. If the priority is missing, BIND"
607 ewarn "won't load the zone file at all."
608 echo
609 }
610
611 pkg_config() {
612 CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/named 2>/dev/null`
613 EXISTS="no"
614
615 if [ -z "${CHROOT}" -a ! -d "/chroot/dns" ]; then
616 CHROOT="/chroot/dns"
617 elif [ -d ${CHROOT} ]; then
618 eerror; eerror "${CHROOT:-/chroot/dns} already exists. Quitting."; eerror; EXISTS="yes"
619 fi
620
621 if [ ! "$EXISTS" = yes ]; then
622 einfo ; einfon "Setting up the chroot directory..."
623 mkdir -m 700 -p ${CHROOT}
624 mkdir -p ${CHROOT}/{dev,etc,var/run/named}
625 chown -R named:named ${CHROOT}/var/run/named
626 cp -R /etc/bind ${CHROOT}/etc/
627 cp /etc/localtime ${CHROOT}/etc/localtime
628 chown named:named ${CHROOT}/etc/bind/rndc.key
629 cp -R /var/bind ${CHROOT}/var/
630 chown -R named:named ${CHROOT}/var/
631 mknod ${CHROOT}/dev/zero c 1 5
632 mknod ${CHROOT}/dev/random c 1 8
633 chmod 666 ${CHROOT}/dev/{random,zero}
634 chown root:named ${CHROOT}
635 chmod 0750 ${CHROOT}
636
637 grep -q "^#[[:blank:]]\?CHROOT" /etc/conf.d/named ; RETVAL=$?
638 if [ $RETVAL = 0 ]; then
639 sed 's/^# \?\(CHROOT.*\)$/\1/' /etc/conf.d/named > /etc/conf.d/named.orig 2>/dev/null
640 mv --force /etc/conf.d/named.orig /etc/conf.d/named
641 fi
642
643 sleep 1; echo " Done."; sleep 1
644 einfo
645 einfo "Add the following to your root .bashrc or .bash_profile: "
646 einfo " alias rndc='rndc -k ${CHROOT}/etc/bind/rndc.key'"
647 einfo "Then do the following: "
648 einfo " source /root/.bashrc or .bash_profile"
649 einfo
650 fi
651 }