1 |
%define _catdir /var/cache/man |
2 |
|
3 |
%define major_version 4.3.3 |
4 |
%define patch_version P1 |
5 |
|
6 |
Name: dhcp |
7 |
Epoch: 3 |
8 |
Version: %{major_version}%{patch_version} |
9 |
Release: %mkrel 1 |
10 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client |
11 |
License: Distributable |
12 |
Group: System/Servers |
13 |
URL: http://www.isc.org/software/dhcp |
14 |
Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz |
15 |
Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz.sha512.asc |
16 |
Source2: dhcpd.conf |
17 |
Source3: dhcpd6.conf |
18 |
Source4: dhcp-dynamic-dns-examples.tar.bz2 |
19 |
Source7: dhcpreport.pl |
20 |
Source8: dhcpd-chroot.sh |
21 |
# (eugeni) dhclient-exit-hooks script |
22 |
Source9: dhclient-exit-hooks |
23 |
Source11: dhclient-hook-static-routes |
24 |
Source10: draft-ietf-dhc-ldap-schema-01.txt |
25 |
Source12: dhcpd.service |
26 |
Source14: dhcpd6.service |
27 |
Source16: dhcrelay.service |
28 |
Source17: dhcpd.tmpfiles |
29 |
Source18: dhclient.tmpfiles |
30 |
Source19: dhcrelay.tmpfiles |
31 |
# mageia patches |
32 |
Patch100: dhcp-4.2.2-ifup.patch |
33 |
Patch101: dhcp-4.2.2-fix-format-errors.patch |
34 |
# prevents needless deassociation, working around mdv bug #43441 |
35 |
Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch |
36 |
Patch103: dhcp-4.2.5-P1-man.patch |
37 |
# fedora patches |
38 |
Patch7: dhcp-4.2.0-default-requested-options.patch |
39 |
Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch |
40 |
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch |
41 |
Patch18: dhcp-4.3.0-64_bit_lease_parse.patch |
42 |
BuildRequires: groff-for-man |
43 |
BuildRequires: openldap-devel |
44 |
Requires(post): rpm-helper >= 0.24.8-1 |
45 |
Requires(preun): rpm-helper >= 0.24.8-1 |
46 |
|
47 |
%description |
48 |
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
49 |
individual devices on an IP network to get their own network configuration |
50 |
information (IP address, subnetmask, broadcast address, etc.) from a DHCP |
51 |
server. The overall purpose of DHCP is to make it easier to administer a |
52 |
large network. The dhcp package includes the DHCP server and a DHCP relay |
53 |
agent. You will also need to install the dhcp-client or dhcpcd package, |
54 |
or pump or dhcpxd, which provides the DHCP client daemon, on client machines. |
55 |
|
56 |
If you want the DHCP server and/or relay, you will also need to install the |
57 |
dhcp-server and/or dhcp-relay packages. |
58 |
|
59 |
%package common |
60 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server |
61 |
Group: System/Servers |
62 |
|
63 |
%description common |
64 |
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
65 |
individual devices on an IP network to get their own network |
66 |
configuration information (IP address, subnetmask, broadcast address, |
67 |
etc.) from a DHCP server. The overall purpose of DHCP is to make it |
68 |
easier to administer a large network. The dhcp package includes the |
69 |
DHCP server and a DHCP relay agent. |
70 |
|
71 |
You will also need to install the dhcp-client or dhcpcd package, or pump or |
72 |
dhcpxd, which provides the DHCP client daemon, on client machines. If you |
73 |
want the DHCP server and/or relay, you will also need to install the |
74 |
dhcp-server and/or dhcp-relay packages. |
75 |
|
76 |
%package doc |
77 |
Summary: Documentation about the ISC DHCP server/client |
78 |
Group: System/Servers |
79 |
|
80 |
%description doc |
81 |
This package contains RFC/API/protocol documentation about the ISC |
82 |
DHCP server and client. |
83 |
|
84 |
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
85 |
individual devices on an IP network to get their own network |
86 |
configuration information (IP address, subnetmask, broadcast address, |
87 |
etc.) from a DHCP server. The overall purpose of DHCP is to make it |
88 |
easier to administer a large network. The dhcp package includes the |
89 |
DHCP server and a DHCP relay agent. |
90 |
|
91 |
%package server |
92 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server |
93 |
Group: System/Servers |
94 |
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
95 |
Requires(post): systemd >= %{systemd_required_version} |
96 |
Requires(post): rpm-helper >= 0.24.8-1 |
97 |
Requires(preun): rpm-helper >= 0.24.8-1 |
98 |
|
99 |
%description server |
100 |
DHCP server is the Internet Software Consortium (ISC) DHCP server for various |
101 |
UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from |
102 |
the network. |
103 |
|
104 |
You should install dhcp-server if you want to set up a DHCP server on your |
105 |
network. You will also need to install the base dhcp package. |
106 |
|
107 |
%package client |
108 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client |
109 |
Group: System/Servers |
110 |
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
111 |
Requires(post): systemd >= %{systemd_required_version} |
112 |
# dhclient-exit-hooks was in server package |
113 |
Conflicts: dhcp-server < 4.3.1-2 |
114 |
|
115 |
%description client |
116 |
DHCP client is the Internet Software Consortium (ISC) DHCP client for various |
117 |
UNIX operating systems. It allows a UNIX mac hine to obtain it's networking |
118 |
parameters from a DHCP server. |
119 |
|
120 |
You should install dhcp-client if you want to use the ISC DHCP client instead |
121 |
of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to |
122 |
install the base dhcp package. |
123 |
|
124 |
%package relay |
125 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay |
126 |
Group: System/Servers |
127 |
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
128 |
Requires(post): systemd >= %{systemd_required_version} |
129 |
Requires(post): rpm-helper >= 0.24.8-1 |
130 |
Requires(preun): rpm-helper >= 0.24.8-1 |
131 |
|
132 |
%description relay |
133 |
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP |
134 |
packets. It is used on a subnet with DHCP clients to "relay" their requests |
135 |
to a subnet that has a DHCP server on it. Because DHCP packets can be |
136 |
broadcast, they will not be routed off of the local subnet. The DHCP relay |
137 |
takes care of this for the client. You will need to set the environment |
138 |
variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before |
139 |
starting the server. |
140 |
|
141 |
%package devel |
142 |
Summary: Development headers and libraries for the dhcpctl API |
143 |
Group: Development/Other |
144 |
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
145 |
|
146 |
%description devel |
147 |
DHCP devel contains all of the libraries and headers for developing with the |
148 |
Internet Software Consortium (ISC) dhcpctl API. |
149 |
|
150 |
%prep |
151 |
%setup -q -n %{name}-%{major_version}-%{patch_version} |
152 |
%patch100 -p1 -b .ifup |
153 |
%patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments |
154 |
%patch102 -p1 -b .prevent_wireless_deassociation |
155 |
%patch103 -p1 -b .man |
156 |
|
157 |
# Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search |
158 |
# to the list of default requested DHCP options |
159 |
%patch7 -p1 -b .requested |
160 |
# If the ipv6 kernel module is missing, do not segfault |
161 |
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367]) |
162 |
%patch15 -p1 -b .noipv6 |
163 |
# Handle cases in add_timeout() where the function is called with a NULL |
164 |
# value for the 'when' parameter |
165 |
%patch17 -p1 -b .dracut |
166 |
# Ensure 64-bit platforms parse lease file dates & times correctly |
167 |
%patch18 -p1 -b .64-bit_lease_parse |
168 |
|
169 |
install -m0644 %{SOURCE10} doc |
170 |
|
171 |
%build |
172 |
%serverbuild |
173 |
%configure2_5x --enable-paranoia --enable-early-chroot \ |
174 |
--with-ldapcrypto \ |
175 |
--with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \ |
176 |
--with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \ |
177 |
--with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \ |
178 |
--with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \ |
179 |
--with-srv-pid-file=/run/dhcpd/dhcpd.pid \ |
180 |
--with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \ |
181 |
--with-cli-pid-file=/run/dhclient/dhclient.pid \ |
182 |
--with-cli6-pid-file=/run/dhclient/dhclient6.pid \ |
183 |
--with-relay-pid-file=/run/dhcrelay/dhcrelay.pid |
184 |
%make |
185 |
|
186 |
%install |
187 |
%makeinstall_std |
188 |
|
189 |
# Install correct dhclient-script |
190 |
install -d %{buildroot}/sbin |
191 |
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient |
192 |
install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script |
193 |
|
194 |
install -d %{buildroot}%{_unitdir} |
195 |
install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service |
196 |
install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service |
197 |
install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service |
198 |
|
199 |
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf |
200 |
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf |
201 |
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf |
202 |
|
203 |
install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir} |
204 |
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} |
205 |
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir} |
206 |
install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir} |
207 |
|
208 |
# install exit-hooks script to /etc/ |
209 |
install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} |
210 |
install -d %{buildroot}%{_sysconfdir}/dhclient-exit-hooks.d |
211 |
install -m 755 %{SOURCE11} %{buildroot}%{_sysconfdir}/dhclient-exit-hooks.d/static-routes.sh |
212 |
|
213 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
214 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF |
215 |
# You can set here various option for dhcpd |
216 |
|
217 |
# Which configuration file to use. |
218 |
# CONFIGFILE="/etc/dhcpd.conf" |
219 |
|
220 |
# Where to store the lease state information. |
221 |
# LEASEFILE="/var/lib/dhcpd/dhcpd.leases" |
222 |
|
223 |
# Define INTERFACES to limit which network interfaces dhcpd listens on. |
224 |
# The default null value causes dhcpd to listen on all interfaces. |
225 |
#INTERFACES="" |
226 |
|
227 |
# Define OPTIONS with any other options to pass to the dhcpd server. |
228 |
# See dhcpd(8) for available options and syntax. |
229 |
OPTIONS="-q" |
230 |
EOF |
231 |
|
232 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd6 <<EOF |
233 |
# You can set here various option for dhcpd |
234 |
|
235 |
# Which configuration file to use. |
236 |
# CONFIGFILE="/etc/dhcpd6.conf" |
237 |
|
238 |
# Where to store the lease state information. |
239 |
# LEASEFILE="/var/lib/dhcpd/dhcpd6.leases" |
240 |
|
241 |
# Define INTERFACES to limit which network interfaces dhcpd listens on. |
242 |
# The default null value causes dhcpd to listen on all interfaces. |
243 |
#INTERFACES="" |
244 |
|
245 |
# Define OPTIONS with any other options to pass to the dhcpd server. |
246 |
# See dhcpd(8) for available options and syntax. |
247 |
OPTIONS="-q" |
248 |
EOF |
249 |
|
250 |
install -d %{buildroot}%{_var}/lib/dhcpd |
251 |
touch %{buildroot}%{_var}/lib/dhcpd/dhcpd.leases |
252 |
touch %{buildroot}%{_var}/lib/dhcpd/dhcpd6.leases |
253 |
install -d %{buildroot}%{_var}/lib/dhclient |
254 |
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases |
255 |
|
256 |
# Copy sample conf files into position (called by doc macro) |
257 |
cp -p doc/examples/dhclient-dhcpv6.conf client/dhclient6.conf.example |
258 |
cp -p doc/examples/dhcpd-dhcpv6.conf server/dhcpd6.conf.example |
259 |
|
260 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF |
261 |
# Define SERVERS with a list of one or more DHCP servers where |
262 |
# DHCP packets are to be relayed to and from. This is mandatory. |
263 |
#SERVERS="10.11.12.13 10.9.8.7" |
264 |
SERVERS="" |
265 |
|
266 |
# Define OPTIONS with any other options to pass to the dhcrelay server. |
267 |
# See dhcrelay(8) for available options and syntax. |
268 |
#OPTIONS="-q -i eth0 -i eth1" |
269 |
OPTIONS="-q" |
270 |
EOF |
271 |
|
272 |
find . -type d -exec chmod 0755 {} \; |
273 |
find . -type f -exec chmod 0644 {} \; |
274 |
|
275 |
rm -rf doc/ja_JP.eucJP |
276 |
|
277 |
# remove empty files |
278 |
find -size 0 |grep ldap | xargs rm -rf |
279 |
|
280 |
# remove unwanted file |
281 |
rm -f %{buildroot}%{_sysconfdir}/dhclient.conf.example |
282 |
rm -f %{buildroot}%{_sysconfdir}/dhcpd.conf.example |
283 |
rm -f %{buildroot}%{_libdir}/*.a |
284 |
|
285 |
%pre server |
286 |
%_pre_useradd dhcpd /dev/null /bin/false |
287 |
|
288 |
%post server |
289 |
%_post_service dhcpd |
290 |
%_tmpfilescreate dhcpd |
291 |
# New dhcpd lease file |
292 |
if [ ! -f %{_var}/lib/dhcpd/dhcpd.leases ]; then |
293 |
touch %{_var}/lib/dhcpd/dhcpd.leases |
294 |
fi |
295 |
if [ ! -f %{_var}/lib/dhcpd/dhcpd6.leases ]; then |
296 |
touch %{_var}/lib/dhcpd/dhcpd6.leases |
297 |
fi |
298 |
|
299 |
%preun server |
300 |
%_preun_service dhcpd |
301 |
|
302 |
%post relay |
303 |
%_post_service dhcrelay |
304 |
%_tmpfilescreate dhcrelay |
305 |
|
306 |
%preun relay |
307 |
%_preun_service dhcrelay |
308 |
|
309 |
%post client |
310 |
touch %{_var}/lib/dhclient/dhclient.leases |
311 |
%_tmpfilescreate dhclient |
312 |
|
313 |
%postun client |
314 |
rm -rf %{_var}/lib/dhclient/dhclient.leases |
315 |
|
316 |
%files common |
317 |
%doc README contrib/ldap/README.ldap RELNOTES |
318 |
%doc contrib/3.0b1-lease-convert |
319 |
%{_mandir}/man5/dhcp-options.5* |
320 |
|
321 |
%files doc |
322 |
%doc doc/* |
323 |
|
324 |
%files server |
325 |
%doc server/dhcpd*.conf.example tests/failover contrib/ldap/dhcp.schema |
326 |
%{_unitdir}/dhcpd.service |
327 |
%{_unitdir}/dhcpd6.service |
328 |
%{_tmpfilesdir}/dhcpd.conf |
329 |
%config(noreplace) %{_sysconfdir}/dhcpd.conf |
330 |
%config(noreplace) %{_sysconfdir}/dhcpd6.conf |
331 |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd |
332 |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd6 |
333 |
%{_sbindir}/dhcpd |
334 |
%{_sbindir}/dhcpreport.pl |
335 |
%{_sbindir}/dhcpd-conf-to-ldap |
336 |
%{_sbindir}/dhcpd-chroot.sh |
337 |
%{_bindir}/omshell |
338 |
%{_mandir}/man1/omshell.1* |
339 |
%{_mandir}/man3/omapi.3* |
340 |
%{_mandir}/man5/dhcpd.conf.5* |
341 |
%{_mandir}/man5/dhcpd.leases.5* |
342 |
%{_mandir}/man5/dhcp-eval.5* |
343 |
%{_mandir}/man8/dhcpd.8* |
344 |
%dir %{_var}/lib/dhcpd |
345 |
%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases |
346 |
%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd6.leases |
347 |
|
348 |
%files relay |
349 |
%{_unitdir}/dhcrelay.service |
350 |
%{_tmpfilesdir}/dhcrelay.conf |
351 |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay |
352 |
%{_sbindir}/dhcrelay |
353 |
%{_mandir}/man8/dhcrelay.8* |
354 |
|
355 |
%files client |
356 |
%doc client/dhclient*.conf.example |
357 |
%{_sysconfdir}/dhclient-exit-hooks |
358 |
%{_sysconfdir}/dhclient-exit-hooks.d |
359 |
%attr (0755,root,root) /sbin/dhclient-script |
360 |
%{_tmpfilesdir}/dhclient.conf |
361 |
/sbin/dhclient |
362 |
%{_mandir}/man5/dhclient.conf.5* |
363 |
%{_mandir}/man5/dhclient.leases.5* |
364 |
%{_mandir}/man8/dhclient.8* |
365 |
%{_mandir}/man8/dhclient-script.8* |
366 |
%dir %{_var}/lib/dhclient |
367 |
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases |
368 |
|
369 |
%files devel |
370 |
%{_includedir}/* |
371 |
%{_mandir}/man3/* |