Sfoglia il codice sorgente

new package: BIND 8.3.1 (legacy packaging)

Ralf S. Engelschall 24 anni fa
parent
commit
68ff7cd5b1
8 ha cambiato i file con 463 aggiunte e 0 eliminazioni
  1. 77 0
      bind8/bind.patch
  2. 182 0
      bind8/bind8.spec
  3. 18 0
      bind8/db.127.0.0
  4. 18 0
      bind8/db.localhost
  5. 36 0
      bind8/db.root
  6. 32 0
      bind8/db.root.sh
  7. 60 0
      bind8/named.conf
  8. 40 0
      bind8/rc.bind

+ 77 - 0
bind8/bind.patch

@@ -0,0 +1,77 @@
+--- src/lib/isc/eventlib.c.orig	Fri Feb  4 08:25:39 2000
++++ src/lib/isc/eventlib.c	Wed Mar  7 11:51:38 2001
+@@ -293,9 +293,15 @@
+ 			evPrintf(ctx, 4,
+ 				"pselect(%d, 0x%lx, 0x%lx, 0x%lx, %d.%09ld)\n",
+ 				 ctx->fdMax+1,
++#if 0
+ 				 (u_long)ctx->rdLast.fds_bits[0],
+ 				 (u_long)ctx->wrLast.fds_bits[0],
+ 				 (u_long)ctx->exLast.fds_bits[0],
++#else
++				 (u_long)&(ctx->rdLast),
++				 (u_long)&(ctx->wrLast),
++				 (u_long)&(ctx->exLast),
++#endif
+ 				 tp ? tp->tv_sec : -1,
+ 				 tp ? tp->tv_nsec : -1);
+ 
+--- src/lib/isc/ev_files.c.orig	Thu Oct  7 22:44:04 1999
++++ src/lib/isc/ev_files.c	Wed Mar  7 11:53:04 2001
+@@ -140,9 +140,15 @@
+ 	evPrintf(ctx, 5,
+ 		"evSelectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
+ 		 fd, eventmask,
++#if 0
+ 		 (u_long)ctx->rdNext.fds_bits[0],
+ 		 (u_long)ctx->wrNext.fds_bits[0],
+ 		 (u_long)ctx->exNext.fds_bits[0]);
++#else
++		 (u_long)&(ctx->rdNext),
++		 (u_long)&(ctx->wrNext),
++		 (u_long)&(ctx->exNext));
++#endif
+ 
+ 	return (0);
+ }
+@@ -251,9 +257,15 @@
+ 	evPrintf(ctx, 5,
+ 	      "evDeselectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
+ 		 del->fd, eventmask,
++#if 0
+ 		 (u_long)ctx->rdNext.fds_bits[0],
+ 		 (u_long)ctx->wrNext.fds_bits[0],
+ 		 (u_long)ctx->exNext.fds_bits[0]);
++#else
++		 (u_long)&(ctx->rdNext),
++		 (u_long)&(ctx->wrNext),
++		 (u_long)&(ctx->exNext));
++#endif
+ 
+ 	/* Couldn't free it before now since we were using fields out of it. */
+ 	FREE(del);
+--- src/port/freebsd/include/port_before.h.orig	Wed Oct 31 23:29:21 2001
++++ src/port/freebsd/include/port_before.h	Tue Feb 26 21:50:52 2002
+@@ -15,6 +15,7 @@
+ #define SETPWENT_VOID
+ #endif
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ 
+ #define GROUP_R_RETURN struct group *
+@@ -26,8 +27,14 @@
+ #define GROUP_R_ENT_ARGS void
+ #define GROUP_R_OK gptr
+ #define GROUP_R_BAD NULL
++
++#if defined(__FreeBSD_version) && __FreeBSD_version >= 500030
++#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \
++			  int *ngroups
++#else
+ #define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, \
+ 			  int *ngroups
++#endif
+ 
+ #define HOST_R_RETURN struct hostent *
+ #define HOST_R_SET_RETURN void

+ 182 - 0
bind8/bind8.spec

