]> git.pld-linux.org Git - packages/bind.git/blobdiff - bind.spec
- added bcond edns_cli and patch for building with the ability to use edns-client...
[packages/bind.git] / bind.spec
index 6c4fad712a614a4a7e0416ce1b89c0b3cf56fb19..61b2dba03f6561b5dd249ee294384fcf36c730db 100644 (file)
--- a/bind.spec
+++ b/bind.spec
@@ -1,5 +1,5 @@
 # TODO
-# - schema regstering in openldap-schema-bind
+# - apply http://www.caraytech.com/geodns/
 #
 # Conditional build:
 %bcond_without ssl             # build without OpenSSL support
@@ -9,8 +9,26 @@
 %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
-#
+%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 .P4
+%define                pverdir -P4
+%else
+%define                pverdot %{nil}
+%define                pverdir %{nil}
+%endif
 Summary:       BIND - DNS name server
 Summary(de.UTF-8):     BIND - DNS-Namenserver
 Summary(es.UTF-8):     BIND - Servidor de nombres DNS
@@ -21,16 +39,14 @@ Summary(ru.UTF-8):  BIND - cервер системы доменных имен (
 Summary(tr.UTF-8):     DNS alan adı sunucusu
 Summary(uk.UTF-8):     BIND - cервер системи доменних імен (DNS)
 Summary(zh_CN.UTF-8):  Internet 域名服务器
-%define        ver     9.5.0
-%define        plevel  P2
 Name:          bind
-Version:       %{ver}.%{plevel}
-Release:       3
+Version:       %{ver}%{pverdot}
+Release:       5
 Epoch:         7
 License:       BSD-like
 Group:         Networking/Daemons
-Source0:       ftp://ftp.isc.org/isc/bind9/%{ver}-%{plevel}/%{name}-%{ver}-%{plevel}.tar.gz
-# Source0-md5: 16c893f73a394c8cc36d7900cb9bb801
+Source0:       ftp://ftp.isc.org/isc/bind9/%{ver}%{pverdir}/%{name}-%{ver}%{pverdir}.tar.gz
+# Source0-md5: 13e36e3f28dc1ce7675b45a4192e8389
 Source1:       named.init
 Source2:       named.sysconfig
 Source3:       named.logrotate
@@ -41,33 +57,32 @@ Source5:    http://www.venaas.no/ldap/bind-sdb/dnszone-schema.txt
 Source6:       %{name}-hip.tar.gz
 # Source6-md5: 62a8a67f51ff8db9fe815205416a1f62
 Source7:       ftp://rs.internic.net/domain/named.root
-# Source7-md5: a94e29ac677846f3d4d618c50b7d34f1
+# Source7-md5: 013336e29e65923682f7bce094bb3e5c
 Source8:       %{name}-127.0.0.zone
 Source9:       %{name}-localhost.zone
 Source10:      %{name}-named.conf
 Patch0:                %{name}-time.patch
-Patch1:                %{name}-autoconf.patch
-Patch2:                %{name}-includedir-libbind.patch
-Patch3:                %{name}-link.patch
-Patch4:                %{name}-pmake.patch
-Patch5:                %{name}-sdb-ldap.patch
-Patch6:                %{name}-noinet6.patch
-Patch7:                %{name}-chroot-numcpus.patch
-URL:           http://www.isc.org/sw/bind/
+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
+%{?with_kerberos5:BuildRequires:       heimdal-devel}
 BuildRequires: idnkit-devel
-%{?with_kerberos5:BuildRequires:       krb5-devel}
-%{?with_hip:BuildRequires:     libxml2-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
@@ -87,6 +102,8 @@ Conflicts:   %{name}-chroot
 Conflicts:     kernel < 2.2.18
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                schemadir       /usr/share/openldap/schema
+
 %description
 BIND (Berkeley Internet Name Domain) is an implementation of the DNS
 (Domain Name System) protocols. BIND includes a DNS server (named),
@@ -326,8 +343,9 @@ BIND.
 Summary:       BIND schema for openldap
 Summary(pl.UTF-8):     Schemat BIND dla openldap
 Group:         Development/Libraries
-Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires(post,postun): sed >= 4.0
 Requires:      openldap-servers
+Requires:      sed >= 4.0
 
 %description -n openldap-schema-bind
 BIND schema for openldap.
@@ -336,37 +354,28 @@ BIND schema for openldap.
 Schemat BIND dla openldap.
 
 %prep
-%setup -q %{?with_hip:-a6} -n %{name}-%{ver}-%{plevel}
+%setup -q %{?with_hip:-a6} -n %{name}-%{ver}%{pverdir}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
+%{?with_ldap:%patch3 -p1}
 %patch4 -p1
-%{?with_ldap:%patch5 -p1}
-%patch6 -p1
-%patch7 -p1
 %{?with_hip:mv bind-hip/hip_55.[ch] lib/dns/rdata/generic}
 
+%{?with_edns_cli:%patch5 -p0}
 
 %build
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
 cp -f /usr/share/automake/config.* .
-cd lib/bind
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-cp -f /usr/share/automake/config.* .
-cd ../..
 %configure \
-       CFLAGS="-D_GNU_SOURCE=1" \
+       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} \
-       --enable-libbind \
        %{?with_sql:--with-dlz-postgres=yes} \
        %{?with_sql:--with-dlz-mysql=yes} \
        --with-dlz-bdb=no \
@@ -375,9 +384,10 @@ cd ../..
        --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=glibc
+       --enable-getifaddrs
 
 %{__make}
 %{?with_hip:cd bind-hip/; %{__make}}
@@ -388,7 +398,7 @@ cd ../..
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_includedir},%{_bindir},%{_sbindir},%{_includedir}} \
        $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
