Summary: The configuration files for setting up a caching name server.
Summary(ja): キャッシュネームサーバ用の設定ファイル
Name: caching-nameserver
Version: 7.1
Release: 13%{_dist_release}
License: Public Domain
Group: System Environment/Daemons
Source0: ftp://ftp.internic.com/domain/named.root
Source2: named.local
Source3: named.conf
Source4: Copyright.caching-nameserver
Source5: localhost.zone
Requires: bind
Requires(post): bind textutils grep
BuildRoot: %{_tmppath}/caching-nameserver-root
BuildArch: noarch

Vendor: Project Vine
Distribution: Vine Linux

%description
The caching-nameserver package includes the configuration files which
will make BIND, the DNS name server, act as a simple caching nameserver.
Many users on dialup connections use this package along with BIND for
such a purpose.

%description -l ja
caching-nameserver パッケージは BIND (DNS ネームサーバ) をシンプルな
キャッシュサーバとして動作させるための設定ファイルを含んでいます。
ダイアルアップで接続している多くのユーザーは、上記のような目的でこの
パッケージを BIND と一緒に使用しています。

%prep
%setup -c -T

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/{etc,var/named}

install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/var/named/named.ca
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/named/named.local
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/var/named/localhost.zone
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/named.conf
install -m 644 %{SOURCE4} ./Copyright

%clean
rm -rf $RPM_BUILD_ROOT

%post
if ! grep ^nameserver /etc/resolv.conf >/dev/null 2>&1 ; then
    echo "nameserver 127.0.0.1" >> /etc/resolv.conf
fi 
if ! grep -q "^key" /etc/named.conf; then
  if [ -f /etc/rndc.conf ]; then
    KEY=`cat /etc/rndc.conf |grep secret |head -n1`
    if [ -n "$KEY" ]; then
cat >>/etc/named.conf <<EOF
key "key" {
	algorithm hmac-md5;
$KEY
};
EOF
    fi
  fi
fi

%files
%defattr(-,root,root)
%config(noreplace) /etc/named.conf
%defattr(-,named,named)
%config /var/named/named.ca
%config /var/named/named.local
%config /var/named/localhost.zone
%defattr(-,root,root)
%doc Copyright

%changelog
* Sun Dec  6 2015 IWAI, Masaharu <iwaim.sub@gmail.com> 7.1-13
- update named.root (Source0)
 - add {B,C}.ROOT-SERVERS.NET. IPv6 address.
 - update H.ROOT-SERVERS.NET. IP address.

* Fri Jan  4 2013 IWAI, Masaharu <iwai@alib.jp> 7.1-12
- update named.root (Source0): for changing the D.ROOTSERVERS.NET's IP Address.
- fix deprecated tag: PreReq -> Requires(post)

* Sun Apr 17 2011 IWAI, Masaharu <iwai@alib.jp> 7.1-11
- update named.root (Source0): add IPv6 address
- update description

* Sun Aug  2 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 7.1-10
- fix typo named.conf
- add Vendor/Distribution tag

* Sat Aug  1 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 7.1-9
- update Source3 (named.conf) to secure default setting
- new versioning policy

  * Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 7.1-4vl5
  - applied new versioning policy, spec in utf-8

* Mon Nov 26 2007 IWAI, Masaharu <iwai@alib.jp> 7.1-3vl8
- update named.root (Source0) for changing the L.ROOTSERVERS.NET's IP Address.

* Mon Jul 16 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp>  7.1-3vl7
- rebuild with new toolchains and environment.
- s/Copyright/License/
- add japanese description and summary.

* Sun Jul 18 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 7.1-3vl6
- rebuilt

* Fri Feb 13 2004 Kunio Murasawa <murasawa@fa2.so-net.ne.jp> 7.1-3vl5
- update named.root (zone serial # 2004012900) 

* Thu Nov 14 2002 Kunio Murasawa <murasawa@fa2.so-net.ne.jp> 7.1-3vl4
- update named.root (zone serial # 2002110501) from internic

* Thu Nov 14 2002 IWAI Masaharu <iwai@alib.jp> 7.1-3vl3
- update named.root (Source0) for changing the J.ROOTSERVERS.NET's IP Address.

* Wed Jun  6 2001 Jun Nishii <jun@vinelinux.org>
- 7.1-3vl2
- check the existence of rndc.conf in %post script

* Thu May 31 2001 Jun Nishii <jun@vinelinux.org>
- 7.1-3vl1
- build for VineSeed

* Tue Mar 13 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Remove extra ";" (#31382)

* Thu Mar  1 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Don't add key { } stuff if it's already there
  (e.g. update from beta to final)

* Tue Feb 20 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Add key { } stuff to named.conf so rndc works out of the box

* Mon Feb 12 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- change to noreplace configs in /etc #21651

* Tue Aug  8 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- docu owned by root now

* Mon Aug  7 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- add default TTL to shut up warning message
- add "localhost" zone

* Sun Aug  6 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- changing /var/named/* to root was silly - reverted

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jul  3 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- change ownerships back to root:root. normally nobody should
  need to change these files and they never have to be updated
  by the named server himself.

* Tue Jun 27 2000 Nalin Dahyabhai <nalin@redhat.com>
- rebuild in new environment

* Tue Apr 18 2000 Nalin Dahyabhai <nalin@redhat.com>
- change ownerships to named.named

* Thu Feb 03 2000 Cristian Gafton <gafton@redhat.com>
- if there are no nameserver lines in /etc/resolv.conf, add one
- add a Copyright file

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 2)

* Wed Jan 06 1999 Cristian Gafton <gafton@redhat.com>
- rebuilt for the 6.0

* Wed Aug 12 1998 Jeff Johnson <jbj@redhat.com>
- install bind-8.1.2 named.conf

* Mon May 04 1998 Donnie Barnes <djb@redhat.com>
- upgraded from 1.1 to 5.1 to make caching-nameserver version the same
  as the version of Red Hat that it runs on.  
- updated named.root

* Wed Oct 15 1997 Donnie Barnes <djb@redhat.com>
- updated named.root to latest
- updated copyright

* Tue Sep 23 1997 Erik Troan <ewt@redhat.com>
- made a noarch package