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