-       $RPM_BUILD_ROOT{%{_mandir}/man{1,3,5,8},%{_var}/{lib/named/{M,D,S,dev,etc},run,log}}
+       $RPM_BUILD_ROOT{%{_mandir}/man{1,3,5,8},%{_var}/{lib/named/{M,D,S,dev,etc},run/{named,lwresd},log}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
@@ -397,25 +407,30 @@ bzip2 -dc %{SOURCE4} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
 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
+ln -sf %{_var}/lib/named%{_sysconfdir}/bind.keys $RPM_BUILD_ROOT/etc/bind.keys
 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}
 
-%{?with_ldap:install -d $RPM_BUILD_ROOT%{_datadir}/openldap/schema}
-%{?with_ldap:install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/openldap/schema/dnszone.schema}
-%{?with_hip:install bind-hip/hi2dns $RPM_BUILD_ROOT%{_bindir}}
+%if %{with ldap}
+install -d $RPM_BUILD_ROOT%{schemadir}
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{schemadir}/dnszone.schema
+%endif
+
+%{?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
@@ -436,7 +451,7 @@ rm -rf $RPM_BUILD_ROOT
 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
@@ -460,12 +475,21 @@ fi
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
+%post -n openldap-schema-bind
+%openldap_schema_register %{schemadir}/dnszone.schema
+%service -q ldap restart
+
+%postun -n openldap-schema-bind
+if [ "$1" = "0" ]; then
+       %openldap_schema_unregister %{schemadir}/dnszone.schema
+       %service -q ldap restart
+fi
+
 %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)
@@ -475,30 +499,53 @@ sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/et
 %attr(754,root,root) /etc/rc.d/init.d/named
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/named
 %attr(640,root,named) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/named.conf
+%attr(640,root,named) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bind.keys
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/named
 
