############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = bind version = 9.8.1 release = 3 groups = Networking/Tools url = http://www.isc.org/products/BIND/ license = Proprietary summary = BIND provides tools for the DNS. description BIND (Berkeley Internet Name Domain or named) is the most commonly used DNS server on the Internet, especially on Unix-like systems. end source_dl = ftp://ftp.isc.org/isc/bind/%{version}/ sources = \ bind-9.8.1.tar.gz \ bind-config-8.tar.bz2 # Apply patches in a special order. patches = \ bind-nonexec.patch \ bind-9.5-PIE.patch \ bind-9.3.2-redhat_doc.patch \ bind-96-dyndb.patch \ bind98-rh725741.patch \ bind-9.5-overflow.patch \ bind-9.5-dlz-64bit.patch \ bind-9.5-libidn.patch \ bind-9.5-libidn2.patch \ bind-9.5-libidn3.patch \ bind-9.5-parallel-build.patch \ bind95-rh461409.patch\ bind-96-libtool2.patch \ bind-95-rh452060.patch \ bind97-dist-pkcs11.patch \ bind97-rh478718.patch \ bind97-rh570851.patch \ bind97-exportlib.patch \ bind97-rh645544.patch \ bind97-rh699951.patch \ bind97-rh693982.patch \ bind97-rh700097.patch \ bind97-rh714049.patch \ bind98-dlz_buildfix.patch \ bind98-rh735103.patch build requires autoconf automake chrpath db4-devel libtool libcap-devel libidn-devel pkg-config openssl-devel shadow-utils end configure_options += \ --with-libtool \ --enable-threads \ --enable-ipv6 \ --with-pic \ --disable-static \ --disable-openssl-version-check \ --enable-exportlib \ --with-export-libdir=/%{lib}/ \ --with-export-includedir=/usr/include/ \ --includedir=/usr/include/bind9/ \ --with-pkcs11=%{libdir}/pkcs11/PKCS11_API.so \ --with-gssapi=yes \ --disable-isc-spnego prepare cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz # Create m4 directory. cd %{DIR_APP} && mkdir -pv m4 # Apply all patches. %{MACRO_PATCHES} # Branding. sed -i -e 's/RELEASEVER=\(.*\)/RELEASEVER=\1-%{DISTRO_NAME}-%{version}-%{release}/' version # Regenerate build environment libtoolize -c -f aclocal -I m4 --force autoconf -f # Create user and group for /run directory. %{create_user} end install # Compress doc files. gzip -9 doc/rfc/* # Create directory layout. mkdir -pv %{BUILDROOT}%{libdir}/bind mkdir -pv %{BUILDROOT}/var/named/{slaves,data,dynamic} mkdir -pv %{BUILDROOT}/usr/share/man/{man1,man5,man8} mkdir -pv %{BUILDROOT}/run/named mkdir -pv %{BUILDROOT}/var/log # Create named chroot environment. mkdir -pv %{BUILDROOT}/var/named/chroot/{dev,etc,var} mkdir -pv %{BUILDROOT}/var/named/chroot/var/{log,named,run/named,tmp} mkdir -pv %{BUILDROOT}/var/named/chroot/etc/{pki/dnssec-keys,named} mkdir -pv %{BUILDROOT}/var/named/chroot/usr/lib/bind mkdir -pv %{BUILDROOT}/var/named/chroot/dev/null mkdir -pv %{BUILDROOT}/var/named/chroot/dev/random mkdir -pv %{BUILDROOT}/var/named/chroot/dev/zero mkdir -pv %{BUILDROOT}/var/named/chroot/etc/localtime touch %{BUILDROOT}/var/named/chroot/etc/named.conf # Run make install make DESTDIR=%{BUILDROOT} install # Remove RPATH from libraries. chrpath --delete %{BUILDROOT}/lib*/*export*.so.* # Remove unwanted files rm -rvf %{BUILDROOT}/etc/bind.keys # Create ghost config files touch %{BUILDROOT}/var/log/named.log # Configuration files tar -C %{BUILDROOT} -xaf %{DIR_DL}/bind-config-8.tar.bz2 touch %{BUILDROOT}/etc/rndc.key touch %{BUILDROOT}/etc/rndc.conf mkdir %{BUILDROOT}/etc/named install -m 644 bind.keys %{BUILDROOT}/etc/named.iscdlv.key install -m 644 %{DIR_SOURCE}/trusted-key.key %{BUILDROOT}/etc/trusted-key.key # Recreate symlinks for export libraries rm -rf %{BUILDROOT}/%{lib}/lib*-export.so ln -svf ../../%{lib}/libdns-export.so.81 %{BUILDROOT}%{libdir}/libdns-export.so ln -svf ../../%{lib}/libirs-export.so.80 %{BUILDROOT}%{libdir}/libirs-export.so ln -svf ../../%{lib}/libisccfg-export.so.82 %{BUILDROOT}%{libdir}/libisccfg-export.so ln -svf ../../%{lib}/libisc-export.so.83 %{BUILDROOT}%{libdir}/libisc-export.so # Create /run/named. mkdir -pv %{BUILDROOT}/run/named chown -Rv named.named %{BUILDROOT}/run/named/ end end create_user getent group named >/dev/null || /usr/sbin/groupadd -r named getent passwd named >/dev/null || /usr/sbin/useradd -r -g named \ -d /var/named -c "User for bind DNS server" -s /sbin/nologin named end packages package %{name} requires bind-utils bind-chroot end prerequires += shadow-utils script prein %{create_user} end # XXX Add systemd scriptlet if a service file becomes available end package %{name}-utils summary = Utilities for querying bind DNS name server. description = %{summary} files /usr/bin/dig /usr/bin/host /usr/bin/nslookup /usr/bin/nsupdate /usr/share/man/man1/dig.1* /usr/share/man/man1/host.1* /usr/share/man/man1/nslookup.1* /usr/share/man/man1/nsupdate.1* end end package %{name}-chroot summary = Chroot environment for bind DNS servers. description = %{summary} files /var/named/chroot end end package %{name}-libs template LIBS end package %{name}-devel template DEVEL end package %{name}-debuginfo template DEBUGINFO end end