%bcond_without sql # build without SQL support
%bcond_without static_libs # build without static libraries
%bcond_without tests # perform tests
+%bcond_with edns_cli # build with the ability to use edns-client-subnet in dig
%bcond_with hip # build with HIP RR support
-#
-%define ver 9.7.2
+%if "%{pld_release}" == "ac"
+%bcond_with epoll # enable epoll support
+# there didn't exist x86_64 2.4 kernel in PLD, so can safely enable epoll
+%ifarch %{x8664}
+%define with_epoll 1
+%endif
+%else
+%bcond_without epoll # disable epoll support
+%endif
+
+%define ver 9.8.0
%if 1
-%define pverdot .P2
-%define pverdir -P2
+%define pverdot .P4
+%define pverdir -P4
%else
%define pverdot %{nil}
%define pverdir %{nil}
Summary(zh_CN.UTF-8): Internet 域名服务器
Name: bind
Version: %{ver}%{pverdot}
-Release: 3
+Release: 5
Epoch: 7
License: BSD-like
Group: Networking/Daemons
Source0: ftp://ftp.isc.org/isc/bind9/%{ver}%{pverdir}/%{name}-%{ver}%{pverdir}.tar.gz
-# Source0-md5: e74de6ec9c2cd27576794c873bd85f4a
+# Source0-md5: 13e36e3f28dc1ce7675b45a4192e8389
Source1: named.init
Source2: named.sysconfig
Source3: named.logrotate
Patch1: %{name}-link.patch
Patch2: %{name}-pmake.patch
Patch3: %{name}-sdb-ldap.patch
+Patch4: %{name}-ac-libs.patch
+Patch5: %{name}-edns-client-subnet.patch
URL: https://www.isc.org/software/bind
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
-BuildRequires: idnkit-devel
%{?with_kerberos5:BuildRequires: heimdal-devel}
-%{?with_hip:BuildRequires: libxml2-devel}
+BuildRequires: idnkit-devel
BuildRequires: libtool
+%{?with_hip:BuildRequires: libxml2-devel}
+%{?with_sql:BuildRequires: mysql-devel}
%{?with_ldap:BuildRequires: openldap-devel}
%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
-%{?with_sql:BuildRequires: mysql-devel}
%{?with_sql:BuildRequires: postgresql-devel}
-%{?with_sql:BuildRequires: unixODBC-devel}
+BuildRequires: rpm >= 4.4.9-56
BuildRequires: rpmbuild(macros) >= 1.268
+%{?with_sql:BuildRequires: unixODBC-devel}
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Requires(postun): /usr/sbin/userdel
%patch1 -p1
%patch2 -p1
%{?with_ldap:%patch3 -p1}
+%patch4 -p1
%{?with_hip:mv bind-hip/hip_55.[ch] lib/dns/rdata/generic}
+%{?with_edns_cli:%patch5 -p0}
%build
%{__libtoolize}
CFLAGS="-D_GNU_SOURCE=1 %{rpmcppflags}" \
--with-idn \
--with-libtool \
- %{?with_ssl:--with-openssl=%{_prefix}} \
+ %{?with_ssl:--with-openssl} \
%{?with_ipv6:--enable-ipv6} \
%{?with_kerberos5:--with-gssapi} \
%{?with_sql:--with-dlz-postgres=yes} \
--with-dlz-odbc=no \
--with-dlz-stub=yes \
--enable-largefile \
+ %{!?with_epoll:--disable-epoll --disable-devpoll} \
%{!?with_static_libs:--enable-static=no} \
--enable-threads \
--enable-getifaddrs
mv $RPM_BUILD_ROOT%{_mandir}/ja/man8/nslookup.8 $RPM_BUILD_ROOT%{_mandir}/ja/man1/nslookup.1
%{__perl} -pi -e 's/NSLOOKUP 8/NSLOOKUP 1/' $RPM_BUILD_ROOT%{_mandir}/ja/man1/nslookup.1
-install bin/tests/named.conf EXAMPLE-CONFIG-named
-install bin/tests/ndc.conf EXAMPLE-CONFIG-ndc
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/named
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/named
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/named
-install %{SOURCE7} $RPM_BUILD_ROOT%{_var}/lib/named/root.hint
-install %{SOURCE8} $RPM_BUILD_ROOT%{_var}/lib/named/M/127.0.0.zone
-install %{SOURCE9} $RPM_BUILD_ROOT%{_var}/lib/named/M/localhost.zone
-install %{SOURCE10} $RPM_BUILD_ROOT%{_var}/lib/named%{_sysconfdir}/named.conf
+cp -p bin/tests/named.conf EXAMPLE-CONFIG-named
+cp -p bin/tests/ndc.conf EXAMPLE-CONFIG-ndc
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/named
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/named
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/named
+cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_var}/lib/named/root.hint
+cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_var}/lib/named/M/127.0.0.zone
+cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_var}/lib/named/M/localhost.zone
+cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_var}/lib/named%{_sysconfdir}/named.conf
mv $RPM_BUILD_ROOT/etc/bind.keys $RPM_BUILD_ROOT%{_var}/lib/named%{_sysconfdir}/
ln -sf %{_var}/lib/named%{_sysconfdir}/named.conf $RPM_BUILD_ROOT/etc/named.conf
%if %{with ldap}
install -d $RPM_BUILD_ROOT%{schemadir}
-install %{SOURCE5} $RPM_BUILD_ROOT%{schemadir}/dnszone.schema
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{schemadir}/dnszone.schema
%endif
-%{?with_hip:install bind-hip/hi2dns $RPM_BUILD_ROOT%{_bindir}}
+%{?with_hip:install -p bind-hip/hi2dns $RPM_BUILD_ROOT%{_bindir}}
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/named-compilezone.8
echo ".so man8/named-checkzone.8" > $RPM_BUILD_ROOT%{_mandir}/man8/named-compilezone.8
if [ -f %{_sysconfdir}/named.boot ]; then
cp -f %{_sysconfdir}/named.boot /etc/named.boot.2conf
mv -f %{_sysconfdir}/named.boot /etc/named.rpmsave
- echo "Warning: %{_sysconfdir}/named.boot saved as /etc/named.rpmsave." 1>&2
+ echo >&2 "Warning: %{_sysconfdir}/named.boot saved as /etc/named.rpmsave."
fi
%groupadd -g 58 named
%useradd -u 58 -g 58 -d /tmp -s /bin/false -c "BIND user" named
%triggerpostun -- %{name} < 7:9.4.2-2
/sbin/chkconfig named reset
-#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
+%{__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)