1 | #%define PATCHVER P4
|
---|
2 | #%define PREVER rc1
|
---|
3 | #%define VERSION %{version}%{PREVER}
|
---|
4 | #%define VERSION %{version}-%{PATCHVER}
|
---|
5 | %define VERSION %{version}
|
---|
6 |
|
---|
7 | %{?!SDB: %define SDB 0}
|
---|
8 | %{?!test: %define test 0}
|
---|
9 | %{?!bind_uid: %define bind_uid 25}
|
---|
10 | %{?!bind_gid: %define bind_gid 25}
|
---|
11 | %{?!GSSTSIG: %define GSSTSIG 0}
|
---|
12 | %{?!PKCS11: %define PKCS11 0}
|
---|
13 | %{?!DEVEL: %define DEVEL 1}
|
---|
14 | %define bind_dir /@unixroot/var/named
|
---|
15 | %define chroot_prefix %{bind_dir}/chroot
|
---|
16 |
|
---|
17 | #
|
---|
18 | Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server
|
---|
19 | Name: bind
|
---|
20 | License: ISC
|
---|
21 | Version: 9.8.1
|
---|
22 | Release: 1%{?dist}
|
---|
23 | Url: http://www.isc.org/products/BIND/
|
---|
24 | Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
---|
25 | Group: System Environment/Daemons
|
---|
26 | #
|
---|
27 | Source: ftp://ftp.isc.org/isc/bind9/%{VERSION}/bind-%{VERSION}.tar.gz
|
---|
28 |
|
---|
29 | #Source8: dnszone.schema
|
---|
30 | Source25: named.conf.sample
|
---|
31 | Source28: config-8.tar.bz2
|
---|
32 | Source35: bind.tmpfiles.d
|
---|
33 | Source36: trusted-key.key
|
---|
34 |
|
---|
35 | Patch0: bind-os2.patch
|
---|
36 |
|
---|
37 | #
|
---|
38 | #Requires: mktemp
|
---|
39 | #Requires: systemd-units
|
---|
40 | #Requires: bind-libs = %{version}-%{release}
|
---|
41 | Obsoletes: bind-config < 30:9.3.2-34.fc6
|
---|
42 | Provides: bind-config = 30:9.3.2-34.fc6
|
---|
43 | Obsoletes: caching-nameserver < 31:9.4.1-7.fc8
|
---|
44 | Provides: caching-nameserver = 31:9.4.1-7.fc8
|
---|
45 | Obsoletes: dnssec-conf < 1.27-2
|
---|
46 | Provides: dnssec-conf = 1.27-1
|
---|
47 | BuildRequires: openssl-devel, autoconf, pkgconfig, libxml2-devel
|
---|
48 | #BuildRequires: libidn-devel, libcap-devel, libtool
|
---|
49 | %if %{SDB}
|
---|
50 | BuildRequires: openldap-devel, postgresql-devel, sqlite-devel, mysql-devel
|
---|
51 | %endif
|
---|
52 | %if %{test}
|
---|
53 | BuildRequires: net-tools
|
---|
54 | %endif
|
---|
55 | %if %{GSSTSIG}
|
---|
56 | BuildRequires: krb5-devel
|
---|
57 | %endif
|
---|
58 |
|
---|
59 | # Comment from atkac:
|
---|
60 | #
|
---|
61 | # Don't extract provides for the following libraries. Non-BIND9
|
---|
62 | # applications should not use them, they should use libraries
|
---|
63 | # from bind-libs-lite package.
|
---|
64 | #
|
---|
65 | # Since bind-libs-lite doesn't contain some libraries used by all
|
---|
66 | # BIND9 programs (like liblwres) use those "internal" libraries for
|
---|
67 | # dependency resolution. If, for example, bind package requires
|
---|
68 | # libdns.so then it will automatically pull in both bind-libs
|
---|
69 | # and bind-libs-lite (which is incorrect, only bind-libs is needed)
|
---|
70 | %{?filter_setup:
|
---|
71 | %filter_provides_in %{_libdir}/bind9/libdns\.so.*
|
---|
72 | %filter_provides_in %{_libdir}/bind9/libisc\.so.*
|
---|
73 | %filter_provides_in %{_libdir}/bind9/libisccfg\.so.*
|
---|
74 | %filter_from_requires /libdns\.so.*/d
|
---|
75 | %filter_from_requires /libisc\.so.*/d
|
---|
76 | %filter_from_requires /libisccfg\.so.*/d
|
---|
77 | %filter_setup
|
---|
78 | }
|
---|
79 |
|
---|
80 | %description
|
---|
81 | BIND (Berkeley Internet Name Domain) is an implementation of the DNS
|
---|
82 | (Domain Name System) protocols. BIND includes a DNS server (named),
|
---|
83 | which resolves host names to IP addresses; a resolver library
|
---|
84 | (routines for applications to use when interfacing with DNS); and
|
---|
85 | tools for verifying that the DNS server is operating properly.
|
---|
86 |
|
---|
87 | %if %{PKCS11}
|
---|
88 | %package pkcs11
|
---|
89 | Summary: Bind PKCS#11 tools for using DNSSEC
|
---|
90 | Group: System Environment/Daemons
|
---|
91 | Requires: engine_pkcs11 opensc
|
---|
92 | #BuildRequires: opensc-devel
|
---|
93 |
|
---|
94 | %description pkcs11
|
---|
95 | This is a set of PKCS#11 utilities that when used together create rsa
|
---|
96 | keys in a PKCS11 keystore, such as provided by opencryptoki. The keys
|
---|
97 | will have a label of "zone,zsk|ksk,xxx" and an id of the keytag in hex.
|
---|
98 | %endif
|
---|
99 |
|
---|
100 | %if %{SDB}
|
---|
101 | %package sdb
|
---|
102 | Summary: BIND server with database backends and DLZ support
|
---|
103 | Group: System Environment/Daemons
|
---|
104 | Requires: bind
|
---|
105 |
|
---|
106 | %description sdb
|
---|
107 | BIND (Berkeley Internet Name Domain) is an implementation of the DNS
|
---|
108 | (Domain Name System) protocols. BIND includes a DNS server (named-sdb)
|
---|
109 | which has compiled-in SDB (Simplified Database Backend) which includes
|
---|
110 | support for using alternative Zone Databases stored in an LDAP server
|
---|
111 | (ldapdb), a postgreSQL database (pgsqldb), an sqlite database (sqlitedb),
|
---|
112 | or in the filesystem (dirdb), in addition to the standard in-memory RBT
|
---|
113 | (Red Black Tree) zone database. It also includes support for DLZ
|
---|
114 | (Dynamic Loadable Zones)
|
---|
115 | %endif
|
---|
116 |
|
---|
117 | %package libs-lite
|
---|
118 | Summary: Libraries for working with the DNS protocol
|
---|
119 | Group: Applications/System
|
---|
120 | Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7
|
---|
121 | Provides: bind-libbind-devel = 31:9.3.3-4.fc7
|
---|
122 | Requires: bind-license = %{version}-%{release}
|
---|
123 |
|
---|
124 | %description libs-lite
|
---|
125 | Contains lite version of BIND suite libraries which are used by various
|
---|
126 | programs to work with DNS protocol.
|
---|
127 |
|
---|
128 | %package libs
|
---|
129 | Summary: Libraries used by the BIND DNS packages
|
---|
130 | Group: Applications/System
|
---|
131 | Requires: bind-license = %{version}-%{release}
|
---|
132 |
|
---|
133 | %description libs
|
---|
134 | Contains heavyweight version of BIND suite libraries used by both named DNS
|
---|
135 | server and utilities in bind-utils package.
|
---|
136 |
|
---|
137 | %package license
|
---|
138 | Summary: License of the BIND DNS suite
|
---|
139 | Group: Applications/System
|
---|
140 | BuildArch:noarch
|
---|
141 |
|
---|
142 | %description license
|
---|
143 | Contains license of the BIND DNS suite.
|
---|
144 |
|
---|
145 | %package utils
|
---|
146 | Summary: Utilities for querying DNS name servers
|
---|
147 | Group: Applications/System
|
---|
148 |
|
---|
149 | %description utils
|
---|
150 | Bind-utils contains a collection of utilities for querying DNS (Domain
|
---|
151 | Name System) name servers to find out information about Internet
|
---|
152 | hosts. These tools will provide you with the IP addresses for given
|
---|
153 | host names, as well as other information about registered domains and
|
---|
154 | network addresses.
|
---|
155 |
|
---|
156 | You should install bind-utils if you need to get information from DNS name
|
---|
157 | servers.
|
---|
158 |
|
---|
159 | %if %{DEVEL}
|
---|
160 | %package devel
|
---|
161 | Summary: Header files and libraries needed for BIND DNS development
|
---|
162 | Group: Development/Libraries
|
---|
163 | Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7
|
---|
164 | Provides: bind-libbind-devel = 31:9.3.3-4.fc7
|
---|
165 | Requires: bind-libs = %{version}-%{release}
|
---|
166 |
|
---|
167 | %description devel
|
---|
168 | The bind-devel package contains full version of the header files and libraries
|
---|
169 | required for development with ISC BIND 9
|
---|
170 | %endif
|
---|
171 |
|
---|
172 | %package lite-devel
|
---|
173 | Summary: Lite version of header files and libraries needed for BIND DNS development
|
---|
174 | Group: Development/Libraries
|
---|
175 | Requires: bind-libs-lite = %{version}-%{release}
|
---|
176 |
|
---|
177 | %description lite-devel
|
---|
178 | The bind-lite-devel package contains lite version of the header
|
---|
179 | files and libraries required for development with ISC BIND 9
|
---|
180 |
|
---|
181 | %package chroot
|
---|
182 | Summary: A chroot runtime environment for the ISC BIND DNS server, named(8)
|
---|
183 | Group: System Environment/Daemons
|
---|
184 | Prefix: %{chroot_prefix}
|
---|
185 | Requires: bind = %{version}-%{release}
|
---|
186 |
|
---|
187 | %description chroot
|
---|
188 | This package contains a tree of files which can be used as a
|
---|
189 | chroot(2) jail for the named(8) program from the BIND package.
|
---|
190 | Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
|
---|
191 |
|
---|
192 | %prep
|
---|
193 | %setup -q -n %{name}-%{VERSION}
|
---|
194 |
|
---|
195 | # Common patches
|
---|
196 | %patch0 -p1 -b .os2
|
---|
197 | :;
|
---|
198 |
|
---|
199 | %build
|
---|
200 | export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
---|
201 | export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE"
|
---|
202 | export STD_CDEFINES="$CPPFLAGS"
|
---|
203 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
---|
204 | # YD -Zhigh-mem is not compatible with some tcpip libc functions
|
---|
205 | export LDFLAGS="-Zexe -Zomf -Zargs-wild -Zargs-resp"
|
---|
206 | export LIBS="-lurpo -lmmap -lpthread"
|
---|
207 |
|
---|
208 | sed -i -e \
|
---|
209 | 's/RELEASEVER=\(.*\)/RELEASEVER=\1-OS2-%{version}-%{release}/' \
|
---|
210 | version
|
---|
211 |
|
---|
212 | %configure \
|
---|
213 | --with-libtool \
|
---|
214 | --enable-threads \
|
---|
215 | --disable-ipv6 \
|
---|
216 | --with-pic \
|
---|
217 | --disable-static \
|
---|
218 | --disable-openssl-version-check \
|
---|
219 | --with-openssl=%{_prefix} \
|
---|
220 | --enable-exportlib \
|
---|
221 | --with-export-libdir=%{_libdir} \
|
---|
222 | --with-export-includedir=%{_includedir} \
|
---|
223 | --includedir=%{_includedir}/bind9 \
|
---|
224 | %if %{PKCS11}
|
---|
225 | --with-pkcs11=%{_libdir}/pkcs11/PKCS11_API.so \
|
---|
226 | %endif
|
---|
227 | %if %{SDB}
|
---|
228 | --with-dlz-ldap=yes \
|
---|
229 | --with-dlz-postgres=yes \
|
---|
230 | --with-dlz-mysql=yes \
|
---|
231 | --with-dlz-filesystem=yes \
|
---|
232 | %endif
|
---|
233 | %if %{GSSTSIG}
|
---|
234 | --with-gssapi=yes \
|
---|
235 | --disable-isc-spnego \
|
---|
236 | %endif
|
---|
237 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
---|
238 |
|
---|
239 | make %{?_smp_mflags}
|
---|
240 |
|
---|
241 | %if %{test}
|
---|
242 | %check
|
---|
243 | if [ "`whoami`" = 'root' ]; then
|
---|
244 | set -e
|
---|
245 | chmod -R a+rwX .
|
---|
246 | pushd bin/tests
|
---|
247 | pushd system
|
---|
248 | ./ifconfig.sh up
|
---|
249 | popd
|
---|
250 | make test
|
---|
251 | e=$?
|
---|
252 | pushd system
|
---|
253 | ./ifconfig.sh down
|
---|
254 | popd
|
---|
255 | popd
|
---|
256 | if [ "$e" -ne 0 ]; then
|
---|
257 | echo "ERROR: this build of BIND failed 'make test'. Aborting."
|
---|
258 | exit $e;
|
---|
259 | fi;
|
---|
260 | else
|
---|
261 | echo 'only root can run the tests (they require an ifconfig).'
|
---|
262 | %endif
|
---|
263 |
|
---|
264 | %install
|
---|
265 | rm -rf ${RPM_BUILD_ROOT}
|
---|
266 | make DESTDIR=${RPM_BUILD_ROOT} install
|
---|
267 |
|
---|
268 | install -m 755 lib/bind9/bind9.dll $RPM_BUILD_ROOT/%{_libdir}
|
---|
269 |
|
---|
270 | gzip -9 doc/rfc/*
|
---|
271 |
|
---|
272 | # Build directory hierarchy
|
---|
273 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
|
---|
274 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
|
---|
275 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/NetworkManager/dispatcher.d
|
---|
276 | mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bind
|
---|
277 | mkdir -p ${RPM_BUILD_ROOT}%{_var}/named/slaves
|
---|
278 | mkdir -p ${RPM_BUILD_ROOT}%{_var}/named/data
|
---|
279 | mkdir -p ${RPM_BUILD_ROOT}%{_var}/named/dynamic
|
---|
280 | mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
|
---|
281 | mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
|
---|
282 | mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
|
---|
283 | mkdir -p ${RPM_BUILD_ROOT}%{_var}/run/named
|
---|
284 | mkdir -p ${RPM_BUILD_ROOT}%{_var}/log
|
---|
285 |
|
---|
286 | #chroot
|
---|
287 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev
|
---|
288 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc
|
---|
289 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/var
|
---|
290 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/var/log
|
---|
291 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/var/named
|
---|
292 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/var/run/named
|
---|
293 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/var/tmp
|
---|
294 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/pki/dnssec-keys
|
---|
295 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/named
|
---|
296 | mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}/%{_libdir}/bind
|
---|
297 | # these are required to prevent them being erased during upgrade of previous
|
---|
298 | # versions that included them (bug #130121):
|
---|
299 | touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/null
|
---|
300 | touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/random
|
---|
301 | touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/zero
|
---|
302 | touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/localtime
|
---|
303 |
|
---|
304 | touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/named.conf
|
---|
305 | #end chroot
|
---|
306 |
|
---|
307 | # Remove unwanted files
|
---|
308 | rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/bind.keys
|
---|
309 |
|
---|
310 | #install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/named
|
---|
311 | #install -m 644 %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/named
|
---|
312 | #install -m 755 %SOURCE4 ${RPM_BUILD_ROOT}%{_sysconfdir}/NetworkManager/dispatcher.d/13-named
|
---|
313 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
---|
314 | #install -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/named
|
---|
315 | %if %{SDB}
|
---|
316 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/openldap/schema
|
---|
317 | install -m 644 %{SOURCE8} ${RPM_BUILD_ROOT}%{_sysconfdir}/openldap/schema/dnszone.schema
|
---|
318 | install -m 644 %{SOURCE12} contrib/sdb/pgsql/
|
---|
319 | %endif
|
---|
320 |
|
---|
321 | # Files required to run test-suite outside of build tree:
|
---|
322 | cp -fp config.h ${RPM_BUILD_ROOT}/%{_includedir}/bind9
|
---|
323 | cp -fp lib/dns/include/dns/forward.h ${RPM_BUILD_ROOT}/%{_includedir}/dns
|
---|
324 | cp -fp lib/isc/unix/include/isc/keyboard.h ${RPM_BUILD_ROOT}/%{_includedir}/isc
|
---|
325 |
|
---|
326 | # Remove libtool .la files:
|
---|
327 | rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la
|
---|
328 |
|
---|
329 | # Remove -devel files out of buildroot if not needed
|
---|
330 | %if !%{DEVEL}
|
---|
331 | rm -f ${RPM_BUILD_ROOT}/%{_libdir}/bind9/*so
|
---|
332 | rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/bind9
|
---|
333 | rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man1/isc-config.sh.1*
|
---|
334 | rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man3/lwres*
|
---|
335 | rm -f ${RPM_BUILD_ROOT}/%{_bindir}/isc-config.sh
|
---|
336 | %endif
|
---|
337 |
|
---|
338 | # SDB manpages
|
---|
339 | %if %{SDB}
|
---|
340 | install -m 644 %{SOURCE31} ${RPM_BUILD_ROOT}%{_mandir}/man1/ldap2zone.1
|
---|
341 | install -m 644 %{SOURCE32} ${RPM_BUILD_ROOT}%{_mandir}/man8/named-sdb.8
|
---|
342 | install -m 644 %{SOURCE33} ${RPM_BUILD_ROOT}%{_mandir}/man1/zonetodb.1
|
---|
343 | install -m 644 %{SOURCE34} ${RPM_BUILD_ROOT}%{_mandir}/man1/zone2sqlite.1
|
---|
344 | %endif
|
---|
345 |
|
---|
346 | # Ghost config files:
|
---|
347 | touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/named.log
|
---|
348 |
|
---|
349 | # configuration files:
|
---|
350 | tar -xjf %{SOURCE28}
|
---|
351 | cp -r etc ${RPM_BUILD_ROOT}/@unixroot
|
---|
352 | cp -r var ${RPM_BUILD_ROOT}/@unixroot
|
---|
353 | touch ${RPM_BUILD_ROOT}%{_sysconfdir}/rndc.key
|
---|
354 | touch ${RPM_BUILD_ROOT}%{_sysconfdir}/rndc.conf
|
---|
355 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/named
|
---|
356 |
|
---|
357 | install -m 644 bind.keys ${RPM_BUILD_ROOT}%{_sysconfdir}/named.iscdlv.key
|
---|
358 | install -m 644 %{SOURCE36} ${RPM_BUILD_ROOT}%{_sysconfdir}/trusted-key.key
|
---|
359 |
|
---|
360 | # sample bind configuration files for %%doc:
|
---|
361 | mkdir -p sample%{_sysconfdir} sample%{_var}/named/data
|
---|
362 | mkdir -p sample%{_sysconfdir} sample%{_var}/named/slaves
|
---|
363 | install -m 644 %{SOURCE25} sample%{_sysconfdir}/named.conf
|
---|
364 | # Copy default configuration to %%doc to make it usable from system-config-bind
|
---|
365 | install -m 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/named.conf named.conf.default
|
---|
366 | install -m 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/named.rfc1912.zones sample%{_sysconfdir}/named.rfc1912.zones
|
---|
367 | install -m 644 ${RPM_BUILD_ROOT}%{_var}/named/named.ca sample%{_var}/named
|
---|
368 | install -m 644 ${RPM_BUILD_ROOT}%{_var}/named/named.localhost sample%{_var}/named
|
---|
369 | install -m 644 ${RPM_BUILD_ROOT}%{_var}/named/named.loopback sample%{_var}/named
|
---|
370 | install -m 644 ${RPM_BUILD_ROOT}%{_var}/named/named.empty sample%{_var}/named
|
---|
371 | for f in my.internal.zone.db slaves/my.slave.internal.zone.db slaves/my.ddns.internal.zone.db my.external.zone.db; do
|
---|
372 | echo '@ in soa localhost. root 1 3H 15M 1W 1D
|
---|
373 | ns localhost.' > sample%{_var}/named/$f;
|
---|
374 | done
|
---|
375 | :;
|
---|
376 |
|
---|
377 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/tmpfiles.d
|
---|
378 | install -m 644 %{SOURCE35} ${RPM_BUILD_ROOT}%{_sysconfdir}/tmpfiles.d/named.conf
|
---|
379 |
|
---|
380 | %pre
|
---|
381 | if [ "$1" -eq 1 ]; then
|
---|
382 | /usr/sbin/groupadd -g %{bind_gid} -f -r named >/dev/null 2>&1 || :;
|
---|
383 | /usr/sbin/useradd -u %{bind_uid} -r -N -M -g named -s /sbin/nologin -d /var/named -c Named named >/dev/null 2>&1 || :;
|
---|
384 | fi;
|
---|
385 | :;
|
---|
386 |
|
---|
387 | %post
|
---|
388 | #/sbin/ldconfig
|
---|
389 | #/sbin/chkconfig --add named
|
---|
390 | if [ "$1" -eq 1 ]; then
|
---|
391 | if [ ! -e %{_sysconfdir}/rndc.key ]; then
|
---|
392 | /usr/sbin/rndc-confgen -a > /dev/null 2>&1
|
---|
393 | fi
|
---|
394 | [ -x /sbin/restorecon ] && /sbin/restorecon %{_sysconfdir}/rndc.* %{_sysconfdir}/named.* >/dev/null 2>&1 ;
|
---|
395 | # rndc.key has to have correct perms and ownership, CVE-2007-6283
|
---|
396 | [ -e %{_sysconfdir}/rndc.key ] && chown root:named %{_sysconfdir}/rndc.key
|
---|
397 | [ -e %{_sysconfdir}/rndc.key ] && chmod 0640 %{_sysconfdir}/rndc.key
|
---|
398 | fi
|
---|
399 | :;
|
---|
400 |
|
---|
401 | %preun
|
---|
402 | #if [ "$1" -eq 0 ]; then
|
---|
403 | # /sbin/service named stop >/dev/null 2>&1 || :;
|
---|
404 | # /sbin/chkconfig --del named || :;
|
---|
405 | #fi;
|
---|
406 | :;
|
---|
407 |
|
---|
408 | %postun
|
---|
409 | #/sbin/ldconfig
|
---|
410 | #if [ "$1" -ge 1 ]; then
|
---|
411 | # /sbin/service named try-restart >/dev/null 2>&1 || :;
|
---|
412 | #fi;
|
---|
413 | :;
|
---|
414 |
|
---|
415 | %if %{SDB}
|
---|
416 | %post sdb
|
---|
417 | /sbin/service named try-restart > /dev/null 2>&1 || :;
|
---|
418 |
|
---|
419 | %postun sdb
|
---|
420 | /sbin/service named try-restart > /dev/null 2>&1 || :;
|
---|
421 | %endif
|
---|
422 |
|
---|
423 | %triggerpostun -n bind -- bind <= 32:9.5.0-20.b1
|
---|
424 | if [ "$1" -gt 0 ]; then
|
---|
425 | [ -e %{_sysconfdir}/rndc.key ] && chown root:named %{_sysconfdir}/rndc.key
|
---|
426 | [ -e %{_sysconfdir}/rndc.key ] && chmod 0640 %{_sysconfdir}/rndc.key
|
---|
427 | fi
|
---|
428 | :;
|
---|
429 |
|
---|
430 |
|
---|
431 | # Automatically update configuration from "dnssec-conf-based" to "BIND-based"
|
---|
432 | %triggerpostun -n bind -- dnssec-conf
|
---|
433 | if [ -r '%{_sysconfdir}/named.conf' ]; then
|
---|
434 | cp -fp %{_sysconfdir}/named.conf %{_sysconfdir}/named.conf.rpmsave
|
---|
435 | if grep -Eq '%{_sysconfdir}/(named.dnssec.keys|pki/dnssec-keys)' %{_sysconfdir}/named.conf; then
|
---|
436 | if grep -q 'dlv.isc.org.conf' %{_sysconfdir}/named.conf; then
|
---|
437 | # DLV is configured, reconfigure it to new configuration
|
---|
438 | sed -i -e 's/.*dnssec-lookaside.*dlv\.isc\.org\..*/dnssec-lookaside auto;\
|
---|
439 | bindkeys-file "\%{_sysconfdir}\/named.iscdlv.key";\
|
---|
440 | managed-keys-directory "\/var\/named\/dynamic";/' %{_sysconfdir}/named.conf
|
---|
441 | fi
|
---|
442 | sed -i -e '/.*named\.dnssec\.keys.*/d' -e '/.*pki\/dnssec-keys.*/d' \
|
---|
443 | %{_sysconfdir}/named.conf
|
---|
444 | /sbin/service named try-restart > /dev/null 2>&1 || :;
|
---|
445 | fi
|
---|
446 | fi
|
---|
447 |
|
---|
448 | # Ditto for chroot
|
---|
449 | if [ -r '/var/named/chroot%{_sysconfdir}/named.conf' ]; then
|
---|
450 | cp -fp /var/named/chroot%{_sysconfdir}/named.conf /var/named/chroot%{_sysconfdir}/named.conf.rpmsave
|
---|
451 | if grep -Eq '%{_sysconfdir}/(named.dnssec.keys|pki/dnssec-keys)' /var/named/chroot%{_sysconfdir}/named.conf; then
|
---|
452 | if grep -q 'dlv.isc.org.conf' /var/named/chroot%{_sysconfdir}/named.conf; then
|
---|
453 | # DLV is configured, reconfigure it to new configuration
|
---|
454 | sed -i -e 's/.*dnssec-lookaside.*dlv\.isc\.org\..*/dnssec-lookaside auto;\
|
---|
455 | bindkeys-file "\/etc\/named.iscdlv.key";\
|
---|
456 | managed-keys-directory "\/var\/named\/dynamic";/' /var/named/chroot/etc/named.conf
|
---|
457 | fi
|
---|
458 | sed -i -e '/.*named\.dnssec\.keys.*/d' -e '/.*pki\/dnssec-keys.*/d' \
|
---|
459 | /var/named/chroot/etc/named.conf
|
---|
460 | /sbin/service named try-restart > /dev/null 2>&1 || :;
|
---|
461 | fi
|
---|
462 | fi
|
---|
463 |
|
---|
464 | %post chroot
|
---|
465 | if [ "$1" -gt 0 ]; then
|
---|
466 | [ -e %{chroot_prefix}/dev/random ] || \
|
---|
467 | /bin/mknod %{chroot_prefix}/dev/random c 1 8
|
---|
468 | [ -e %{chroot_prefix}/dev/zero ] || \
|
---|
469 | /bin/mknod %{chroot_prefix}/dev/zero c 1 5
|
---|
470 | [ -e %{chroot_prefix}/dev/zero ] || \
|
---|
471 | /bin/mknod %{chroot_prefix}/dev/null c 1 3
|
---|
472 | rm -f %{chroot_prefix}/etc/localtime
|
---|
473 | cp /etc/localtime %{chroot_prefix}/etc/localtime
|
---|
474 | if ! grep -q '^ROOTDIR=' /etc/sysconfig/named; then
|
---|
475 | echo 'ROOTDIR=/var/named/chroot' >> /etc/sysconfig/named
|
---|
476 | /sbin/service named try-restart > /dev/null 2>&1 || :;
|
---|
477 | fi
|
---|
478 | fi;
|
---|
479 | :;
|
---|
480 |
|
---|
481 | %posttrans chroot
|
---|
482 | if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
|
---|
483 | [ -x /sbin/restorecon ] && /sbin/restorecon %{chroot_prefix}/dev/* > /dev/null 2>&1;
|
---|
484 | fi;
|
---|
485 | :;
|
---|
486 |
|
---|
487 | %preun chroot
|
---|
488 | if [ "$1" -eq 0 ]; then
|
---|
489 | rm -f %{chroot_prefix}/dev/{random,zero,null}
|
---|
490 | rm -f %{chroot_prefix}/etc/localtime
|
---|
491 | if grep -q '^ROOTDIR=' /etc/sysconfig/named; then
|
---|
492 | # NOTE: Do NOT call `service named try-restart` because chroot
|
---|
493 | # files will remain mounted.
|
---|
494 | START=no
|
---|
495 | [ -e /var/lock/subsys/named ] && START=yes
|
---|
496 | /sbin/service named stop > /dev/null 2>&1 || :;
|
---|
497 | sed -i -e '/^ROOTDIR=.*/d' /etc/sysconfig/named
|
---|
498 | if [ "x$START" = xyes ]; then
|
---|
499 | /sbin/service named start > /dev/null 2>&1 || :;
|
---|
500 | fi
|
---|
501 | fi
|
---|
502 | fi
|
---|
503 | :;
|
---|
504 |
|
---|
505 | %clean
|
---|
506 | rm -rf ${RPM_BUILD_ROOT}
|
---|
507 | :;
|
---|
508 |
|
---|
509 | %files
|
---|
510 | %defattr(-,root,root,-)
|
---|
511 | %{_libdir}/bind
|
---|
512 | #%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/named
|
---|
513 | %config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.iscdlv.key
|
---|
514 | %config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.root.key
|
---|
515 | %{_sysconfdir}/tmpfiles.d/named.conf
|
---|
516 | #%{_sysconfdir}/rc.d/init.d/named
|
---|
517 | #%{_sysconfdir}/NetworkManager/dispatcher.d/13-named
|
---|
518 | %{_sbindir}/arpaname.exe
|
---|
519 | %{_sbindir}/ddns-confgen.exe
|
---|
520 | %{_sbindir}/genrandom.exe
|
---|
521 | %{_sbindir}/named-journalprint.exe
|
---|
522 | %{_sbindir}/nsec3hash.exe
|
---|
523 | %{_sbindir}/dnssec*.exe
|
---|
524 | %{_sbindir}/named-check*.exe
|
---|
525 | %{_sbindir}/lwresd.exe
|
---|
526 | %{_sbindir}/named.exe
|
---|
527 | %{_sbindir}/rndc*.exe
|
---|
528 | %{_sbindir}/named-compilezone.exe
|
---|
529 | %{_sbindir}/isc-hmac-fixup.exe
|
---|
530 | %{_mandir}/man1/arpaname.1*
|
---|
531 | %{_mandir}/man5/named.conf.5*
|
---|
532 | %{_mandir}/man5/rndc.conf.5*
|
---|
533 | %{_mandir}/man8/rndc.8*
|
---|
534 | %{_mandir}/man8/named.8*
|
---|
535 | %{_mandir}/man8/lwresd.8*
|
---|
536 | %{_mandir}/man8/dnssec*.8*
|
---|
537 | %{_mandir}/man8/named-checkconf.8*
|
---|
538 | %{_mandir}/man8/named-checkzone.8*
|
---|
539 | %{_mandir}/man8/named-compilezone.8*
|
---|
540 | %{_mandir}/man8/rndc-confgen.8*
|
---|
541 | %{_mandir}/man8/ddns-confgen.8*
|
---|
542 | %{_mandir}/man8/genrandom.8*
|
---|
543 | %{_mandir}/man8/named-journalprint.8*
|
---|
544 | %{_mandir}/man8/nsec3hash.8*
|
---|
545 | %{_mandir}/man8/isc-hmac-fixup.8*
|
---|
546 | %doc CHANGES README named.conf.default
|
---|
547 | %doc doc/arm doc/misc doc/draft doc/rfc
|
---|
548 | %doc sample/
|
---|
549 |
|
---|
550 | # Hide configuration
|
---|
551 | %defattr(0640,root,named,0750)
|
---|
552 | %dir %{_sysconfdir}/named
|
---|
553 | %dir %{_localstatedir}/named
|
---|
554 | %config(noreplace) %verify(not link) %{_sysconfdir}/named.conf
|
---|
555 | %config(noreplace) %verify(not link) %{_sysconfdir}/named.rfc1912.zones
|
---|
556 | %config %verify(not link) %{_localstatedir}/named/named.ca
|
---|
557 | %config %verify(not link) %{_localstatedir}/named/named.localhost
|
---|
558 | %config %verify(not link) %{_localstatedir}/named/named.loopback
|
---|
559 | %config %verify(not link) %{_localstatedir}/named/named.empty
|
---|
560 | %defattr(0660,named,named,0770)
|
---|
561 | %dir %{_localstatedir}/named/slaves
|
---|
562 | %dir %{_localstatedir}/named/data
|
---|
563 | %dir %{_localstatedir}/named/dynamic
|
---|
564 | %ghost %{_localstatedir}/log/named.log
|
---|
565 | %defattr(0640,root,named,0750)
|
---|
566 | %ghost %config(noreplace) %{_sysconfdir}/rndc.key
|
---|
567 | # ^- rndc.key now created on first install only if it does not exist
|
---|
568 | # %verify(not size,not md5) %config(noreplace) %attr(0640,root,named) /etc/rndc.conf
|
---|
569 | # ^- Let the named internal default rndc.conf be used -
|
---|
570 | # rndc.conf not required unless it differs from default.
|
---|
571 | %ghost %config(noreplace) %{_sysconfdir}/rndc.conf
|
---|
572 | # ^- The default rndc.conf which uses rndc.key is in named's default internal config -
|
---|
573 | # so rndc.conf is not necessary.
|
---|
574 | #%config(noreplace) %{_sysconfdir}/logrotate.d/named
|
---|
575 | %defattr(-,named,named,-)
|
---|
576 | %dir %{_localstatedir}/run/named
|
---|
577 |
|
---|
578 | %if %{SDB}
|
---|
579 | %files sdb
|
---|
580 | %defattr(-,root,root,-)
|
---|
581 | %{_mandir}/man1/zone2ldap.1*
|
---|
582 | %{_mandir}/man1/ldap2zone.1*
|
---|
583 | %{_mandir}/man1/zonetodb.1*
|
---|
584 | %{_mandir}/man1/zone2sqlite.1*
|
---|
585 | %{_mandir}/man8/named-sdb.8*
|
---|
586 | %doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap contrib/sdb/pgsql/README.sdb_pgsql
|
---|
587 | %dir %{_sysconfdir}/openldap/schema
|
---|
588 | %config(noreplace) %{_sysconfdir}/openldap/schema/dnszone.schema
|
---|
589 | %{_sbindir}/named-sdb
|
---|
590 | %{_sbindir}/zone2ldap
|
---|
591 | %{_sbindir}/ldap2zone
|
---|
592 | %{_sbindir}/zonetodb
|
---|
593 | %{_sbindir}/zone2sqlite
|
---|
594 | %endif
|
---|
595 |
|
---|
596 | %files libs
|
---|
597 | %defattr(-,root,root,-)
|
---|
598 | %{_libdir}/*.dll
|
---|
599 |
|
---|
600 | %files libs-lite
|
---|
601 | %defattr(-,root,root,-)
|
---|
602 | #%{_libdir}/*export.a
|
---|
603 |
|
---|
604 | %files license
|
---|
605 | %defattr(-,root,root,-)
|
---|
606 | %doc COPYRIGHT
|
---|
607 |
|
---|
608 | %files utils
|
---|
609 | %defattr(-,root,root,-)
|
---|
610 | %{_bindir}/dig.exe
|
---|
611 | %{_bindir}/host.exe
|
---|
612 | %{_bindir}/nslookup.exe
|
---|
613 | %{_bindir}/nsupdate.exe
|
---|
614 | %{_mandir}/man1/host.1*
|
---|
615 | %{_mandir}/man1/nsupdate.1*
|
---|
616 | %{_mandir}/man1/dig.1*
|
---|
617 | %{_mandir}/man1/nslookup.1*
|
---|
618 | %{_sysconfdir}/trusted-key.key
|
---|
619 |
|
---|
620 | %if %{DEVEL}
|
---|
621 | %files devel
|
---|
622 | %defattr(-,root,root,-)
|
---|
623 | %{_libdir}/*.a
|
---|
624 | #%exclude %{_libdir}/*export.so
|
---|
625 | %{_includedir}/bind9
|
---|
626 | %{_mandir}/man1/isc-config.sh.1*
|
---|
627 | %{_mandir}/man3/lwres*
|
---|
628 | %{_bindir}/isc-config.sh
|
---|
629 | %endif
|
---|
630 |
|
---|
631 | %files lite-devel
|
---|
632 | %defattr(-,root,root,-)
|
---|
633 | #%{_libdir}/*export.a
|
---|
634 | %{_includedir}/dns
|
---|
635 | %{_includedir}/dst
|
---|
636 | %{_includedir}/irs
|
---|
637 | %{_includedir}/isc
|
---|
638 | %{_includedir}/isccfg
|
---|
639 |
|
---|
640 | %files chroot
|
---|
641 | %defattr(-,root,root,-)
|
---|
642 | %ghost %{chroot_prefix}/dev/null
|
---|
643 | %ghost %{chroot_prefix}/dev/random
|
---|
644 | %ghost %{chroot_prefix}/dev/zero
|
---|
645 | %ghost %{chroot_prefix}/etc/localtime
|
---|
646 | %defattr(0640,root,named,0750)
|
---|
647 | %dir %{chroot_prefix}
|
---|
648 | %dir %{chroot_prefix}/dev
|
---|
649 | %dir %{chroot_prefix}/etc
|
---|
650 | %dir %{chroot_prefix}/etc/named
|
---|
651 | %dir %{chroot_prefix}/etc/pki/dnssec-keys
|
---|
652 | %dir %{chroot_prefix}/var
|
---|
653 | %dir %{chroot_prefix}/var/run
|
---|
654 | %dir %{chroot_prefix}/var/named
|
---|
655 | %dir %{chroot_prefix}/%{_libdir}/bind
|
---|
656 | %ghost %config(noreplace) %{chroot_prefix}/etc/named.conf
|
---|
657 | %defattr(0660,named,named,0770)
|
---|
658 | %dir %{chroot_prefix}/var/run/named
|
---|
659 | %dir %{chroot_prefix}/var/tmp
|
---|
660 | %dir %{chroot_prefix}/var/log
|
---|
661 |
|
---|
662 | %if %{PKCS11}
|
---|
663 | %files pkcs11
|
---|
664 | %defattr(-,root,root,-)
|
---|
665 | %doc COPYRIGHT
|
---|
666 | %{_sbindir}/pkcs11-destroy
|
---|
667 | %{_sbindir}/pkcs11-keygen
|
---|
668 | %{_sbindir}/pkcs11-list
|
---|
669 | %{_mandir}/man8/pkcs11*
|
---|
670 | %endif
|
---|
671 |
|
---|
672 | %changelog
|
---|
673 | * Mon Jan 30 2012 yd
|
---|
674 | - multiprocessor support.
|
---|
675 | - thread support.
|
---|
676 | - initial unixroot build.
|
---|