]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - bind/bind.nm
Merge remote-tracking branch 'stevee/pcre'
[people/ms/ipfire-3.x.git] / bind / bind.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = bind
7 version = 9.8.1
8 release = 3
9
10 groups = Networking/Tools
11 url = http://www.isc.org/products/BIND/
12 license = Proprietary
13 summary = BIND provides tools for the DNS.
14
15 description
16 BIND (Berkeley Internet Name Domain or named) is the most commonly used
17 DNS server on the Internet, especially on Unix-like systems.
18 end
19
20 source_dl = ftp://ftp.isc.org/isc/bind/%{version}/
21
22 sources = \
23 bind-9.8.1.tar.gz \
24 bind-config-8.tar.bz2
25
26 # Apply patches in a special order.
27 patches = \
28 bind-nonexec.patch \
29 bind-9.5-PIE.patch \
30 bind-9.3.2-redhat_doc.patch \
31 bind-96-dyndb.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 \
52 bind98-rh735103.patch
53
54 build
55 requires
56 autoconf
57 automake
58 chrpath
59 db4-devel
60 libtool
61 libcap-devel
62 libidn-devel
63 pkg-config
64 openssl-devel
65 shadow-utils
66 end
67
68 configure_options += \
69 --with-libtool \
70 --enable-threads \
71 --enable-ipv6 \
72 --with-pic \
73 --disable-static \
74 --disable-openssl-version-check \
75 --enable-exportlib \
76 --with-export-libdir=/%{lib}/ \
77 --with-export-includedir=/usr/include/ \
78 --includedir=/usr/include/bind9/ \
79 --with-pkcs11=%{libdir}/pkcs11/PKCS11_API.so \
80 --with-gssapi=yes \
81 --disable-isc-spnego
82
83 prepare
84 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
85
86 # Create m4 directory.
87 cd %{DIR_APP} && mkdir -pv m4
88
89 # Apply all patches.
90 %{MACRO_PATCHES}
91
92 # Branding.
93 sed -i -e 's/RELEASEVER=\(.*\)/RELEASEVER=\1-%{DISTRO_NAME}-%{version}-%{release}/' version
94
95 # Regenerate build environment
96 libtoolize -c -f
97 aclocal -I m4 --force
98 autoconf -f
99
100 # Create user and group for /run directory.
101 %{create_user}
102 end
103
104 install
105 # Compress doc files.
106 gzip -9 doc/rfc/*
107
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
114
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
124
125 touch %{BUILDROOT}/var/named/chroot/etc/named.conf
126
127 # Run make install
128 make DESTDIR=%{BUILDROOT} install
129
130 # Remove RPATH from libraries.
131 chrpath --delete %{BUILDROOT}/lib*/*export*.so.*
132
133 # Remove unwanted files
134 rm -rvf %{BUILDROOT}/etc/bind.keys
135
136 # Create ghost config files
137 touch %{BUILDROOT}/var/log/named.log
138
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
143
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
147
148 # Recreate symlinks for export libraries
149 rm -rf %{BUILDROOT}/%{lib}/lib*-export.so
150
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
155
156 # Create /run/named.
157 mkdir -pv %{BUILDROOT}/run/named
158 chown -Rv named.named %{BUILDROOT}/run/named/
159 end
160 end
161
162 create_user
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
166 end
167
168 packages
169 package %{name}
170 requires
171 bind-utils
172 bind-chroot
173 end
174
175 prerequires += shadow-utils
176
177 script prein
178 %{create_user}
179 end
180
181 # XXX Add systemd scriptlet if a service file becomes available
182 end
183
184 package %{name}-utils
185 summary = Utilities for querying bind DNS name server.
186 description = %{summary}
187
188 files
189 /usr/bin/dig
190 /usr/bin/host
191 /usr/bin/nslookup
192 /usr/bin/nsupdate
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*
197 end
198 end
199
200 package %{name}-chroot
201 summary = Chroot environment for bind DNS servers.
202 description = %{summary}
203
204 files
205 /var/named/chroot
206 end
207 end
208
209 package %{name}-libs
210 template LIBS
211 end
212
213 package %{name}-devel
214 template DEVEL
215 end
216
217 package %{name}-debuginfo
218 template DEBUGINFO
219 end
220 end