%define sdb 1 %define geoip 0 %define gssapi 1 %{?_with_sdbp: %{expand: %%global sdb 1}} %{?_without_sdb: %{expand: %%global sdb 0}} %{?_with_geoip: %{expand: %%global geoip 1}} %{?_without_geoip: %{expand: %%global geoip 0}} %{?_with_gssapi: %{expand: %%global gssapi 1}} %{?_without_gssapi: %{expand: %%global gssapi 0}} %define major_version 9.9.2 %define patch_version P1 %define dashpatch %{?patch_version:-%patch_version}%nil %define dotpatch %{?patch_version:.%patch_version}%nil %define chroot_prefix /var/lib/named Name: bind Version: %{major_version}%{dotpatch} Release: %mkrel 1 Summary: A DNS (Domain Name System) server License: ISC Group: System/Servers URL: http://www.isc.org/products/BIND/ Source0: ftp://ftp.isc.org/isc/%{name}9/%{major_version}%{dashpatch}/%{name}-%{major_version}%{dashpatch}.tar.gz Source1: ftp://ftp.isc.org/isc/%{name}9/%{major_version}%{dashpatch}/%{name}-%{major_version}%{dashpatch}.tar.gz.sha512.asc Source6: named.sysconfig Source7: named.logrotate Source8: named.NetworkManager Source11: ftp://ftp.internic.net/domain/named.cache Source20: bind-keygen.c Source40: bind.tmpfiles Source41: named.service Source42: named-sdb.service Source43: setup-named-chroot.sh # sdb Source30: ldap2zone.c Source31: ldap2zone.1 Source32: named-sdb.8 Source33: zonetodb.1 Source34: zone2sqlite.1 Source35: bind-9.3.1rc1-sdb_tools-Makefile.in Source36: dnszone.schema Source37: README.sdb_pgsql Source100: named.conf Source102: named.root.key Source103: trusted-key.key Source105: rndc.key Source110: named.ca Source111: named.localhost Source112: named.empty Source113: named.loopback # fedora patches Patch5: bind-nonexec.patch Patch10: bind-9.5-PIE.patch Patch72: bind-9.5-dlz-64bit.patch Patch87: bind-9.5-parallel-build.patch Patch99: bind-96-libtool2.patch Patch101: bind-96-old-api.patch Patch102: bind-95-rh452060.patch Patch106: bind93-rh490837.patch Patch107: bind97-dist-pkcs11.patch Patch109: bind97-rh478718.patch Patch110: bind97-rh570851.patch Patch111: bind97-exportlib.patch Patch112: bind97-rh645544.patch Patch119: bind97-rh693982.patch Patch123: bind98-rh735103.patch Patch124: nslookup-norec.patch Patch125: bind99-buildfix.patch Patch127: bind99-forward.patch Patch130: bind-9.9.2-dlz-libdb4.patch Patch131: bind-9.9.1-P2-multlib-conflict.patch Patch132: bind99-stat.patch # SDB patches Patch11: bind-9.3.2b2-sdbsrc.patch Patch12: bind-9.5-sdb.patch Patch62: bind-9.5-sdb-sqlite-bld.patch # needs inpection Patch17: bind-9.3.2b1-fix_sdb_ldap.patch Patch104: bind-96-dyndb.patch # IDN patches Patch73: bind-9.5-libidn.patch Patch83: bind-9.5-libidn2.patch Patch85: bind-9.5-libidn3.patch Patch94: bind95-rh461409.patch # other patches Patch206: bind-9.2.0rc3-varrun.patch Patch208: bind-9.3.2-prctl_set_dumpable.patch # (oe) rediffed patch originates from http://www.caraytech.com/geodns/ Patch300: bind-9.4.0-geoip.diff Requires: bind-utils >= %{version}-%{release} Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 BuildRequires: openssl-devel BuildRequires: multiarch-utils >= 1.0.3 BuildRequires: libidn-devel BuildRequires: postgresql-devel BuildRequires: mysql-devel BuildRequires: libcap-devel >= 2.10 BuildRequires: libxml2-devel %if %{gssapi} BuildRequires: krb5-devel %endif %if %{geoip} BuildRequires: libgeoip-devel %endif %if %{sdb} BuildRequires: mysql-devel BuildRequires: openldap-devel BuildRequires: postgresql-devel BuildRequires: sqlite3-devel %endif %description 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, and a resolver library (routines for applications to use when interfacing with DNS). A DNS server allows clients to name resources or objects and share the information with other network machines. The named DNS server can be used on workstations as a caching name server, but is generally only needed on one machine for an entire network. Note that the configuration files for making BIND act as a simple caching nameserver are included in the caching-nameserver package. Install the bind package if you need a DNS server for your network. If you want bind to act a caching name server, you will also need to install the caching-nameserver package. Many BIND 8 features previously unimplemented in BIND 9, including domain-specific forwarding, the \$GENERATE master file directive, and the "blackhole", "dialup", and "sortlist" options Forwarding of dynamic update requests; this is enabled by the "allow-update-forwarding" option A new, simplified database interface and a number of sample drivers based on it; see doc/dev/sdb for details Support for building single-threaded servers for environments that do not supply POSIX threads New configuration options: "min-refresh-time", "max-refresh-time", "min-retry-time", "max-retry-time", "additional-from-auth", "additional-from-cache", "notify explicit" Faster lookups, particularly in large zones. Build Options: --with sdb Build with database backends and DLZ support (enabled by default) --with geoip Build with GeoIP support (disabled per default) %if %{sdb} %package sdb Summary: BIND server with database backends and DLZ support Group: System/Servers Requires: bind Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 %description sdb BIND (Berkeley Internet Name Domain) is an implementation of the DNS (Domain Name System) protocols. BIND includes a DNS server (named-sdb) which has compiled-in SDB (Simplified Database Backend) which includes support for using alternative Zone Databases stored in an LDAP server (ldapdb), a postgreSQL database (pgsqldb), an sqlite database (sqlitedb), or in the filesystem (dirdb), in addition to the standard in-memory RBT (Red Black Tree) zone database. It also includes support for DLZ (Dynamic Loadable Zones) %endif %package utils Summary: Utilities for querying DNS name servers Group: Networking/Other %description utils Bind-utils contains a collection of utilities for querying DNS (Domain Name Service) name servers to find out information about Internet hosts. These tools will provide you with the IP addresses for given host names, as well as other information about registered domains and network addresses. You should install bind-utils if you need to get information from DNS name servers. %package devel Summary: Include files and libraries needed for bind DNS development Group: Development/C %description devel The bind-devel package contains all the include files and the library required for DNS (Domain Name Service) development for BIND versions 9.x.x. %package doc Summary: Documentation for BIND Group: Documentation BuildArch: noarch %description doc The bind-devel package contains the documentation for BIND. %prep %setup -q -n %{name}-%{major_version}%{dashpatch} %patch5 -p1 -b .nonexec %patch10 -p1 -b .PIE %patch104 -p1 -b .dyndb %patch72 -p1 -b .64bit %patch73 -p1 -b .libidn %patch83 -p1 -b .libidn2 %patch85 -p1 -b .libidn3 %patch87 -p1 -b .parallel %patch94 -p1 -b .rh461409 mkdir m4 %patch99 -p1 -b .libtool2 %patch102 -p1 -b .rh452060 %patch106 -p0 -b .rh490837 %patch107 -p1 -b .dist-pkcs11 %patch109 -p1 -b .rh478718 %patch110 -p1 -b .rh570851 %patch111 -p1 -b .exportlib %patch112 -p1 -b .rh645544 %patch119 -p1 -b .rh693982 %patch123 -p1 -b .rh735103 pushd bin/dig %patch124 -p0 -b .nslookup-norec popd %patch125 -p1 -b .buildfix %patch127 -p1 -b .forward %patch130 -p1 -b .libdb4 %patch131 -p1 -b .multlib-conflict %if %{sdb} %patch101 -p1 -b .old-api mkdir bin/named-sdb cp -r bin/named/* bin/named-sdb %patch11 -p1 -b .sdbsrc # SDB ldap cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named-sdb # SDB postgreSQL cp -fp contrib/sdb/pgsql/pgsqldb.[ch] bin/named-sdb # SDB sqlite cp -fp contrib/sdb/sqlite/sqlitedb.[ch] bin/named-sdb # SDB Berkeley DB - needs to be ported to DB4! #cp -fp contrib/sdb/bdb/bdb.[ch] bin/named_sdb # SDB dir cp -fp contrib/sdb/dir/dirdb.[ch] bin/named-sdb # SDB tools mkdir -p bin/sdb_tools cp -fp %{SOURCE30} bin/sdb_tools/ldap2zone.c cp -fp %{SOURCE35} bin/sdb_tools/Makefile.in #cp -fp contrib/sdb/bdb/zone2bdb.c bin/sdb_tools cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/sdb_tools cp -fp contrib/sdb/pgsql/zonetodb.c bin/sdb_tools cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools %patch12 -p1 -b .sdb %patch17 -p1 -b .fix_sdb_ldap %patch62 -p1 -b .sdb-sqlite-bld %endif %patch132 -p1 -b .stat %patch206 -p0 -b .varrun.droplet %patch208 -p0 -b .prctl_set_dumpable.droplet %if %{geoip} %patch300 -p1 -b .geoip %endif cp %{SOURCE20} keygen.c cp %{SOURCE11} named.cache %build %serverbuild export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE" export STD_CDEFINES="$CPPFLAGS" libtoolize --copy --force aclocal -I m4 --force autoheader --force autoconf --force # (oe) make queryperf from the contrib _before_ bind..., makes it # easier to determine if it builds or not, it saves time... pushd contrib/queryperf rm -f configure autoconf %configure2_5x %make CFLAGS="$CFLAGS" popd pushd contrib/query-loc-* perl -pi -e "s|-lnsl|-lnsl -lresolv|g" configure* rm -f configure autoconf %configure2_5x %make CFLAGS="$CFLAGS" popd %if %{geoip} export CFLAGS="$CFLAGS -DGEOIP" export LDFLAGS="$LDFLAGS -lGeoIP" %endif %configure2_5x \ --localstatedir=/var \ --disable-openssl-version-check \ --enable-exportlib \ --with-export-libdir=%{_libdir} \ --with-export-includedir=%{_includedir} \ --enable-threads \ --enable-largefile \ --enable-ipv6 \ --enable-filter-aaaa \ --enable-epoll \ --with-openssl=%{_prefix} \ %if %{gssapi} --with-gssapi=%{_prefix} --disable-isc-spnego \ %endif --with-randomdev=/dev/urandom \ --with-libxml2=yes \ %if %{sdb} --with-dlz-ldap=yes \ --with-dlz-postgres=yes \ --with-dlz-mysql=yes \ --with-dlz-filesystem=yes \ --with-dlz-stub=yes %endif # pkcs11 support requires a working backend, otherwise bind won't start # http://blogs.sun.com/janp/ # http://sourceforge.net/projects/opencryptoki #--with-pkcs11 \ make gcc $CFLAGS -o dns-keygen keygen.c #%%check ## run the test suite #make check %install rm -rf %{buildroot} %makeinstall_std install -d -p %{buildroot}%{_libdir}/bind install -d %{buildroot}/var/named/{slaves,data,dynamic} install -d %{buildroot}/var/log # chroot install -d %{buildroot}%{chroot_prefix}/{dev,etc,var} install -d %{buildroot}%{chroot_prefix}/var/{log,named,run/named,tmp} install -d %{buildroot}%{chroot_prefix}/etc/{pki/dnssec-keys,named} install -d %{buildroot}%{chroot_prefix}/%{_libdir}/bind install -d %{buildroot}%{chroot_prefix}/%{_libdir}/openssl # these are required to prevent them being erased during upgrade of previous # versions that included them (rh bug #130121): touch %{buildroot}%{chroot_prefix}/dev/null touch %{buildroot}%{chroot_prefix}/dev/random touch %{buildroot}%{chroot_prefix}/dev/zero touch %{buildroot}%{chroot_prefix}/etc/localtime install -m 755 %{SOURCE43} %{buildroot}%{_sbindir}/setup-named-chroot.sh # systemd files install -d -m 755 %{buildroot}%{_unitdir} install -m 644 %{SOURCE41} %{buildroot}%{_unitdir} install -m 644 %{SOURCE42} %{buildroot}%{_unitdir} install -D -m 644 %{SOURCE40} %{buildroot}%{_tmpfilesdir}/named.conf # main configuration install -m 644 %{SOURCE100} %{buildroot}%{_sysconfdir}/named.conf install -m 644 %{SOURCE102} %{buildroot}%{_sysconfdir}/named.root.key install -m 644 %{SOURCE103} %{buildroot}%{_sysconfdir}/trusted-key.key install -m 640 %{SOURCE105} %{buildroot}%{_sysconfdir}/rndc.key mv %{buildroot}%{_sysconfdir}/bind.keys \ %{buildroot}%{_sysconfdir}/named.iscdlv.key install -d 755 %{buildroot}/etc/named install -d 755 %{buildroot}%{_localstatedir}/named install -m 644 %{SOURCE110} %{buildroot}%{_localstatedir}/named/named.ca install -m 644 %{SOURCE111} %{buildroot}%{_localstatedir}/named/named.localhost install -m 644 %{SOURCE112} %{buildroot}%{_localstatedir}/named/named.empty install -m 644 %{SOURCE113} %{buildroot}%{_localstatedir}/named/named.loopback # other configuration install -D -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/named install -D -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/named install -d -m 755 %{buildroot}%{_sysconfdir}/rsyslog.d/ cat > %{buildroot}%{_sysconfdir}/rsyslog.d/named.conf <<'EOF' $AddUnixListenSocket /var/lib/named/dev/log EOF install -D -m 755 \ %{SOURCE8} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/13-named %if %{sdb} mkdir -p %{buildroot}/etc/openldap/schema install -m 644 %{SOURCE36} %{buildroot}/etc/openldap/schema/dnszone.schema install -m 644 %{SOURCE37} contrib/sdb/pgsql/ install -m 644 %{SOURCE31} %{buildroot}%{_mandir}/man1/ldap2zone.1 install -m 644 %{SOURCE32} %{buildroot}%{_mandir}/man8/named-sdb.8 install -m 644 %{SOURCE33} %{buildroot}%{_mandir}/man1/zonetodb.1 install -m 644 %{SOURCE34} %{buildroot}%{_mandir}/man1/zone2sqlite.1 %endif # contrib install -m0755 contrib/named-bootconf/named-bootconf.sh %{buildroot}%{_sbindir}/named-bootconf install -m0755 contrib/queryperf/queryperf %{buildroot}%{_bindir}/ cp contrib/queryperf/README README.queryperf install -m0755 contrib/query-loc-*/query-loc %{buildroot}%{_bindir}/ install -m0644 contrib/query-loc-*/query-loc.1 %{buildroot}%{_mandir}/man1/ cp contrib/query-loc-*/ADDRESSES ADDRESSES.query-loc cp contrib/query-loc-*/ALGO ALGO.query-loc cp contrib/query-loc-*/README README.query-loc cp contrib/query-loc-*/USAGE USAGE.query-loc install -m 755 dns-keygen %{buildroot}%{_sbindir}/dns-keygen install -d -m 755 %{buildroot}%{_docdir}/%{name} install -d -m 755 %{buildroot}%{_docdir}/%{name}/arm install -m 644 doc/arm/*.html %{buildroot}%{_docdir}/%{name}/arm install -m 644 doc/arm/*.pdf %{buildroot}%{_docdir}/%{name}/arm cp -pr doc/misc %{buildroot}%{_docdir}/%{name} rm -f %{buildroot}%{_docdir}/%{name}/misc/Makefile* %multiarch_binaries %{buildroot}%{_bindir}/isc-config.sh cat > README.mga <