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