%bcond_without ssl # build without OpenSSL support
%bcond_without ipv6 # build without IPv6 support
%bcond_without ldap # build without LDAP support
+%bcond_without sql # build without SQL support
%bcond_without static_libs # build without static libraries
+%bcond_without tests # perform tests
%bcond_with hip # build with HIP RR support
#
Summary: BIND - DNS name server
Summary(uk.UTF-8): BIND - cервер системи доменних імен (DNS)
Summary(zh_CN.UTF-8): Internet 域名服务器
Name: bind
-Version: 9.4.0
-Release: 4
-Epoch: 6
+Version: 9.4.2
+Release: 1
+Epoch: 7
License: BSD-like
Group: Networking/Daemons
Source0: ftp://ftp.isc.org/isc/bind9/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: e85347f03f0d841b596422d5252a0869
+# Source0-md5: 57953d7264139b9506b9d66174125179
Source1: %{name}-conf.tar.gz
-# Source1-md5: 8ee77729f806fcd548fe0cceb34b4a06
+# Source1-md5: 14d2c6befe25e68c713a1deb552668cc
Source2: named.init
Source3: named.sysconfig
Source4: named.logrotate
# Source6-md5: 49fe799c6eca54ae227b22d57ebc1145
Source7: %{name}-hip.tar.gz
# Source7-md5: 62a8a67f51ff8db9fe815205416a1f62
+Source8: ftp://rs.internic.net/domain/named.root
+# Source8-md5: 8c212c0260d708f15f75d3adc71f0149
Patch0: %{name}-time.patch
Patch1: %{name}-autoconf.patch
Patch2: %{name}-includedir-libbind.patch
Patch4: %{name}-pmake.patch
Patch5: %{name}-sdb-ldap.patch
Patch6: %{name}-noinet6.patch
-Patch7: %{name}-getifaddrs.patch
-Patch8: %{name}-dighost_asccheck.patch
+Patch7: %{name}-chroot-numcpus.patch
URL: http://www.isc.org/products/BIND/bind9.html
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: idnkit-devel
%{?with_hip:BuildRequires: libxml2-devel}
BuildRequires: libtool
-%{?with_ldap:BuildRequires: openldap-devel}
+%{?with_ldap:BuildRequires: openldap-devel >= 2.4.6}
%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
-BuildRequires: mysql-devel
-BuildRequires: postgresql-devel
-BuildRequires: unixODBC-devel
+%{?with_sql:BuildRequires: mysql-devel}
+%{?with_sql:BuildRequires: postgresql-devel}
+%{?with_sql:BuildRequires: unixODBC-devel}
BuildRequires: rpmbuild(macros) >= 1.268
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Provides: nameserver
Provides: user(named)
Obsoletes: caching-nameserver
-Obsoletes: nameserver
Conflicts: %{name}-chroot
Conflicts: kernel < 2.2.18
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%{?with_ldap:%patch5 -p1}
%patch6 -p1
%patch7 -p1
-%patch8 -p1
%{?with_hip:mv bind-hip/hip_55.[ch] lib/dns/rdata/generic}
+install %{SOURCE8} conf-pld/root.hint
+
%build
%{__libtoolize}
%{__aclocal}
%{?with_ssl:--with-openssl=%{_prefix}} \
%{?with_ipv6:--enable-ipv6} \
--enable-libbind \
- --with-dlz-postgres=yes \
- --with-dlz-mysql=yes \
+ %{?with_sql:--with-dlz-postgres=yes} \
+ %{?with_sql:--with-dlz-mysql=yes} \
--with-dlz-bdb=no \
--with-dlz-filesystem=yes \
%{?with_ldap:--with-dlz-ldap=yes} \
%{__make}
%{?with_hip:cd bind-hip/; %{__make}}
+%{?with_tests:%{__make} test}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_includedir},%{_bindir},%{_sbindir},%{_includedir}} \
ln -sf %{_var}/lib/named/named.log $RPM_BUILD_ROOT%{_var}/log/named
ln -sf %{_var}/lib/named/named.stats $RPM_BUILD_ROOT%{_var}/log/named.stats
-touch $RPM_BUILD_ROOT%{_var}/lib/named/{named.{log,stats},dev/{random,null}}
+touch $RPM_BUILD_ROOT%{_var}/lib/named/named.{log,stats}
%{?with_ldap:install -d $RPM_BUILD_ROOT%{_datadir}/openldap/schema}
%{?with_ldap:install %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/openldap/schema/dnszone.schema}
%useradd -u 58 -g 58 -d /tmp -s /bin/false -c "BIND user" named
%post
-if [ "$1" = 1 ]; then
- mknod -m 660 %{_var}/lib/named/dev/null c 1 3 2>/dev/null
- chown root:named %{_var}/lib/named/dev/null 2>/dev/null
- mknod -m 640 %{_var}/lib/named/dev/random c 1 8 2>/dev/null
- chown root:named %{_var}/lib/named/dev/random 2>/dev/null
- if [ ! -c %{_var}/lib/named/dev/null ] || [ ! -c %{_var}/lib/named/dev/random ]; then
-%banner -e %{name}-devs <<-EOF
-Device nodes were not created!!!
-
-Please read PLD Linux Vserver FAQ if you're installing %{name} inside
-vserver: <http://www.pld-linux.org/Vserver>.
-EOF
- fi #'
-fi
/sbin/chkconfig --add named
%service named restart
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+%triggerpostun -- %{name} < 6:9.4.1
+sed -i -e 's#^\([ \t]*category[ \t]\+cname[ \t]\+.*\)$#// \1#g' /var/lib/named/etc/named.conf
+sed -i -e 's#^\([ \t]*category[ \t]\+response-checks[ \t]\+.*\)$#// \1#g' /var/lib/named/etc/named.conf
+sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/etc/named.conf
+
%files
%defattr(644,root,root,755)
%doc README EXAMPLE-CONFIG-* FAQ doc/misc/* doc/arm/*.html doc/rfc/index %{?with_ldap:doc/*.sdb-ldap} %{?with_hip:bind-hip/COPYRIGHT-HIP-RR}
%attr(660,named,named) %ghost %{_var}/lib/named/named.log
%attr(660,named,named) %ghost %{_var}/lib/named/named.stats
-# devices for chrooted bind
-%attr(750,root,named) %dir %{_var}/lib/named/dev
-%ghost %attr(660,root,named) %{_var}/lib/named/dev/null
-%ghost %attr(640,root,named) %{_var}/lib/named/dev/random
-
%files utils
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/dig