diff options
author | Kyle Manna <nitro@gentoo.org> | 2002-08-06 01:41:26 +0000 |
---|---|---|
committer | Kyle Manna <nitro@gentoo.org> | 2002-08-06 01:41:26 +0000 |
commit | ad911dda7ef2b2d299e5e151d7bc61d5664f7925 (patch) | |
tree | fdde09a8f6c7d35212772fecf0021e815edd9385 /net-dns/bind | |
parent | Masked net-dns/bind-9.2.1-r2. (diff) | |
download | historical-ad911dda7ef2b2d299e5e151d7bc61d5664f7925.tar.gz historical-ad911dda7ef2b2d299e5e151d7bc61d5664f7925.tar.bz2 historical-ad911dda7ef2b2d299e5e151d7bc61d5664f7925.zip |
Added BIND chroot support.
Diffstat (limited to 'net-dns/bind')
-rw-r--r-- | net-dns/bind/ChangeLog | 11 | ||||
-rw-r--r-- | net-dns/bind/bind-9.2.1-r2.ebuild | 113 | ||||
-rw-r--r-- | net-dns/bind/files/digest-bind-9.2.1-r2 | 1 | ||||
-rw-r--r-- | net-dns/bind/files/named.conf | 7 | ||||
-rw-r--r-- | net-dns/bind/files/named.confd | 13 | ||||
-rw-r--r-- | net-dns/bind/files/named.rc6 | 36 |
6 files changed, 172 insertions, 9 deletions
diff --git a/net-dns/bind/ChangeLog b/net-dns/bind/ChangeLog index 52db5adf2b65..1772a8af4343 100644 --- a/net-dns/bind/ChangeLog +++ b/net-dns/bind/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-dns/bind # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.3 2002/07/21 20:55:36 owen Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.4 2002/08/06 01:41:26 nitro Exp $ + +*bind-9.2.1-r2 (5 Aug 2002) + + 4 Aug 2002; Kyle Manna <nitro@gentoo.org> bind-9.2.1-r2.ebuild: + + Added support for chroot, updated init script. *bind-9.2.1-r1 (2 May 2002) @@ -8,12 +14,11 @@ Added PPC to KEYWORDS. - 20 Jul 2002; Kyle Manna <nitro@gentoo.org> bind-9.2.1-r1.ebuild: Moved away from emake to make. Parallel builds break on some systems. - 1 June 2002; Kyle Manna <nitro@gentoo.org> bind-9.2.1-r1.ebuild: + 1 Jun 2002; Kyle Manna <nitro@gentoo.org> bind-9.2.1-r1.ebuild: *Alot* of bug fixes: + We now have a man page for named.conf diff --git a/net-dns/bind/bind-9.2.1-r2.ebuild b/net-dns/bind/bind-9.2.1-r2.ebuild new file mode 100644 index 000000000000..168107e21889 --- /dev/null +++ b/net-dns/bind/bind-9.2.1-r2.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.2.1-r2.ebuild,v 1.1 2002/08/06 01:41:26 nitro Exp $ + +S=${WORKDIR}/${P} +DESCRIPTION="BIND - Name Server" +SRC_URI="ftp://ftp.isc.org/isc/bind9/${PV}/${P}.tar.gz" +HOMEPAGE="http://www.isc.org/products/BIND" + +KEYWORDS="x86 ppc" +LICENSE="as-is" +SLOT="0" + +DEPEND="sys-apps/groff + ssl? ( >=dev-libs/openssl-0.9.6 )" + +RDEPEND="${DEPEND}" + +src_compile() { + local myconf + + use ssl && myconf="${myconf} --with-openssl" + use ipv6 && myconf="${myconf} --enable-ipv6" + + ./configure \ + --prefix=/usr \ + --host=${CHOST} \ + --sysconfdir=/etc/bind \ + --localstatedir=/var \ + --enable-threads \ + --with-libtool \ + ${myconf} || die "failed to configure bind" + + make || die "failed to compile bind" +} + +src_install() { + make DESTDIR=${D} install || die "failed to install bind" + + for x in `grep -l -d recurse -e '/etc/named.conf' -e '/etc/rndc.conf' -e '/etc/rndc.key' ${D}/usr/man`; do + cp ${x} ${x}.orig + sed -e 's:/etc/named.conf:/etc/bind/named.conf:g' \ + -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' ${x}.orig > ${x} + rm ${x}.orig + done + + find ${D}/usr/man ! -name "*[1-8]gz" -type f -exec gzip -f "{}" \; + insinto /usr/man/man5 ; doins ${FILESDIR}/named.conf.5.gz + + dodoc CHANGES COPYRIGHT FAQ README + docinto misc ; dodoc doc/misc/* + docinto html ; dodoc doc/arm/* + docinto contrib ; dodoc contrib/named-bootconf/named-bootconf.sh \ + contrib/nanny/nanny.pl + + # some handy-dandy dynamic dns examples + cd ${D}/usr/share/doc/${PF} + tar pjxf ${FILESDIR}/dyndns-samples.tbz2 + + dodir /etc/bind /var/bind /var/bind/pri /var/bind/sec + + insinto /etc/bind ; doins ${FILESDIR}/named.conf + # ftp://ftp.rs.internic.net/domain/named.ca: + insinto /var/bind ; doins ${FILESDIR}/named.ca + insinto /var/bind/pri ; doins ${FILESDIR}/127.0.0 + + exeinto /etc/init.d ; newexe ${FILESDIR}/named.rc6 named + + dosym /var/bind/named.ca /var/bind/root.cache + dosym /var/bind/pri /etc/bind/pri + dosym /var/bind/sec /etc/bind/sec +} + +pkg_postinst() { + if [ ! -f '/etc/bind/rndc.key' ]; then + /usr/sbin/rndc-confgen -a -u named + fi + + install -d -o named -g named ${ROOT}/var/run/named \ + ${ROOT}/var/bind/pri ${ROOT}/var/bind/sec + chown -R named:named ${ROOT}/var/bind + + echo + einfo "Bind-9.2.1-r2 version and higher now include chroot support." + einfo "If you would like to run bind in chroot, run:" + einfo "\`ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\`" + echo +} + +pkg_config() { + # chroot concept contributed by j2ee (kevin@aptbasilicata.it) + + mkdir -p /chroot/dns/dev /chroot/dns/etc /chroot/dns/var /chroot/dns/var/run/named + chown -R named:named /chroot/dns/var/run/named + cp -R /etc/bind /chroot/dns/etc/ + cp /etc/localtime /chroot/dns/etc/localtime + chown named:named /chroot/dns/etc/bind/rndc.key + cp -R /var/bind /chroot/dns/var/ + mknod /chroot/dns/dev/zero c 1 5 + chmod 666 /chroot/dns/dev/zero + mknod /chroot/dns/dev/random c 1 8 + chmod 666 /chroot/dns/dev/random + cp -a /dev/log /chroot/dns/dev/log + + # Maybe do a `chattr +i etc etc/localtime var` here? What about a non-ext2 fs? + + chmod 700 /chroot + chown named:named /chroot/dns + chmod 700 /chroot/dns + + einfo "Add the following to your root .bashrc or .bash_profile:" + einfo "alias rndc='rndc -k /chroot/dns/etc/bind/rndc.key'" +} diff --git a/net-dns/bind/files/digest-bind-9.2.1-r2 b/net-dns/bind/files/digest-bind-9.2.1-r2 new file mode 100644 index 000000000000..77883cdb7ef5 --- /dev/null +++ b/net-dns/bind/files/digest-bind-9.2.1-r2 @@ -0,0 +1 @@ +MD5 692cff6f44e006ce6984b2c286949dd1 bind-9.2.1.tar.gz 5021044 diff --git a/net-dns/bind/files/named.conf b/net-dns/bind/files/named.conf index c1adafb6dc6a..fa4d4ceb4553 100644 --- a/net-dns/bind/files/named.conf +++ b/net-dns/bind/files/named.conf @@ -25,6 +25,13 @@ zone "." IN { file "named.ca"; }; +zone "localhost" IN { + type master; + file "pri/localhost"; + allow-update { none; }; + notify no; +}; + zone "0.0.127.in-addr.arpa" IN { type master; file "pri/127.0.0"; diff --git a/net-dns/bind/files/named.confd b/net-dns/bind/files/named.confd new file mode 100644 index 000000000000..ea2e0876beab --- /dev/null +++ b/net-dns/bind/files/named.confd @@ -0,0 +1,13 @@ +# Set various named options here. +# +OPTIONS="" + +# Set this to the number of processors you have. +# +CPU="1" + +# If you wish to run bind in a chroot, run: +# ebuild /var/db/pkg/net-dns/<bind version>/<bind-version> config +# and un-comment the following line. +# +#CHROOT="/chroot/dns" diff --git a/net-dns/bind/files/named.rc6 b/net-dns/bind/files/named.rc6 index e1def30e7739..36f6a2f01bfe 100644 --- a/net-dns/bind/files/named.rc6 +++ b/net-dns/bind/files/named.rc6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.rc6,v 1.1 2002/06/29 00:55:03 bangert Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.rc6,v 1.2 2002/08/06 01:41:26 nitro Exp $ opts="start stop reload restart" @@ -9,26 +9,50 @@ depend() { need net } +checkconfig() { + if [ ! -f /etc/bind/named.conf ] ; then + eerror "No /etc/bind/named.conf file exists!" + fi + + # In case someone doesn't have $CPU set from /etc/conf.d/named + if [ ! $CPU ] ; then + CPU=1 + fi + + if [ $CHROOT -a -d $CHROOT ] ; then + OPTIONS="${OPTIONS} -t ${CHROOT}" + PIDFILE="${CHROOT}/var/run/named/named.pid" + KEY="${CHROOT}/etc/bind/rndc.key" + else + PIDFILE="/var/run/named/named.pid" + KEY="/etc/bind/rndc.key" + fi +} + start() { ebegin "Starting named" - start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n 1 + checkconfig || return 1 + start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n $CPU $OPTIONS eend $? } stop() { ebegin "Stopping named" - start-stop-daemon --stop --quiet --pidfile /var/run/named/named.pid + checkconfig || return 2 + start-stop-daemon --stop --quiet --pidfile $PIDFILE eend $? } reload() { - if [ ! -f /var/run/named/named.pid ] ; then + checkconfig || return 3 + if [ ! -f $PIDFILE ] ; then /etc/init.d/named start exit fi - if [ -f /etc/bind/rndc.key ] ; then + + if [ -f $KEY ] ; then ebegin "Reloading named" - rndc reconfig + rndc -k $KEY reconfig eend $? else /etc/init.d/named restart fi |