1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = Networking/Tools
11 url = http://www.isc.org/products/BIND/
13 summary = BIND provides tools for the DNS.
16 BIND (Berkeley Internet Name Domain or named) is the most commonly used
17 DNS server on the Internet, especially on Unix-like systems.
20 source_dl = ftp://ftp.isc.org/isc/bind/%{version}/
26 # Apply patches in a special order.
30 bind-9.3.2-redhat_doc.patch \
32 bind98-rh725741.patch \
33 bind-9.5-overflow.patch \
34 bind-9.5-dlz-64bit.patch \
35 bind-9.5-libidn.patch \
36 bind-9.5-libidn2.patch \
37 bind-9.5-libidn3.patch \
38 bind-9.5-parallel-build.patch \
39 bind95-rh461409.patch\
40 bind-96-libtool2.patch \
41 bind-95-rh452060.patch \
42 bind97-dist-pkcs11.patch \
43 bind97-rh478718.patch \
44 bind97-rh570851.patch \
45 bind97-exportlib.patch \
46 bind97-rh645544.patch \
47 bind97-rh699951.patch \
48 bind97-rh693982.patch \
49 bind97-rh700097.patch \
50 bind97-rh714049.patch \
51 bind98-dlz_buildfix.patch \
68 configure_options += \
74 --disable-openssl-version-check \
76 --with-export-libdir=/%{lib}/ \
77 --with-export-includedir=/usr/include/ \
78 --includedir=/usr/include/bind9/ \
79 --with-pkcs11=%{libdir}/pkcs11/PKCS11_API.so \
84 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
86 # Create m4 directory.
87 cd %{DIR_APP} && mkdir -pv m4
93 sed -i -e 's/RELEASEVER=\(.*\)/RELEASEVER=\1-%{DISTRO_NAME}-%{version}-%{release}/' version
95 # Regenerate build environment
100 # Create user and group for /run directory.
105 # Compress doc files.
108 # Create directory layout.
109 mkdir -pv %{BUILDROOT}%{libdir}/bind
110 mkdir -pv %{BUILDROOT}/var/named/{slaves,data,dynamic}
111 mkdir -pv %{BUILDROOT}/usr/share/man/{man1,man5,man8}
112 mkdir -pv %{BUILDROOT}/run/named
113 mkdir -pv %{BUILDROOT}/var/log
115 # Create named chroot environment.
116 mkdir -pv %{BUILDROOT}/var/named/chroot/{dev,etc,var}
117 mkdir -pv %{BUILDROOT}/var/named/chroot/var/{log,named,run/named,tmp}
118 mkdir -pv %{BUILDROOT}/var/named/chroot/etc/{pki/dnssec-keys,named}
119 mkdir -pv %{BUILDROOT}/var/named/chroot/usr/lib/bind
120 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/null
121 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/random
122 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/zero
123 mkdir -pv %{BUILDROOT}/var/named/chroot/etc/localtime
125 touch %{BUILDROOT}/var/named/chroot/etc/named.conf
128 make DESTDIR=%{BUILDROOT} install
130 # Remove RPATH from libraries.
131 chrpath --delete %{BUILDROOT}/lib*/*export*.so.*
133 # Remove unwanted files
134 rm -rvf %{BUILDROOT}/etc/bind.keys
136 # Create ghost config files
137 touch %{BUILDROOT}/var/log/named.log
139 # Configuration files
140 tar -C %{BUILDROOT} -xaf %{DIR_DL}/bind-config-8.tar.bz2
141 touch %{BUILDROOT}/etc/rndc.key
142 touch %{BUILDROOT}/etc/rndc.conf
144 mkdir %{BUILDROOT}/etc/named
145 install -m 644 bind.keys %{BUILDROOT}/etc/named.iscdlv.key
146 install -m 644 %{DIR_SOURCE}/trusted-key.key %{BUILDROOT}/etc/trusted-key.key
148 # Recreate symlinks for export libraries
149 rm -rf %{BUILDROOT}/%{lib}/lib*-export.so
151 ln -svf ../../%{lib}/libdns-export.so.81 %{BUILDROOT}%{libdir}/libdns-export.so
152 ln -svf ../../%{lib}/libirs-export.so.80 %{BUILDROOT}%{libdir}/libirs-export.so
153 ln -svf ../../%{lib}/libisccfg-export.so.82 %{BUILDROOT}%{libdir}/libisccfg-export.so
154 ln -svf ../../%{lib}/libisc-export.so.83 %{BUILDROOT}%{libdir}/libisc-export.so
157 mkdir -pv %{BUILDROOT}/run/named
158 chown -Rv named.named %{BUILDROOT}/run/named/
163 getent group named >/dev/null || /usr/sbin/groupadd -r named
164 getent passwd named >/dev/null || /usr/sbin/useradd -r -g named \
165 -d /var/named -c "User for bind DNS server" -s /sbin/nologin named
175 prerequires += shadow-utils
181 # XXX Add systemd scriptlet if a service file becomes available
184 package %{name}-utils
185 summary = Utilities for querying bind DNS name server.
186 description = %{summary}
193 /usr/share/man/man1/dig.1*
194 /usr/share/man/man1/host.1*
195 /usr/share/man/man1/nslookup.1*
196 /usr/share/man/man1/nsupdate.1*
200 package %{name}-chroot
201 summary = Chroot environment for bind DNS servers.
202 description = %{summary}
213 package %{name}-devel
217 package %{name}-debuginfo