From 17c32ff7c315038d9b0118f6c314c397196a9050 Mon Sep 17 00:00:00 2001
From: Dinko Korunic <Dinko.Korunic@CARNet.hr>
Date: Sat, 8 Sep 2007 21:30:52 +0000
Subject: [PATCH 1/1] r1: [svn-inject] Installing original source of bind9-cn

---
 README.CARNet      |   12 ++++
 README.examples    |   42 +++++++++++++
 changelog.CARNet   |   15 +++++
 debian/changelog   |   15 +++++
 debian/compat      |    1 +
 debian/control     |   18 ++++++
 debian/docs        |    2 +
 debian/examples    |    7 +++
 debian/postinst    |  171 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 debian/postrm      |   43 +++++++++++++
 debian/rules       |   73 ++++++++++++++++++++++
 hosts              |    1 +
 hosts.db           |    1 +
 hosts.rev          |    1 +
 named.conf.local   |    1 +
 named.conf.options |    1 +
 resolv.conf        |    1 +
 17 files changed, 405 insertions(+)
 create mode 100644 README.CARNet
 create mode 100644 README.examples
 create mode 100644 changelog.CARNet
 create mode 100644 debian/changelog
 create mode 100644 debian/compat
 create mode 100644 debian/control
 create mode 100644 debian/docs
 create mode 100644 debian/examples
 create mode 100755 debian/postinst
 create mode 100755 debian/postrm
 create mode 100755 debian/rules
 create mode 100644 hosts
 create mode 100644 hosts.db
 create mode 100644 hosts.rev
 create mode 100644 named.conf.local
 create mode 100644 named.conf.options
 create mode 100644 resolv.conf

