summaryrefslogtreecommitdiffstats
path: root/bind.spec
diff options
context:
space:
mode:
authorjvdias <jvdias@fedoraproject.org>2005-02-18 20:37:46 +0000
committerjvdias <jvdias@fedoraproject.org>2005-02-18 20:37:46 +0000
commitd940d2e5297075c581d851321bb417724f95cb88 (patch)
tree8234ddd6e2fa946758f9cfcddd38b305b5b4b417 /bind.spec
parent8c611b411df7f9e555a623cd8522a2bcbc12ebe6 (diff)
downloadbind-d940d2e5297075c581d851321bb417724f95cb88.tar.gz
bind-d940d2e5297075c581d851321bb417724f95cb88.tar.xz
bind-d940d2e5297075c581d851321bb417724f95cb88.zip
Upgrade to 9.3.1rc1. Add SDB & libbbind sub-packages. Add "--define 'test
1'" mode. fix bugs 147824 / 147073 / 145664 / 146084.
Diffstat (limited to 'bind.spec')
-rw-r--r--bind.spec454
1 files changed, 268 insertions, 186 deletions
diff --git a/bind.spec b/bind.spec
index 8cd2da4..9eec1c9 100644
--- a/bind.spec
+++ b/bind.spec
@@ -1,6 +1,9 @@
%define posix_threads 0
-%define SDB 1
-Summary: A DNS (Domain Name System) server.
+%{?!SDB: %define SDB 1}
+%{?!efence: %define efence 0}
+%{?!test: %define test 0}
+# Usage: export RPM='/usr/bin/rpmbuild --define "test 1"'; make $arch;
+Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server.
Name: bind
License: BSD-like
Version: 9.3.1rc1
@@ -34,13 +37,13 @@ Patch9: bind-9.3.0-missing-dnssec-tools.patch
Patch10: bind-9.3.1rc1-no-libtool-for-PIEs.patch
Patch11: bind-9.3.1rc1-sdbsrc.patch
Patch12: bind-9.3.1rc1-sdb.patch
+Patch13: bind-9.3.1rc1-fix_libbind_includedir.patch
Requires(pre,preun): shadow-utils
Requires(post,preun): chkconfig
Requires(post): textutils, fileutils, sed, grep
-Requires: bind-utils /bin/usleep
+Requires: bind-libs = %{epoch}:%{version}-%{release}, bind-utils = %{epoch}:%{version}-%{release}, glibc >= 2.2, /bin/usleep
#Requires: kernel >= 2.4
#Requires: glibc >= 2.3.2-5
-Requires: glibc >= 2.2
%if %{SDB}
BuildRequires: openssl-devel gcc glibc-devel >= 2.2.5-26 glibc-kernheaders >= 2.4-7.10 libtool pkgconfig tar openldap-devel postgresql-devel
%else
@@ -78,13 +81,23 @@ servers.
%package devel
Summary: Include files and libraries needed for bind DNS development.
Group: Development/Libraries
-Requires: bind = %{epoch}:%{version}-%{release}
+Requires: bind-libs = %{epoch}:%{version}-%{release}
%description devel
The bind-devel package contains all the include files and the library
required for DNS (Domain Name System) development for BIND versions
9.x.x.
+%package libbind-devel
+Summary: Include files and library needed to use the BIND resolver library.
+Group: Development/Libraries
+Requires: bind-libs = %{epoch}:%{version}-%{release}
+
+%description libbind-devel
+The bind-libbind-devel package contains the libbind BIND resolver library,
+compatible with that from ISC BIND 8, and the /usr/include/bind include files
+necessary to develop software that uses it.
+
%package chroot
Summary: A chrooted tree for the BIND nameserver
Group: System Environment/Daemons
@@ -94,139 +107,27 @@ Requires: bind = %{epoch}:%{version}-%{release}
%description chroot
This package contains a tree of files which can be used as a
chroot(2) jail for the named(8) program from the BIND package.
+Based off code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
-based off code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
-
-%files chroot
-%defattr(-,root,root)
-%attr(770,root,named) %dir %prefix
-%attr(770,root,named) %dir %prefix/dev
-%attr(770,root,named) %dir %prefix/etc
-%attr(770,root,named) %dir %prefix/var
-%attr(770,root,named) %dir %prefix/var/run
-%attr(770,named,named) %dir %prefix/var/tmp
-%attr(770,named,named) %dir %prefix/var/run/named
-%attr(750,root,named) %dir %prefix/var/named
-%attr(770,named,named) %dir %prefix/var/named/slaves
-%attr(770,named,named) %dir %prefix/var/named/data
-%ghost %prefix/etc/named.conf
-%ghost %prefix/etc/rndc.key
-%ghost %prefix/dev/null
-%ghost %prefix/dev/random
-
-%post chroot
-safe_replace()
-{
- f1=$1;
- f2=$2;
- o=$3;
- g=$4;
- m=$5;
- dc=$6;
- if /usr/bin/test "x" = "x$f1" -o "x" = "x$f2" -o "$f1" = "$f2"; then
- return 1;
- fi;
- if /usr/bin/test -r $f1 -a -s $f1 -a '!' -L $f1; then
- if /usr/bin/test -r $f2 -a -s $f2 -a '!' -L $f2; then
- /bin/mv $f1 $f1'.rpmsave' >/dev/null 2>&1 || :;
- /bin/mv $f2 $f1 > /dev/null 2>&1 || :;
- else
- /bin/rm -f $f2 > /dev/null 2>&1 || :;
- fi;
- /bin/mv $f1 $f2 > /dev/null 2>&1 || :;
- /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
- else
- /bin/rm -f $f1 > /dev/null 2>&1 || :;
- if /usr/bin/test -r $f2 -a -s $f2; then
- /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
- else
- if /usr/bin/test "x$dc" != "x"; then
- echo $dc > $f2;
- /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
- else
- return 2;
- fi;
- fi;
- fi;
- chown $o':'$g $f2;
- chmod $m $f2;
- return 0;
-}
-if /usr/bin/test -r /etc/sysconfig/named && /bin/egrep -q '^ROOTDIR=' /etc/sysconfig/named; then
- :;
-else
- echo ROOTDIR="%{prefix}" >>/etc/sysconfig/named;
-fi
-if /usr/bin/test -r /etc/localtime; then
- /bin/cp -fp /etc/localtime "%{prefix}/etc/localtime"
-fi
-safe_replace /etc/rndc.key "%{prefix}/etc/rndc.key" root named 644 '';
-r=$?;
-if /usr/bin/test "$r" -eq 2; then
- /bin/rm -f /etc/rndc.key
- echo -e 'key "rndckey" {\nalgorithm hmac-md5;\nsecret "'`/usr/sbin/dns-keygen`'"\n};' > /etc/rndc.key;
- safe_replace /etc/rndc.key "%{prefix}/etc/rndc.key" root named 644 '';
-fi;
-default_ndc='include "/etc/rndc.key";'
-if [ -f /etc/named.custom ]; then
- default_ndc='include "/etc/rndc.key";\ninclude "/etc/named.custom";'
- safe_replace /etc/named.custom "%{prefix}/etc/named.custom" root named 644 '' || :;
-fi
-safe_replace /etc/named.conf "%{prefix}/etc/named.conf" root named 644 "$default_ndc"
-/usr/bin/find /var/named -type f | /bin/egrep -v /var/named/chroot | while read f;
-do
- d=`/usr/bin/dirname $f`;
- if test '!' -d "%{prefix}$d"; then
- mkdir -p "%{prefix}$d";
- chown named:named "%{prefix}$d";
- chmod 655 "%{prefix}$d";
- fi;
- safe_replace $f "%{prefix}$f" named named 644 '' || :;
-done
-[ ! -e "%{prefix}/dev/random" ] && mknod "%{prefix}/dev/random" c 1 8
-[ ! -e "%{prefix}/dev/zero" ] && mknod "%{prefix}/dev/zero" c 1 5
-[ ! -e "%{prefix}/dev/null" ] && mknod "%{prefix}/dev/null" c 1 3
-chmod a+r "%{prefix}/dev/random" "%{prefix}/dev/null" "%{prefix}/dev/"
-chown root:named "%{prefix}/var/named"
-chown named:named "%{prefix}/var/named/slaves"
-chown named:named "%{prefix}/var/named/data"
-if /etc/init.d/named condrestart; then
- :;
-fi
-[ -d /selinux ] && [ -x /sbin/restorecon ] && /sbin/restorecon -R %{prefix} >/dev/null 2>&1
+%if %{SDB}
+%package bind-sdb
+Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server with database backends.
+Group: System Environment/Daemons
+Requires: bind-libs = %{epoch}:%{version}-%{release}, bind-utils = %{epoch}:%{version}-%{release}, glibc >= 2.2, /bin/usleep
-%preun chroot
-if [ "$1" = "0" ]; then
- /usr/bin/find /var/named/chroot -type f | while read f;
- do
- F=`echo $f | sed 's#/var/named/chroot##'`;
- if /usr/bin/test -L $F && test `/usr/bin/readlink $F` = $f; then
- /bin/rm -f $F;
- /bin/mv $f $F;
- fi;
- done
- if test -r /etc/sysconfig/named && grep -q '^ROOTDIR=' /etc/sysconfig/named; then
- named_tmp=`/bin/mktemp /tmp/XXXXXX`
- grep -v '^ROOTDIR='%{prefix} /etc/sysconfig/named > $named_tmp
- mv -f $named_tmp /etc/sysconfig/named
- fi
- if /etc/init.d/named condrestart; then
- :;
- fi
-fi
+%description bind-sdb
+BIND (Berkeley Internet Name Domain) is an implementation of the DNS
+(Domain Name System) protocols. BIND includes a DNS server (named),
+which resolves host names to IP addresses; a resolver library
+(routines for applications to use when interfacing with DNS); and
+tools for verifying that the DNS server is operating properly.
-%triggerpostun -n bind-chroot -- bind-chroot
-# Fix mess left by bind-chroot-9.2.2's %preun (bug 131803)
-if [ "$1" -gt 0 ]; then
- if test -r /etc/sysconfig/named && grep -q '^ROOTDIR=' /etc/sysconfig/named; then
- :;
- else
- echo 'ROOTDIR='%{prefix} >> /etc/sysconfig/named
- if /etc/init.d/named condrestart; then
- :;
- fi;
- fi;
-fi;
+BIND SDB (Simplified Database Backends) provides named_sdb, the DNS
+name server compiled to include support for using alternative Zone Databases
+stored in an LDAP server (ldapdb), a postgreSQL database (pgsqldb), or in the
+filesystem (dirdb), in addition to the standard in-memory RBT (Red Black Tree)
+zone database.
+%endif
%prep
%setup -q -n %{name}-%{version}
@@ -264,6 +165,7 @@ cp -fp %{SOURCE7} bin/sdb_tools/Makefile.in
cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/sdb_tools
cp -fp contrib/sdb/pgsql/zonetodb.c bin/sdb_tools
%patch12 -p1 -b .sdb
+%patch13 -p1 -b .fix_libbind_includedir
%endif
%build
@@ -276,10 +178,14 @@ if pkg-config openssl ; then
export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
fi
#export CFLAGS="-g $CFLAGS"
+%if %{efence}
+export LDFLAGS=-lefence
+%endif
%configure --with-libtool --localstatedir=/var \
--enable-threads \
--enable-ipv6 \
--enable-libbind \
+ --enable-getifaddrs=glibc \
--with-openssl=/usr
make
cp %{SOURCE5} doc/rfc
@@ -319,11 +225,33 @@ __EOF
gcc $RPM_OPT_FLAGS -o $RPM_BUILD_ROOT/usr/sbin/dns-keygen %{SOURCE4}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/named
+#mv $RPM_BUILD_ROOT/usr/share/man/man8/named.conf.* $RPM_BUILD_ROOT/usr/share/man/man5
%if %{SDB}
mkdir -p $RPM_BUILD_ROOT/etc/openldap/schema
install -c -m 644 %{SOURCE8} $RPM_BUILD_ROOT/etc/openldap/schema/dnszone.schema
%endif
-#mv $RPM_BUILD_ROOT/usr/share/man/man8/named.conf.* $RPM_BUILD_ROOT/usr/share/man/man5
+%if %{test}
+if [ "`whoami`" = 'root' ]; then
+ set -e
+ chmod -R a+rwX .
+ pushd bin/tests
+ pushd system
+ ./ifconfig.sh up
+ popd
+ make test
+ e=$?
+ pushd system
+ ./ifconfig.sh down
+ popd
+ popd
+ if [ "$e" -ne 0 ]; then
+ echo "ERROR: this build of BIND failed 'make test'. Aborting."
+ exit $e;
+ fi;
+else
+ echo 'test==1 : only root can run the tests (they require an ifconfig).';
+fi
+%endif
%pre
/usr/sbin/groupadd -g 25 named >/dev/null 2>&1 || :;
@@ -346,36 +274,10 @@ if [ $1 = 1 ]; then
if [ ! -s /etc/named.conf ]; then
echo -e '// Default named.conf generated by install of bind-'%{version}'-'%{release}'\noptions {\n\tdirectory "/var/named";\n\tdump-file "/var/named/data/cache_dump.db";\n\tstatistics-file "/var/named/data/named_stats.txt";\n};\ninclude "/etc/rndc.key";\n' > /etc/named.conf;
fi;
- if [ -x /sbin/restorecon ]; then
- #
- # Restore selinux file_context
- #
- /sbin/restorecon /etc/rndc.key /etc/rndc.conf /etc/named.conf
- fi
+ [ -d /selinux ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/rndc.key /etc/rndc.conf /etc/named.conf >/dev/null 2>&1
chmod 0640 /etc/rndc.conf /etc/rndc.key
chown root:named /etc/rndc.conf /etc/rndc.key /etc/named.conf
/sbin/ldconfig
-elif [ "$1" -gt 0 ]; then
- # check that dnszone.schema is installed in OpenLDAP's slapd.conf
- if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
- # include the LDAP dnszone.schema in slapd.conf:
- if ! /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
- tf=`/bin/mktemp /tmp/XXXXXX`
- let n=`/bin/grep -n '^include.*\.schema' /etc/openldap/slapd.conf | /usr/bin/tail -1 | /bin/sed 's/:.*//'`
- if [ "$n" -gt 0 ]; then
- /bin/cp -fp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.rpmsave;
- /usr/bin/head -$n /etc/openldap/slapd.conf > $tf
- echo 'include /etc/openldap/schema/dnszone.schema' >> $tf
- let n='n+1'
- /usr/bin/tail +$n /etc/openldap/slapd.conf >> $tf
- /bin/mv -f $tf /etc/openldap/slapd.conf;
- /bin/chmod --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
- [ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf
- [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
- fi
- rm -f $tf >/dev/null 2>&1;
- fi;
- fi
fi
exit 0
@@ -385,16 +287,6 @@ if [ $1 = 0 ]; then
/usr/sbin/groupdel named 2>/dev/null || :
/sbin/chkconfig --del named
[ -f /var/lock/subsys/named ] && /etc/rc.d/init.d/named stop >/dev/null 2>&1
- if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
- if /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
- tf=`/bin/mktemp /tmp/XXXXXX`
- /bin/egrep -v '^include.*dnszone\.schema' /etc/openldap/slapd.conf > $tf
- /bin/mv -f $tf /etc/openldap/slapd.conf;
- rm -f $tf >/dev/null 2>&1
- [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
- fi;
- fi;
-fi
fi
exit 0
@@ -409,7 +301,7 @@ fi
/sbin/ldconfig
%clean
-rm -rf ${RPM_BUILD_ROOT}
+ rm -rf ${RPM_BUILD_ROOT}
# ${RPM_BUILD_DIR}/%{name}-%{version}
%post libs -p /sbin/ldconfig
@@ -425,6 +317,7 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) /etc/sysconfig/named
%verify(not size,not md5) %config(noreplace) %attr(0640,root,named) /etc/rndc.conf
%verify(not size,not md5) %config(noreplace) %attr(0640,root,named) /etc/rndc.key
+
%{_sbindir}/dnssec*
%{_sbindir}/lwresd
%{_sbindir}/named
@@ -432,13 +325,6 @@ rm -rf ${RPM_BUILD_ROOT}
%{_sbindir}/named-check*
%{_sbindir}/rndc*
%{_sbindir}/dns-keygen
-%if %{SDB}
-%config /etc/openldap/schema/dnszone.schema
-%{_sbindir}/named_sdb
-%{_sbindir}/zone2ldap
-%{_sbindir}/zonetodb
-%doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap
-%endif
%{_mandir}/man5/named.conf.5*
%{_mandir}/man5/rndc.conf.5*
@@ -449,9 +335,6 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/named-checkconf.8*
%{_mandir}/man8/named-checkzone.8*
%{_mandir}/man8/rndc-confgen.8*
-%if %{SDB}
-%{_mandir}/man1/zone2ldap.1*
-%endif
%attr(750,root,named) %dir /var/named
%attr(770,named,named) %dir /var/named/slaves
@@ -476,12 +359,211 @@ rm -rf ${RPM_BUILD_ROOT}
%files devel
%defattr(-,root,root)
-%{_libdir}/*.a
-%{_includedir}/*
+%{_libdir}/libbind9.a
+%{_libdir}/libdns.a
+%{_libdir}/libisc.a
+%{_libdir}/libisccc.a
+%{_libdir}/libisccfg.a
+%{_libdir}/liblwres.a
+%{_includedir}/bind9
+%{_includedir}/dns
+%{_includedir}/dst
+%{_includedir}/isc
+%{_includedir}/isccc
+%{_includedir}/isccfg
+%{_includedir}/lwres
%{_mandir}/man3/*
%{_bindir}/isc-config.sh
%doc doc/draft doc/rfc
+%files libbind-devel
+%defattr(-,root,root)
+%{_libdir}/libbind.*
+%{_includedir}/bind
+
+%post libbind-devel -p /sbin/ldconfig
+
+%postun libbind-devel -p /sbin/ldconfig
+
+%files chroot
+%defattr(-,root,root)
+%attr(770,root,named) %dir %prefix
+%attr(770,root,named) %dir %prefix/dev
+%attr(770,root,named) %dir %prefix/etc
+%attr(770,root,named) %dir %prefix/var
+%attr(770,root,named) %dir %prefix/var/run
+%attr(770,named,named) %dir %prefix/var/tmp
+%attr(770,named,named) %dir %prefix/var/run/named
+%attr(750,root,named) %dir %prefix/var/named
+%attr(770,named,named) %dir %prefix/var/named/slaves
+%attr(770,named,named) %dir %prefix/var/named/data
+%ghost %prefix/etc/named.conf
+%ghost %prefix/etc/rndc.key
+%ghost %prefix/dev/null
+%ghost %prefix/dev/random
+
+%if %{SDB}
+
+%files bind-sdb
+%{_sbindir}/named_sdb
+%config /etc/openldap/schema/dnszone.schema
+%{_sbindir}/zone2ldap
+%{_sbindir}/zonetodb
+%{_mandir}/man1/zone2ldap.1*
+%doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap
+
+%post bind-sdb
+if [ "$1" -eq 1 ]; then
+ # check that dnszone.schema is installed in OpenLDAP's slapd.conf
+ if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
+ # include the LDAP dnszone.schema in slapd.conf:
+ if ! /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
+ tf=`/bin/mktemp /tmp/XXXXXX`
+ let n=`/bin/grep -n '^include.*\.schema' /etc/openldap/slapd.conf | /usr/bin/tail -1 | /bin/sed 's/:.*//'`
+ if [ "$n" -gt 0 ]; then
+ /bin/cp -fp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.rpmsave;
+ /usr/bin/head -$n /etc/openldap/slapd.conf > $tf
+ echo 'include /etc/openldap/schema/dnszone.schema' >> $tf
+ let n='n+1'
+ /usr/bin/tail +$n /etc/openldap/slapd.conf >> $tf
+ /bin/mv -f $tf /etc/openldap/slapd.conf;
+ /bin/chmod --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
+ [ -d /selinux ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1
+ [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
+ fi
+ rm -f $tf >/dev/null 2>&1;
+ fi;
+ fi;
+fi;
+
+%preun bind-sdb
+if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
+ if /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
+ tf=`/bin/mktemp /tmp/XXXXXX`
+ /bin/egrep -v '^include.*dnszone\.schema' /etc/openldap/slapd.conf > $tf
+ /bin/mv -f $tf /etc/openldap/slapd.conf;
+ rm -f $tf >/dev/null 2>&1
+ [ -d /selinux ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1
+ [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
+ fi;
+fi;
+
+%endif # SDB
+
+%post chroot
+safe_replace()
+{
+ f1=$1;
+ f2=$2;
+ o=$3;
+ g=$4;
+ m=$5;
+ dc=$6;
+ if /usr/bin/test "x" = "x$f1" -o "x" = "x$f2" -o "$f1" = "$f2"; then
+ return 1;
+ fi;
+ if /usr/bin/test -r $f1 -a -s $f1 -a '!' -L $f1; then
+ if /usr/bin/test -r $f2 -a -s $f2 -a '!' -L $f2; then
+ /bin/mv $f1 $f1'.rpmsave' >/dev/null 2>&1 || :;
+ /bin/mv $f2 $f1 > /dev/null 2>&1 || :;
+ else
+ /bin/rm -f $f2 > /dev/null 2>&1 || :;
+ fi;
+ /bin/mv $f1 $f2 > /dev/null 2>&1 || :;
+ /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
+ else
+ /bin/rm -f $f1 > /dev/null 2>&1 || :;
+ if /usr/bin/test -r $f2 -a -s $f2; then
+ /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
+ else
+ if /usr/bin/test "x$dc" != "x"; then
+ echo $dc > $f2;
+ /bin/ln -s $f2 $f1 > /dev/null 2>&1 || :;
+ else
+ return 2;
+ fi;
+ fi;
+ fi;
+ chown $o':'$g $f2;
+ chmod $m $f2;
+ return 0;
+}
+if /usr/bin/test -r /etc/sysconfig/named && /bin/egrep -q '^ROOTDIR=' /etc/sysconfig/named; then
+ :;
+else
+ echo ROOTDIR="%{prefix}" >>/etc/sysconfig/named;
+fi
+if /usr/bin/test -r /etc/localtime; then
+ /bin/cp -fp /etc/localtime "%{prefix}/etc/localtime"
+fi
+safe_replace /etc/rndc.key "%{prefix}/etc/rndc.key" root named 644 '';
+r=$?;
+if /usr/bin/test "$r" -eq 2; then
+ /bin/rm -f /etc/rndc.key
+ echo -e 'key "rndckey" {\nalgorithm hmac-md5;\nsecret "'`/usr/sbin/dns-keygen`'"\n};' > /etc/rndc.key;
+ safe_replace /etc/rndc.key "%{prefix}/etc/rndc.key" root named 644 '';
+fi;
+default_ndc='include "/etc/rndc.key";'
+if [ -f /etc/named.custom ]; then
+ default_ndc='include "/etc/rndc.key";\ninclude "/etc/named.custom";'
+ safe_replace /etc/named.custom "%{prefix}/etc/named.custom" root named 644 '' || :;
+fi
+safe_replace /etc/named.conf "%{prefix}/etc/named.conf" root named 644 "$default_ndc"
+/usr/bin/find /var/named -type f | /bin/egrep -v /var/named/chroot | while read f;
+do
+ d=`/usr/bin/dirname $f`;
+ if test '!' -d "%{prefix}$d"; then
+ mkdir -p "%{prefix}$d";
+ chown named:named "%{prefix}$d";
+ chmod 655 "%{prefix}$d";
+ fi;
+ safe_replace $f "%{prefix}$f" named named 644 '' || :;
+done
+[ ! -e "%{prefix}/dev/random" ] && mknod "%{prefix}/dev/random" c 1 8
+[ ! -e "%{prefix}/dev/zero" ] && mknod "%{prefix}/dev/zero" c 1 5
+[ ! -e "%{prefix}/dev/null" ] && mknod "%{prefix}/dev/null" c 1 3
+chmod a+r "%{prefix}/dev/random" "%{prefix}/dev/null" "%{prefix}/dev/"
+chown root:named "%{prefix}/var/named"
+chown named:named "%{prefix}/var/named/slaves"
+chown named:named "%{prefix}/var/named/data"
+if /etc/init.d/named condrestart; then
+ :;
+fi
+[ -d /selinux ] && [ -x /sbin/restorecon ] && /sbin/restorecon -R %{prefix} >/dev/null 2>&1
+
+%preun chroot
+if [ "$1" = "0" ]; then
+ /usr/bin/find /var/named/chroot -type f | while read f;
+ do
+ F=`echo $f | sed 's#/var/named/chroot##'`;
+ if /usr/bin/test -L $F && test `/usr/bin/readlink $F` = $f; then
+ /bin/rm -f $F;
+ /bin/mv $f $F;
+ fi;
+ done
+ if test -r /etc/sysconfig/named && grep -q '^ROOTDIR=' /etc/sysconfig/named; then
+ named_tmp=`/bin/mktemp /tmp/XXXXXX`
+ grep -v '^ROOTDIR='%{prefix} /etc/sysconfig/named > $named_tmp
+ mv -f $named_tmp /etc/sysconfig/named
+ fi
+ if /etc/init.d/named condrestart; then
+ :;
+ fi
+fi
+
+%triggerpostun -n bind-chroot -- bind-chroot
+# Fix mess left by bind-chroot-9.2.2's %preun (bug 131803)
+if [ "$1" -gt 0 ]; then
+ if test -r /etc/sysconfig/named && grep -q '^ROOTDIR=' /etc/sysconfig/named; then
+ :;
+ else
+ echo 'ROOTDIR='%{prefix} >> /etc/sysconfig/named
+ if /etc/init.d/named condrestart; then
+ :;
+ fi;
+ fi;
+fi;
+
%changelog
* Wed Feb 16 2005 Jason Vas Dias <jvdias@redhat.com> - 22:9.3.1rc1-1
- Upgrade to 9.3.1rc1