@@ -0,0 +1,182 @@
+##
+##  bind8.spec -- OpenPKG RPM Specification
+##  Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
+##  Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
+##  Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE. 
+##  
+
+#   package information
+Name:         bind8
+Summary:      Berkeley Internet Name Domain (BIND)
+URL:          http://www.isc.org/products/BIND/
+Vendor:       Free Software Foundation
+Packager:     The OpenPKG Project
+Distribution: OpenPKG [REL]
+Group:        DNS
+License:      GPL
+Version:      8.3.1
+Release:      20020306
+
+#   list of sources
+Source0:      ftp://ftp.isc.org/isc/bind/src/%{version}/bind-src.tar.gz
+Source1:      ftp://ftp.isc.org/isc/bind/src/%{version}/bind-doc.tar.gz
+Source2:      db.root
+Source3:      db.root.sh
+Source4:      db.localhost
+Source5:      db.127.0.0
+Source6:      named.conf
+Source7:      rc.bind
+Patch0:       bind.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20011227, make, flex, bison
+PreReq:       OpenPKG, openpkg >= 20011227
+AutoReq:      no
+AutoReqProv:  no
+Conflicts:    bind
+
+%description
+    Berkeley Internet Name Domain (BIND) is an implementation of
+    the Domain Name System (DNS) protocols and provides an openly
+    redistributable reference implementation of the major components
+    of the Domain Name System, including a Domain Name System server
+    (named)
+
+%prep
+    %setup0 -q -c -n bind8-%{version}
+    %setup1 -q -T -D -a 1
+    %patch0 -p0
+
+%build
+    PATH="%{l_prefix}/bin:$PATH"; export PATH
+    cd src
+    
+    #   make sure BIND accepts our overriding parameters later
+    systype=`sh ./port/systype`
+    rm -f .settings .systype
+    echo "'DESTINC=/dummy'" >>port/$systype/Makefile.set
+    echo "'DESTLIB=/dummy'" >>port/$systype/Makefile.set
+
+    #   find a reasonable compiler, but because of BIND v8's
+    #   system dependend linking stuff, we have to use the vendor
+    #   version on some platforms.
+    cc="%{l_cc}"
+    case $systype in
+        freebsd ) cc="/usr/bin/cc" ;;
+    esac
+    cc="$cc"
+
+    #   now configure and build the package 
+    %{l_make} %{l_mflags} \
+        CC="$cc" \
+        DESTDIR="$RPM_BUILD_ROOT" \
+        DESTBIN="%{l_prefix}/bin" \
+        DESTSBIN="%{l_prefix}/sbin" \
+        DESTEXEC="%{l_prefix}/libexec/bind" \
+        DESTHELP="%{l_prefix}/etc/bind" \
+        DESTETC="%{l_prefix}/etc/bind" \
+        DESTINC="%{l_prefix}/include/bind" \
+        DESTLIB="%{l_prefix}/lib" \
+        DESTRUN="%{l_prefix}/var/bind"
+
+%install
+    rm -rf $RPM_BUILD_ROOT
+    PATH="%{l_prefix}/bin:$PATH"; export PATH
+
+    #   install the standard stuff
+    ( cd src
+      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT INSTALL_LIB=""
+      strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+    )
+
+    #   strip down installation
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/mkservdb
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/etc/bind/nslookup.help
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/sbin/irpd
+    strip $RPM_BUILD_ROOT%{l_prefix}/bin/*          > /dev/null 2>&1 || true
+    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/*         > /dev/null 2>&1 || true
+    strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* > /dev/null 2>&1 || true
+
+    #   install manual pages
+    ( cd doc/man
+      for i in 1 8; do
+          %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i
+          %{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/
+      done
+    )
+
+    #   remove superfluous manual pages
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1
+
+    #   install run-command script
+    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+    %{l_shtool} install -c -m 755 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        -e 's;@l_fsusr@;%{l_fsusr};g' \
+        -e 's;@l_fsgrp@;%{l_fsgrp};g' \
+        %{SOURCE rc.bind} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   install a reasonable default configuration
+    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind
+    %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
+        %{SOURCE named.conf} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
+    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
+    %{l_shtool} install -c -m 644 \
+        %{SOURCE db.127.0.0} \
+        %{SOURCE db.localhost} \
+        %{SOURCE db.root} \
+        %{SOURCE db.root.sh} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
+
+    #   create an empty var directory
+    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind
+
+    #   determine the installed files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %{l_prefix}/etc/bind/named.conf' \
+        '%config %{l_prefix}/etc/bind/named.db/*'
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+
+%pre
+    if [ $1 -gt 1 ]; then
+        #   stop daemon before any upgrade
+        $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
+    fi
+ 
+%preun
+    if [ $1 -eq 0 ]; then
+        #   stop daemon before removing package
+        $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
+        #   remove dynamically generated files
+        rm -f $RPM_INSTALL_PREFIX/var/bind/*
+    fi
+

+ 18 - 0
bind8/db.127.0.0

@@ -0,0 +1,18 @@
+;
+;   db.127.0.0 -- zonefile for the reverse mapping of the loopback network
+;
+
+$ORIGIN 0.0.127.in-addr.arpa.
+$TTL    86400       ; = 1D
+
+@       IN  SOA     localhost. root.localhost. (
+                        2001010101 ; SERIAL
+                        6H         ; REFRESH: Secondaries refresh
+                        60M        ; RETRY:   Secondaries retry
+                        1W         ; EXPIRE:  Maximum TTL of data (expiry)
+                        1D         ; MINTTL:  Minimum TTL of data (expiry)
+                    )
+    
+        IN  NS      @
+1       IN  PTR     localhost.
+

+ 18 - 0
bind8/db.localhost

@@ -0,0 +1,18 @@
+;
+;   db.localhost -- zonefile for the forward mapping of the loopback network
+;
+
+$ORIGIN localhost.
+$TTL    86400       ; = 1D
+
+@       IN  SOA     localhost. root.localhost. (
+                            2001010101 ; SERIAL
+                            6H         ; REFRESH: Secondaries refresh
+                            60M        ; RETRY:   Secondaries retry
+                            1W         ; EXPIRE:  Maximum TTL of data (expiry)
+                            1D         ; MINTTL:  Minimum TTL of data (expiry)
+                    )
+    
+        IN  NS      @
+        IN  A       127.0.0.1
+

+ 36 - 0
bind8/db.root

@@ -0,0 +1,36 @@
+;
+;   db.root -- BIND "hint" file
+;   [automatically created on Wed Jan 17 10:27:26 CET 2001 by db.root.sh]
+;
+;   Notice: Although this file officially is only used to initially load
+;   the cache of the BIND nameserver, it is actually used to specify the
+;   root nameservers only.
+;
+
+.                    99999999  IN  NS  A.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  B.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  C.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  D.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  E.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  F.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  G.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  H.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  I.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  J.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  K.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  L.ROOT-SERVERS.NET.
+.                    99999999  IN  NS  M.ROOT-SERVERS.NET.
+A.ROOT-SERVERS.NET.  99999999  IN  A   198.41.0.4
+B.ROOT-SERVERS.NET.  99999999  IN  A   128.9.0.107
+C.ROOT-SERVERS.NET.  99999999  IN  A   192.33.4.12
+D.ROOT-SERVERS.NET.  99999999  IN  A   128.8.10.90
+E.ROOT-SERVERS.NET.  99999999  IN  A   192.203.230.10
+F.ROOT-SERVERS.NET.  99999999  IN  A   192.5.5.241
+G.ROOT-SERVERS.NET.  99999999  IN  A   192.112.36.4
+H.ROOT-SERVERS.NET.  99999999  IN  A   128.63.2.53
+I.ROOT-SERVERS.NET.  99999999  IN  A   192.36.148.17
+J.ROOT-SERVERS.NET.  99999999  IN  A   198.41.0.10
+K.ROOT-SERVERS.NET.  99999999  IN  A   193.0.14.129
+L.ROOT-SERVERS.NET.  99999999  IN  A   198.32.64.12
+M.ROOT-SERVERS.NET.  99999999  IN  A   202.12.27.33
+

+ 32 - 0
bind8/db.root.sh

@@ -0,0 +1,32 @@
+#!/bin/sh
+
+SERVER=a.root-servers.net
+TMPFILE=/tmp/tmp.$$
+ROOTFILE=./db.root
+
+date=`date`
+cat >$ROOTFILE <<EOT
+;
+;   db.root -- BIND "hint" file
+;   [automatically created on $date by db.root.sh]
+;
+;   Notice: Although this file officially is only used to initially load
+;   the cache of the BIND nameserver, it is actually used to specify the
+;   root nameservers only.
+;
+
+EOT
+nslookup >$TMPFILE <<-EOF
+server $SERVER
+set type=NS
+.
+EOF
+cat $TMPFILE |\
+awk '
+  /nameserver =/ { printf("%-20s 99999999  IN  NS  %s.\n",   ".", $NF); }
+  /address =/    { printf("%-20s 99999999  IN  A   %s\n", $1 ".", $NF); }
+' |\
+sort >>$ROOTFILE
+rm $TMPFILE
+echo "" >>$ROOTFILE
+

+ 60 - 0
bind8/named.conf

@@ -0,0 +1,60 @@
+## 
+##  @l_prefix@/etc/bind/named.conf -- BIND configuration
+##
+
+logging {
+    channel logfile {
+        file "@l_prefix@/var/bind/named.log";
+        severity info;
+        print-category yes;
+        print-severity no;
+        print-time yes;
+    };
+    category default  { logfile; };
+    category security { logfile; default_syslog; };
+    category panic    { logfile; default_syslog; };
+    category packet   { null; };
+    category eventlib { null; };
+};
+
+options {
+    directory            "@l_prefix@/etc/bind/named.db";
+    check-names          master warn;
+    host-statistics      no;
+    allow-query          { any; };
+    allow-transfer       { any; };
+    transfers-in         10;
+    transfers-per-ns     2;
+    max-transfer-time-in 120;
+    transfer-format      one-answer;
+    cleaning-interval    60;
+    interface-interval   60;
+    statistics-interval  59;
+    #listen-on           port 53 { 127.0.0.1; };
+    #query-source        address 127.0.0.1 port *;
+    #transfer-source     127.0.0.1;
+};
+
+zone "." IN {
+    type hint;
+    file "db.root";
+};
+
+zone "localhost" IN {
+    type           master;
+    file           "db.localhost";
+    notify         no;
+    check-names    fail;
+    allow-update   { none; };
+    allow-transfer { any;  };
+};
+
+zone "0.0.127.in-addr.arpa" IN {
+    type           master;
+    file           "db.127.0.0";
+    notify         no;
+    check-names    fail;
+    allow-update   { none; };
+    allow-transfer { any;  };
+};
+

+ 40 - 0
bind8/rc.bind

@@ -0,0 +1,40 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.bind -- Run-Commands for BIND Daemon
+##
+
+%config
+    bind_enable="yes"
+    bind_log_numfiles="5"
+    bind_log_minsize="512K"
+    bind_log_complevel="9"
+
+%start -p 200 -u root
+    if opServiceEnabled bind; then
+        @l_prefix@/sbin/ndc start
+    fi
+
+%stop -p 200 -u root
+    if opServiceEnabled bind; then
+        @l_prefix@/sbin/ndc stop
+    fi
+
+%restart -u root
+    if opServiceEnabled bind; then
+        @l_prefix@/sbin/ndc restart
+    fi
+
+%reload -u root
+    if opServiceEnabled bind; then
+        @l_prefix@/sbin/ndc reload
+    fi
+
+%daily -u root
+    if opServiceEnabled bind; then
+        shtool rotate -f \
+            -n${bind_log_numfiles} -s${bind_log_minsize} \
+            -d -z${bind_log_complevel} -o@l_fsusr@ -o@l_fsgrp@ -m644 \
+            -E '@l_prefix@/sbin/ndc restart' \
+            @l_prefix@/var/bind/named.log 
+    fi
+