diff --git a/README.CARNet b/README.CARNet
new file mode 100644
index 0000000..05f48ec
--- /dev/null
+++ b/README.CARNet
@@ -0,0 +1,12 @@
+bind9-cn
+~~~~~~~~
+
+Ovaj paket sluzi pojednostavljenju instalacije Bind9 paketa koji postoji u
+Debian distribuciji.
+
+Sam paket nazalost ne stvara sve konfiguracijske datoteke iz jednostavnog
+razloga jer je to neprakticno i uglavnom nemoguce, vec se sistemci upucuju
+na iscitavanje primjera izgeneriranih konfiguracijskih datoteka koji se
+nalaze u examples/ direktoriju.
+
+ -- Dinko Korunic <kreator@carnet.hr>  Sat,  8 Sep 2007 17:28:46 +0200
diff --git a/README.examples b/README.examples
new file mode 100644
index 0000000..b8000ac
--- /dev/null
+++ b/README.examples
@@ -0,0 +1,42 @@
+bind9-examples
+~~~~~~~~~~~~~~
+
+Slijedi popis datoteka koje se generiraju kao primjer konfiguracije
+Bind9 posluzitelja i njihova znacenja:
+
+- hosts:
+  Datoteka koja se obicno nalazi u /etc/hosts. Njena namjena je opisivanje
+  i popisivanje simbolicnih imena racunala i njihovih IP adresa tako da bi
+  ona bila prepoznata cak i u slucaju pada DNS servisa. Jasno, uvijek je
+  preporucljivo da se u toj datoteci nalazi `localhost' kao i sama adresa
+  racunala na kojem se inace Bind9 softver nalazi.
+
+- hosts.db:
+  Datoteka inace prizvoljnog imena, ali po konvenciji obicno se uvijek
+  koristi. Njena svrha je rezolucija labela->IP_adresa, pri cemu se moraju
+  popisati sva standardna DNS polja (MX, NS, SOA, itd.). Ukratko, rijec je
+  o `forward DNS zoni'. Ona se obicno nalazi u /etc/bind/hosts.db.
+
+- hosts.rev:
+  Datoteka inace prizvoljnog imena, ali po konvenciji obicno se uvijek
+  koristi. Njena svrha je rezolucija IP_adresa->labela, pri cemu se moraju
+  popisati sva standardna DNS polja (MX, NS, SOA, itd.). Ukratko, rijec je
+  o `reverse DNS zoni'. Ona se obicno nalazi u /etc/bind/hosts.rev.
+
+- named.conf.local:
+  Datoteka koja popisuje lokalne dodatke konfiguraciji Bind9 posluzitelja.
+  Ona ce sadrzavati popis zona i datoteka u kojima se nalaze, ali i moguce
+  dodatne opcije za sam softver. Ona se obicno nalazi u
+  /etc/bind/named.conf.local.
+
+- named.conf.options:
+  Datoteka koja definira osnovne parametre rada Bind9 posluzitelja.
+
+- resolv.conf:
+  Datoteka koja sluzi za ispravno konfiguriranje lokalnog resolvera.
+  Odnosno, njena zadaca je popisati sve aktivne DNS posluzitelje koji su
+  zaduzeni za to racunalo (a ako je ono samo server, onda je i samo
+  zaduzeno za sebe - pa to unosimo sa 127.0.0.1 adresom), kao i lokalnu
+  domenu u kojem se racunalo nalazi.
+
+ -- Dinko Korunic <kreator@carnet.hr>  Sat,  8 Sep 2007 18:06:23 +0200
diff --git a/changelog.CARNet b/changelog.CARNet
new file mode 100644
index 0000000..2e03739
--- /dev/null
+++ b/changelog.CARNet
@@ -0,0 +1,15 @@
+bind9-cn (2:9.2.4-1) sarge; urgency=low
+
+  * dependancy o Bind9 9.2.4-1sarge1
+  * bolja detekcija konfiguracije, ignoriranje lame DNS-ova
+
+ -- Dinko Korunic <kreator@carnet.hr>  Sat,  8 Sep 2007 17:40:33 +0200
+
+bind9-cn (2:9.2.3-2) sarge; urgency=low
+
+  * novo izdanje, dummy paket koji dependa o odgovarajucim paketima iz Debian
+    distribucije i donosi nekoliko primjera za zone i konfiguraciju
+  * dokumentirane datoteke u examples/
+
+ -- Dinko Korunic <kreator@carnet.hr>  Mon, 31 May 2004 11:04:19 +0200
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..2e03739
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,15 @@
+bind9-cn (2:9.2.4-1) sarge; urgency=low
+
+  * dependancy o Bind9 9.2.4-1sarge1
+  * bolja detekcija konfiguracije, ignoriranje lame DNS-ova
+
+ -- Dinko Korunic <kreator@carnet.hr>  Sat,  8 Sep 2007 17:40:33 +0200
+
+bind9-cn (2:9.2.3-2) sarge; urgency=low
+
+  * novo izdanje, dummy paket koji dependa o odgovarajucim paketima iz Debian
+    distribucije i donosi nekoliko primjera za zone i konfiguraciju
+  * dokumentirane datoteke u examples/
+
+ -- Dinko Korunic <kreator@carnet.hr>  Mon, 31 May 2004 11:04:19 +0200
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..477110e
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,18 @@
+Source: bind9-cn
+Section: net
+Priority: optional
+Maintainer: Dinko Korunic <kreator@carnet.hr>
+Build-Depends: debhelper (>= 4)
+Standards-Version: 3.7.2
+
+Package: bind9-cn
+Architecture: any
+Depends: bind9 (>= 9.2.4-1sarge1), carnet-tools-cn (>= 2.1.8)
+Recommends: bind9-doc (>= 9.2.4-1sarge1), host | bind9-host (>= 9.2.4-1sarge1), dnsutils, dnswalk
+Description: Internet Domain Name Server
+ The Berkeley Internet Name Domain (BIND) implements an Internet domain
+ name server. BIND is the most widely-used name server software on the
+ Internet, and is supported by the Internet Software Consortium, www.isc.org.
+ .
+ This is a basic CARNet Debian customization package.
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..ef5ce6c
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+changelog.CARNet
+README.CARNet
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..9f297f7
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1,7 @@
+README.examples
+hosts
+hosts.db
+hosts.rev
+named.conf.local
+resolv.conf
+named.conf.options
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..567dedf
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,171 @@
+#!/bin/sh
+# postinst script for bind9-cn
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+
+case "$1" in
+    configure|reconfigure)
+      # continue below
+    ;;
+
+    *)
+        exit 0
+    ;;
+esac
+
+# import CN-functions
+. /usr/share/carnet-tools/functions.sh
+
+echo "CN: Making sample configurations in /usr/share/doc/bind9-cn/examples"
+echo "CN: Make sure you read them and apply *before* running Bind9 service!"
+
+#variables
+cp_get_ifaddr
+CARNET_IPADDR=$RET
+cp_get_netaddr
+CARNET_NETADDR=$RET
+CARNET_HOSTNAME=`hostname`
+CARNET_DOMAINNAME=`hostname --domain`
+CARNET_REV=`echo $CARNET_IPADDR | awk -F. '{ print $3 "." $2 "." $1 ".in-addr.arpa" }'`
+SERNO=`date +%Y%m%d01`
+BROJ=`echo $CARNET_IPADDR | cut -d. -f4`
+
+# make example named.conf.local
+cat > /usr/share/doc/bind9-cn/examples/named.conf.local <<EOF
+zone "$CARNET_DOMAINNAME" in {
+    type master;
+    file "/etc/bind/hosts.db";
+};
+
+zone "$CARNET_REV" in {
+    type master;
+    file "/etc/bind/hosts.rev";
+};
+EOF
+
+# make example named.conf.options
+cat > /usr/share/doc/bind9-cn/examples/named.conf.options <<EOF
+acl "xfer" {
+    161.53.2.70;
+    161.53.123.3;
+    161.53.3.7;
+    127.0.0.1;
+};
+
+acl "trusted" {
+    $CARNET_NETADDR;
+    127.0.0.0/8;
+};
+
+options {
+    directory "/etc/bind";
+    query-source address * port 53;
+    auth-nxdomain no;
+    allow-transfer { xfer; };
+    allow-recursion { trusted; };
+    version "No version.";
+    transfer-format many-answers;
+    max-transfer-time-in 90;
+    interface-interval 0;
+    notify yes;
+    listen-on-v6 { none; };
+};
+
+logging {
+    category lame-servers { null; };
+};
+EOF
+
+# make example hosts.db
+cat > /usr/share/doc/bind9-cn/examples/hosts.db <<EOF
+\$TTL 86400
+@  SOA  $CARNET_HOSTNAME.$CARNET_DOMAINNAME. hostmaster.$CARNET_HOSTNAME.$CARNET_DOMAINNAME. (
+    $SERNO   ; Serial
+    28800    ; Refresh
+    7200     ; Retry
+    604800   ; Expire
+    86400 )  ; Minimum
+    NS  $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+    NS  bjesomar.srce.hr.
+    A   $CARNET_IPADDR
+    MX  5   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+
+localhost.$CARNET_DOMAINNAME.   A       127.0.0.1
+$CARNET_HOSTNAME.$CARNET_DOMAINNAME.      A     $CARNET_IPADDR
+
+dns         CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+ns          CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+www         CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+proxy       CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+mail        CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+smtp        CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+pop         CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+imap        CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+ftp         CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+ntp         CNAME   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+EOF
+
+# make example hosts.rev
+cat > /usr/share/doc/bind9-cn/examples/hosts.rev <<EOF
+\$TTL 86400
+@  SOA  $CARNET_HOSTNAME.$CARNET_DOMAINNAME. hostmaster.$CARNET_HOSTNAME.$CARNET_DOMAINNAME. (
+    $SERNO       ; Serial
+    28800   ; Refresh
+    7200    ; Retry
+    604800  ; Expire
+    86400 ) ; Minimum
+    NS  $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+    NS  bjesomar.srce.hr.
+
+1   PTR localhost.$CARNET_DOMAINNAME.
+$BROJ   PTR   $CARNET_HOSTNAME.$CARNET_DOMAINNAME.
+EOF
+
+# make example hosts
+cat > /usr/share/doc/bind9-cn/examples/hosts <<EOF
+# /etc/hosts - names & shortcuts to various hosts
+127.0.0.1       localhost.$CARNET_DOMAINNAME localhost
+$CARNET_IPADDR      $CARNET_HOSTNAME.$CARNET_DOMAINNAME $CARNET_HOSTNAME
+EOF
+
+# make example resolv.conf
+cat > /usr/share/doc/bind9-cn/examples/resolv.conf <<EOF
+search $CARNET_DOMAINNAME
+nameserver 127.0.0.1
+nameserver 161.53.2.70
+EOF
+
+# check if named.conf has lame server logging
+if [ -e /etc/bind/named.conf.options ]; then
+  lameconf=$(awk '/^logging/,/^}/ { if ($0 ~ /category lame-servers/) { print "yes"; exit } }' /etc/bind/named.conf)
+  if [ "x$lameconf" != "xyes" ]; then
+    cp /etc/bind/named.conf.options /etc/bind/named.conf.options.$$
+    cp-update bind9-cn /etc/bind/named.conf.options.$$ <<EOF
+logging {
+    category lame-servers { null; };
+};
+EOF
+    cp_mv /etc/bind/named.conf.options.$$ /etc/bind/named.conf.options
+  fi
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/postrm b/debian/postrm
new file mode 100755
index 0000000..09d278f
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,43 @@
+#!/bin/sh
+# postrm script for bind9-cn
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+    purge)
+      # continue below
+    ;;
+
+    *)
+        exit 0
+    ;;
+esac
+
+# import CN-functions
+. /usr/share/carnet-tools/functions.sh
+
+# remove our block
+if [ -e /etc/bind/named.conf.options ]; then
+  cp-update -r bind9-cn /etc/bind/named.conf.options
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3206f91
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,73 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper. 
+# This file is public domain software, originally written by Joey Hess.
+#
+# This version is for packages that are architecture independent.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+
+	# Add here commands to compile the package.
+	#$(MAKE)
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	# Add here commands to clean up after the build process.
+	#-$(MAKE) clean
+	#-$(MAKE) distclean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/<packagename>.
+	#$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installdebconf
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installcatalogs
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+#	dh_undocumented
+	dh_installman
+	dh_link
+	dh_compress
+	dh_fixperms
+#	dh_perl
+#	dh_python
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+# We have nothing to do by default.
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/hosts b/hosts
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/hosts
@@ -0,0 +1 @@
+
diff --git a/hosts.db b/hosts.db
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/hosts.db
@@ -0,0 +1 @@
+
diff --git a/hosts.rev b/hosts.rev
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/hosts.rev
@@ -0,0 +1 @@
+
diff --git a/named.conf.local b/named.conf.local
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/named.conf.local
@@ -0,0 +1 @@
+
diff --git a/named.conf.options b/named.conf.options
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/named.conf.options
@@ -0,0 +1 @@
+
diff --git a/resolv.conf b/resolv.conf
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/resolv.conf
@@ -0,0 +1 @@
+
-- 
1.7.10.4