]> git.ipfire.org Git - ipfire-3.x.git/blame - bind/bind.nm
named: Create tmpfiles in package.
[ipfire-3.x.git] / bind / bind.nm
CommitLineData
d918082a 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
d918082a
MT
4###############################################################################
5
802ea3af 6name = bind
ac29baf9 7version = 9.8.1
26d6a9af 8release = 3
d918082a 9
802ea3af
MT
10groups = Networking/Tools
11url = http://www.isc.org/products/BIND/
12license = Proprietary
13summary = BIND provides tools for the DNS.
d918082a 14
802ea3af
MT
15description
16 BIND (Berkeley Internet Name Domain or named) is the most commonly used
d918082a 17 DNS server on the Internet, especially on Unix-like systems.
802ea3af 18end
d918082a 19
802ea3af 20source_dl = ftp://ftp.isc.org/isc/bind/%{version}/
d918082a 21
ac29baf9
SS
22sources = \
23 bind-9.8.1.tar.gz \
24 bind-config-8.tar.bz2
25
26# Apply patches in a special order.
27patches = \
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
802ea3af
MT
54build
55 requires
ac29baf9
SS
56 autoconf
57 automake
58 chrpath
802ea3af 59 db4-devel
ac29baf9
SS
60 libtool
61 libcap-devel
62 libidn-devel
63 pkg-config
802ea3af 64 openssl-devel
26d6a9af 65 shadow-utils
802ea3af 66 end
e698b321 67
ac29baf9
SS
68 configure_options += \
69 --with-libtool \
70 --sysconfdir=/etc \
71 --localstatedir=/var \
72 --enable-threads \
73 --enable-ipv6 \
74 --with-pic \
75 --disable-static \
76 --disable-openssl-version-check \
77 --enable-exportlib \
78 --with-export-libdir=/lib/ \
79 --with-export-includedir=/usr/include/ \
80 --includedir=/usr/include/bind9/ \
81 --with-pkcs11=/usr/lib/pkcs11/PKCS11_API.so \
82 --with-gssapi=yes \
83 --disable-isc-spnego
84
85 prepare
86 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
87
88 # Create m4 directory.
89 cd %{DIR_APP} && mkdir -pv m4
d918082a 90
ac29baf9
SS
91 # Apply all patches.
92 %{MACRO_PATCHES}
93
94 # Branding.
95 sed -i -e 's/RELEASEVER=\(.*\)/RELEASEVER=\1-%{DISTRO_NAME}-%{version}-%{release}/' version
96
97 # Regenerate build environment
98 libtoolize -c -f
99 aclocal -I m4 --force
100 autoconf -f
26d6a9af
SS
101
102 # Create user and group for /run directory.
103 %{create_user}
802ea3af
MT
104 end
105
106 install
ac29baf9
SS
107 # Compress doc files.
108 gzip -9 doc/rfc/*
109
110 # Create directory layout.
111 mkdir -pv %{BUILDROOT}/usr/lib/bind
112 mkdir -pv %{BUILDROOT}/var/named/{slaves,data,dynamic}
113 mkdir -pv %{BUILDROOT}/usr/share/man/{man1,man5,man8}
114 mkdir -pv %{BUILDROOT}/run/named
115 mkdir -pv %{BUILDROOT}/var/log
116
117 # Create named chroot environment.
118 mkdir -pv %{BUILDROOT}/var/named/chroot/{dev,etc,var}
119 mkdir -pv %{BUILDROOT}/var/named/chroot/var/{log,named,run/named,tmp}
120 mkdir -pv %{BUILDROOT}/var/named/chroot/etc/{pki/dnssec-keys,named}
121 mkdir -pv %{BUILDROOT}/var/named/chroot/usr/lib/bind
122 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/null
123 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/random
124 mkdir -pv %{BUILDROOT}/var/named/chroot/dev/zero
125 mkdir -pv %{BUILDROOT}/var/named/chroot/etc/localtime
126
127 touch %{BUILDROOT}/var/named/chroot/etc/named.conf
128
129 # Run make install
130 make DESTDIR=%{BUILDROOT} install
131
132 # Remove RPATH from libraries.
133 chrpath --delete %{BUILDROOT}/lib*/*export*.so.*
134
135 # Remove unwanted files
136 rm -rvf %{BUILDROOT}/etc/bind.keys
137
138 # Create ghost config files
139 touch %{BUILDROOT}/var/log/named.log
140
141 # Configuration files
142 tar -C %{BUILDROOT} -xaf %{DIR_DL}/bind-config-8.tar.bz2
143 touch %{BUILDROOT}/etc/rndc.key
144 touch %{BUILDROOT}/etc/rndc.conf
145
146 mkdir %{BUILDROOT}/etc/named
147 install -m 644 bind.keys %{BUILDROOT}/etc/named.iscdlv.key
148 install -m 644 %{DIR_SOURCE}/trusted-key.key %{BUILDROOT}/etc/trusted-key.key
149
150 # Recreate symlinks for export libraries
151 rm -rf %{BUILDROOT}/lib/lib*-export.so
152
153 ln -svf ../../lib/libdns-export.so.81 %{BUILDROOT}/usr/lib/libdns-export.so
154 ln -svf ../../lib/libirs-export.so.80 %{BUILDROOT}/usr/lib/libirs-export.so
155 ln -svf ../../lib/libisccfg-export.so.82 %{BUILDROOT}/usr/lib/libisccfg-export.so
156 ln -svf ../../lib/libisc-export.so.83 %{BUILDROOT}/usr/lib/libisc-export.so
26d6a9af
SS
157
158 # Create /run/named.
159 mkdir -pv %{BUILDROOT}/run/named
160 chown -Rv named.named %{BUILDROOT}/run/named/
802ea3af
MT
161 end
162end
163
26d6a9af
SS
164create_user
165 getent group named >/dev/null || /usr/sbin/groupadd -r named
166 getent passwd named >/dev/null || /usr/sbin/useradd -r -g named \
167 -d /var/named -c "User for bind DNS server" -s /sbin/nologin named
168end
169
802ea3af 170packages
ac29baf9
SS
171 package %{name}
172 requires
173 bind-utils
174 bind-chroot
175 end
176
177 prerequires += shadow-utils
178
179 script prein
26d6a9af 180 %{create_user}
ac29baf9
SS
181 end
182
183 # XXX Add systemd scriptlet if a service file becomes available
184 end
185
802ea3af 186 package %{name}-utils
ac29baf9
SS
187 summary = Utilities for querying bind DNS name server.
188 description = %{summary}
189
190 files
191 /usr/bin/dig
192 /usr/bin/host
193 /usr/bin/nslookup
194 /usr/bin/nsupdate
195 /usr/share/man/man1/dig.1*
196 /usr/share/man/man1/host.1*
197 /usr/share/man/man1/nslookup.1*
198 /usr/share/man/man1/nsupdate.1*
199 end
200 end
201
202 package %{name}-chroot
203 summary = Chroot environment for bind DNS servers.
204 description = %{summary}
205
206 files
207 /var/named/chroot
208 end
209 end
210
211 package %{name}-libs
212 template LIBS
213 end
214
215 package %{name}-devel
216 template DEVEL
802ea3af
MT
217 end
218end