-%attr(755,root,root) %{_sbindir}/*
-
-%{_mandir}/man8/dns*
-%{_mandir}/man8/lwres*
-%{_mandir}/man8/named*
-%{_mandir}/man8/rndc*
-%{_mandir}/man5/rndc*
-%{_mandir}/man5/named.conf*
+%attr(755,root,root) %{_sbindir}/arpaname
+%attr(755,root,root) %{_sbindir}/ddns-confgen
+%attr(755,root,root) %{_sbindir}/dnssec-*
+%attr(755,root,root) %{_sbindir}/genrandom
+%attr(755,root,root) %{_sbindir}/isc-hmac-fixup
+%attr(755,root,root) %{_sbindir}/lwresd
+%attr(755,root,root) %{_sbindir}/named
+%attr(755,root,root) %{_sbindir}/named-*
+%attr(755,root,root) %{_sbindir}/nsec3hash
+%attr(755,root,root) %{_sbindir}/rndc
+%attr(755,root,root) %{_sbindir}/rndc-confgen
+
+%{_mandir}/man1/arpaname.1*
+%{_mandir}/man5/named.conf.5*
+%{_mandir}/man5/rndc.conf.5*
+%{_mandir}/man8/ddns-confgen.8*
+%{_mandir}/man8/dnssec-*.8*
+%{_mandir}/man8/genrandom.8*
+%{_mandir}/man8/isc-hmac-fixup.8*
+%{_mandir}/man8/lwresd.8*
+%{_mandir}/man8/named.8*
+%{_mandir}/man8/named-*.8*
+%{_mandir}/man8/nsec3hash.8*
+%{_mandir}/man8/rndc.8*
+%{_mandir}/man8/rndc-confgen.8*
 %lang(ja) %{_mandir}/ja/man8/named*
 
 %attr(770,root,named) %dir %{_var}/lib/named
 %attr(770,root,named) %dir %{_var}/lib/named/D
 %attr(750,root,named) %dir %{_var}/lib/named/M
 %attr(770,root,named) %dir %{_var}/lib/named/S
-%attr(750,root,named) %dir %{_var}/lib/named%{_sysconfdir}
+%attr(750,root,named) %dir %{_var}/lib/named/etc
+%attr(640,root,named) %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/etc/bind.keys
+%attr(640,root,named) %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/etc/named.conf
+%config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/M/*.zone
+%config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/root.hint
+%attr(660,named,named) %ghost %{_var}/lib/named/named.log
+%attr(660,named,named) %ghost %{_var}/lib/named/named.stats
+
+%attr(660,named,named) %config(noreplace,missingok) %verify(not md5 mtime size) %{_var}/log/named
+%attr(660,named,named) %config(noreplace,missingok) %verify(not md5 mtime size) %{_var}/log/named.stats
 
-%config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/M/*
-%config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named/root.*
-%attr(640,root,named) %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/named%{_sysconfdir}/*
-%attr(660,named,named) %config(noreplace,missingok) %verify(not md5 mtime size) %{_var}/log/named*
-%attr(660,named,named) %ghost  %{_var}/lib/named/named.log
-%attr(660,named,named) %ghost  %{_var}/lib/named/named.stats
+%attr(770,root,named) %dir %{_var}/run/named
+%attr(770,root,named) %dir %{_var}/run/lwresd
 
 %files utils
 %defattr(644,root,root,755)
@@ -510,7 +557,7 @@ sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/et
 %{_mandir}/man1/dig.1*
 %{_mandir}/man1/host.1*
 %{_mandir}/man1/nslookup.1*
-%{_mandir}/man8/nsupdate.8*
+%{_mandir}/man1/nsupdate.1*
 
 %lang(fi) %{_mandir}/fi/man1/host.1*
 
@@ -527,8 +574,6 @@ sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/et
 
 %files libs
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libbind.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libbind.so.[0-9]
 %attr(755,root,root) %{_libdir}/libbind9.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libbind9.so.[0-9][0-9]
 %attr(755,root,root) %{_libdir}/libdns.so.*.*.*
@@ -545,21 +590,18 @@ sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/et
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/isc-config.sh
-%attr(755,root,root) %{_libdir}/libbind.so
 %attr(755,root,root) %{_libdir}/libbind9.so
 %attr(755,root,root) %{_libdir}/libdns.so
 %attr(755,root,root) %{_libdir}/libisc.so
 %attr(755,root,root) %{_libdir}/libisccc.so
 %attr(755,root,root) %{_libdir}/libisccfg.so
 %attr(755,root,root) %{_libdir}/liblwres.so
-%{_libdir}/libbind.la
 %{_libdir}/libbind9.la
 %{_libdir}/libdns.la
 %{_libdir}/libisc.la
 %{_libdir}/libisccc.la
 %{_libdir}/libisccfg.la
 %{_libdir}/liblwres.la
-%{_includedir}/bind
 %{_includedir}/bind9
 %{_includedir}/dns
 %{_includedir}/dst
@@ -567,12 +609,12 @@ sed -i -e 's#^\([ \t]*category[ \t]\+load[ \t]\+.*\)$#// \1#g' /var/lib/named/et
 %{_includedir}/isccc
 %{_includedir}/isccfg
 %{_includedir}/lwres
+%{_mandir}/man1/isc-config.sh.1*
 %{_mandir}/man3/lwres*.3*
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/libbind.a
 %{_libdir}/libbind9.a
 %{_libdir}/libdns.a
 %{_libdir}/libisc.a
This page took 0.083862 seconds and 4 git commands to generate.