1 |
dmorgan |
16733 |
%define _catdir /var/cache/man |
2 |
|
|
%define pver P2 |
3 |
|
|
|
4 |
|
|
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client |
5 |
|
|
Name: dhcp |
6 |
|
|
Epoch: 3 |
7 |
|
|
Version: 4.2.0 |
8 |
|
|
Release: %mkrel 0.%{pver}.1 |
9 |
|
|
License: Distributable |
10 |
|
|
Group: System/Servers |
11 |
|
|
URL: https://www.isc.org/software/dhcp |
12 |
|
|
Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}-%{pver}.tar.gz |
13 |
|
|
Source1: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}-%{pver}.tar.gz.sha512.asc |
14 |
|
|
Source2: dhcpd.conf |
15 |
|
|
Source3: dhcpd.init |
16 |
|
|
Source4: dhcp-dynamic-dns-examples.tar.bz2 |
17 |
|
|
Source5: dhcrelay.init |
18 |
|
|
Source6: update_dhcp.pl |
19 |
|
|
Source7: dhcpreport.pl |
20 |
|
|
Source8: dhcpd-chroot.sh |
21 |
|
|
Source12: draft-ietf-dhc-ldap-schema-01.txt |
22 |
|
|
# customize ifup script |
23 |
|
|
Patch0: dhcp-4.1.1-ifup.patch |
24 |
|
|
Patch5: dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch |
25 |
|
|
# (fc) 4.1.0-3mdv no IPv6 is no longer fatal for dhclient |
26 |
|
|
Patch6: dhcp-4.1.1-missing-ipv6-not-fatal.patch |
27 |
|
|
# prevents needless deassociation, working around mdv bug #43441 |
28 |
|
|
Patch7: dhcp-4.1.1-prevent_wireless_deassociation.patch |
29 |
|
|
# closes mdv #50194 - reported upstream: ISC-Bugs #19627 |
30 |
|
|
Patch8: dhcp-4.1.0-fix_lease_parsing.patch |
31 |
|
|
# redhat bug #587070 |
32 |
|
|
Patch9: dhcp-4.1.1-useless-wait.patch |
33 |
|
|
BuildRequires: perl groff-for-man |
34 |
|
|
BuildRequires: openldap-devel |
35 |
|
|
Provides: dhcpd |
36 |
|
|
Obsoletes: dhcpd < 3.0.6 |
37 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
38 |
|
|
|
39 |
|
|
%description |
40 |
|
|
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
41 |
|
|
individual devices on an IP network to get their own network configuration |
42 |
|
|
information (IP address, subnetmask, broadcast address, etc.) from a DHCP |
43 |
|
|
server. The overall purpose of DHCP is to make it easier to administer a |
44 |
|
|
large network. The dhcp package includes the DHCP server and a DHCP relay |
45 |
|
|
agent. You will also need to install the dhcp-client or dhcpcd package, |
46 |
|
|
or pump or dhcpxd, which provides the DHCP client daemon, on client machines. |
47 |
|
|
|
48 |
|
|
If you want the DHCP server and/or relay, you will also need to install the |
49 |
|
|
dhcp-server and/or dhcp-relay packages. |
50 |
|
|
|
51 |
|
|
%package common |
52 |
|
|
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server |
53 |
|
|
Group: System/Servers |
54 |
|
|
|
55 |
|
|
%description common |
56 |
|
|
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
57 |
|
|
individual devices on an IP network to get their own network |
58 |
|
|
configuration information (IP address, subnetmask, broadcast address, |
59 |
|
|
etc.) from a DHCP server. The overall purpose of DHCP is to make it |
60 |
|
|
easier to administer a large network. The dhcp package includes the |
61 |
|
|
DHCP server and a DHCP relay agent. |
62 |
|
|
|
63 |
|
|
You will also need to install the dhcp-client or dhcpcd package, or pump or |
64 |
|
|
dhcpxd, which provides the DHCP client daemon, on client machines. If you |
65 |
|
|
want the DHCP server and/or relay, you will also need to install the |
66 |
|
|
dhcp-server and/or dhcp-relay packages. |
67 |
|
|
|
68 |
|
|
%package doc |
69 |
|
|
Summary: Documentation about the ISC DHCP server/client |
70 |
|
|
Group: System/Servers |
71 |
|
|
|
72 |
|
|
%description doc |
73 |
|
|
This package contains RFC/API/protocol documentation about the ISC |
74 |
|
|
DHCP server and client. |
75 |
|
|
|
76 |
|
|
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
77 |
|
|
individual devices on an IP network to get their own network |
78 |
|
|
configuration information (IP address, subnetmask, broadcast address, |
79 |
|
|
etc.) from a DHCP server. The overall purpose of DHCP is to make it |
80 |
|
|
easier to administer a large network. The dhcp package includes the |
81 |
|
|
DHCP server and a DHCP relay agent. |
82 |
|
|
|
83 |
|
|
%package server |
84 |
|
|
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server |
85 |
|
|
Group: System/Servers |
86 |
|
|
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
87 |
|
|
Requires(post): rpm-helper |
88 |
|
|
Requires(preun): rpm-helper |
89 |
|
|
Obsoletes: dhcp < 3.0.6 |
90 |
|
|
Provides: dhcp |
91 |
|
|
|
92 |
|
|
%description server |
93 |
|
|
DHCP server is the Internet Software Consortium (ISC) DHCP server for various |
94 |
|
|
UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from |
95 |
|
|
the network. |
96 |
|
|
|
97 |
|
|
You should install dhcp-server if you want to set up a DHCP server on your |
98 |
|
|
network. You will also need to install the base dhcp package. |
99 |
|
|
|
100 |
|
|
%package client |
101 |
|
|
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client |
102 |
|
|
Group: System/Servers |
103 |
|
|
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
104 |
|
|
|
105 |
|
|
%description client |
106 |
|
|
DHCP client is the Internet Software Consortium (ISC) DHCP client for various |
107 |
|
|
UNIX operating systems. It allows a UNIX mac hine to obtain it's networking |
108 |
|
|
parameters from a DHCP server. |
109 |
|
|
|
110 |
|
|
You should install dhcp-client if you want to use the ISC DHCP client instead |
111 |
|
|
of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to |
112 |
|
|
install the base dhcp package. |
113 |
|
|
|
114 |
|
|
%package relay |
115 |
|
|
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay |
116 |
|
|
Group: System/Servers |
117 |
|
|
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
118 |
|
|
Requires(post): rpm-helper |
119 |
|
|
Requires(preun): rpm-helper |
120 |
|
|
|
121 |
|
|
%description relay |
122 |
|
|
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP |
123 |
|
|
packets. It is used on a subnet with DHCP clients to "relay" their requests |
124 |
|
|
to a subnet that has a DHCP server on it. Because DHCP packets can be |
125 |
|
|
broadcast, they will not be routed off of the local subnet. The DHCP relay |
126 |
|
|
takes care of this for the client. You will need to set the environment |
127 |
|
|
variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before |
128 |
|
|
starting the server. |
129 |
|
|
|
130 |
|
|
%package devel |
131 |
|
|
Summary: Development headers and libraries for the dhcpctl API |
132 |
|
|
Group: Development/Other |
133 |
|
|
Requires: dhcp-common = %{epoch}:%{version}-%{release} |
134 |
|
|
|
135 |
|
|
%description devel |
136 |
|
|
DHCP devel contains all of the libraries and headers for developing with the |
137 |
|
|
Internet Software Consortium (ISC) dhcpctl API. |
138 |
|
|
|
139 |
|
|
%prep |
140 |
|
|
|
141 |
|
|
%setup -q -n %{name}-%{version}-%{pver} -a4 |
142 |
|
|
%patch0 -p1 -b .ifup |
143 |
|
|
%patch5 -p1 -b .format_not_a_string_literal_and_no_format_arguments |
144 |
|
|
%patch6 -p1 -b .noipv6nonfatal |
145 |
|
|
%patch7 -p1 -b .prevent_wireless_deassociation |
146 |
|
|
%patch8 -p1 -b .fix_lease_parsing |
147 |
|
|
%patch9 -p0 -b .useless_wait |
148 |
|
|
|
149 |
|
|
install -m0644 %{SOURCE12} doc |
150 |
|
|
|
151 |
|
|
%build |
152 |
|
|
%serverbuild |
153 |
|
|
%configure2_5x --enable-paranoia --enable-early-chroot \ |
154 |
|
|
--with-ldapcrypto \ |
155 |
|
|
--with-srv-lease-file=%{_var}/lib/dhcp/dhcpd.leases \ |
156 |
|
|
--with-srv6-lease-file=%{_var}/lib/dhcp/dhcpd6.leases \ |
157 |
|
|
--with-cli-lease-file=%{_var}/lib/dhcp/dhclient.leases \ |
158 |
|
|
--with-cli6-lease-file=%{_var}/lib/dhcp/dhclient6.leases \ |
159 |
|
|
--with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \ |
160 |
|
|
--with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \ |
161 |
|
|
--with-cli-pid-file=%{_var}/run/dhclient.pid \ |
162 |
|
|
--with-cli6-pid-file=%{_var}/run/dhclient6.pid \ |
163 |
|
|
--with-relay-pid-file=%{_var}/run/dhcrelay.pid |
164 |
|
|
|
165 |
|
|
%make |
166 |
|
|
|
167 |
|
|
%install |
168 |
|
|
rm -rf %{buildroot} |
169 |
|
|
|
170 |
|
|
install -d %{buildroot}%{_bindir} |
171 |
|
|
install -d %{buildroot}%{_sysconfdir}/sysconfig |
172 |
|
|
install -d %{buildroot}%{_initrddir} |
173 |
|
|
install -d %{buildroot}%{_var}/lib/dhcp |
174 |
|
|
install -d %{buildroot}%{_var}/run/dhcpd |
175 |
|
|
|
176 |
|
|
%makeinstall_std |
177 |
|
|
|
178 |
|
|
# Install correct dhclient-script |
179 |
|
|
%{__mkdir} -p %{buildroot}/sbin |
180 |
|
|
%{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient |
181 |
|
|
%{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script |
182 |
|
|
|
183 |
|
|
|
184 |
|
|
install -m0755 %{SOURCE3} %{buildroot}%{_initrddir}/dhcpd |
185 |
|
|
install -m0755 %{SOURCE5} %{buildroot}%{_initrddir}/dhcrelay |
186 |
|
|
install -m0755 %{SOURCE6} %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}/ |
187 |
|
|
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ |
188 |
|
|
install -m0755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}/ |
189 |
|
|
|
190 |
|
|
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF |
191 |
|
|
# You can set here various option for dhcpd |
192 |
|
|
|
193 |
|
|
# Which configuration file to use. |
194 |
|
|
# CONFIGFILE="/etc/dhcpd.conf" |
195 |
|
|
|
196 |
|
|
# Where to store the lease state information. |
197 |
|
|
# LEASEFILE="/var/lib/dhcp/dhcpd.leases" |
198 |
|
|
|
199 |
|
|
# Define INTERFACES to limit which network interfaces dhcpd listens on. |
200 |
|
|
# The default null value causes dhcpd to listen on all interfaces. |
201 |
|
|
#INTERFACES="" |
202 |
|
|
|
203 |
|
|
# Define OPTIONS with any other options to pass to the dhcpd server. |
204 |
|
|
# See dhcpd(8) for available options and syntax. |
205 |
|
|
OPTIONS="-q" |
206 |
|
|
|
207 |
|
|
EOF |
208 |
|
|
|
209 |
|
|
touch %{buildroot}%{_var}/lib/dhcp/dhcpd.leases |
210 |
|
|
touch %{buildroot}%{_var}/lib/dhcp/dhclient.leases |
211 |
|
|
|
212 |
|
|
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF |
213 |
|
|
# Define SERVERS with a list of one or more DHCP servers where |
214 |
|
|
# DHCP packets are to be relayed to and from. This is mandatory. |
215 |
|
|
#SERVERS="10.11.12.13 10.9.8.7" |
216 |
|
|
SERVERS="" |
217 |
|
|
|
218 |
|
|
# Define OPTIONS with any other options to pass to the dhcrelay server. |
219 |
|
|
# See dhcrelay(8) for available options and syntax. |
220 |
|
|
#OPTIONS="-q -i eth0 -i eth1" |
221 |
|
|
OPTIONS="-q" |
222 |
|
|
EOF |
223 |
|
|
|
224 |
|
|
find . -type d -exec chmod 0755 {} \; |
225 |
|
|
find . -type f -exec chmod 0644 {} \; |
226 |
|
|
|
227 |
|
|
rm -rf doc/ja_JP.eucJP |
228 |
|
|
|
229 |
|
|
# remove empty files |
230 |
|
|
find -size 0 |grep ldap | xargs rm -rf |
231 |
|
|
|
232 |
|
|
# remove unwanted file |
233 |
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf |
234 |
|
|
|
235 |
|
|
%post server |
236 |
|
|
%_post_service dhcpd |
237 |
|
|
# New dhcpd lease file |
238 |
|
|
if [ ! -f %{_var}/lib/dhcp/dhcpd.leases ]; then |
239 |
|
|
touch %{_var}/lib/dhcp/dhcpd.leases |
240 |
|
|
fi |
241 |
|
|
|
242 |
|
|
if [ $1 = 0 ]; then |
243 |
|
|
%{_initrddir}/dhcpd start |
244 |
|
|
fi |
245 |
|
|
|
246 |
|
|
#update an eventual installed dhcp-2* server |
247 |
|
|
if [ -f %{_sysconfdir}/dhcpd.conf ]; then |
248 |
|
|
perl %{_sbindir}/update_dhcp.pl |
249 |
|
|
fi |
250 |
|
|
|
251 |
|
|
%preun server |
252 |
|
|
%_preun_service dhcpd |
253 |
|
|
|
254 |
|
|
%postun server |
255 |
|
|
if [ "$1" -ge "1" ]; then |
256 |
|
|
/sbin/service dhcpd condrestart >/dev/null 2>&1 |
257 |
|
|
fi |
258 |
|
|
|
259 |
|
|
%post relay |
260 |
|
|
%_post_service dhcrelay |
261 |
|
|
|
262 |
|
|
%preun relay |
263 |
|
|
%_preun_service dhcrelay |
264 |
|
|
|
265 |
|
|
%postun relay |
266 |
|
|
if [ "$1" -ge "1" ]; then |
267 |
|
|
/sbin/service dhcrelay condrestart >/dev/null 2>&1 |
268 |
|
|
fi |
269 |
|
|
|
270 |
|
|
%post client |
271 |
|
|
touch /var/lib/dhcp/dhclient.leases |
272 |
|
|
|
273 |
|
|
%postun client |
274 |
|
|
rm -rf /var/lib/dhcp/dhclient.leases |
275 |
|
|
|
276 |
|
|
%clean |
277 |
|
|
rm -rf %{buildroot} |
278 |
|
|
|
279 |
|
|
%files common |
280 |
|
|
%defattr(-,root,root) |
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 |
|
|
%defattr(-,root,root) |
288 |
|
|
%doc doc/* |
289 |
|
|
|
290 |
|
|
%files server |
291 |
|
|
%defattr(-,root,root) |
292 |
|
|
%doc server/dhcpd.conf tests/failover contrib/ldap/dhcp.schema |
293 |
|
|
%{_initrddir}/dhcpd |
294 |
|
|
%config(noreplace) %{_sysconfdir}/dhcpd.conf |
295 |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd |
296 |
|
|
%config(noreplace) %ghost %{_var}/lib/dhcp/dhcpd.leases |
297 |
|
|
%{_sbindir}/dhcpd |
298 |
|
|
%{_sbindir}/update_dhcp.pl |
299 |
|
|
%{_sbindir}/dhcpreport.pl |
300 |
|
|
%{_sbindir}/dhcpd-conf-to-ldap |
301 |
|
|
%{_sbindir}/dhcpd-chroot.sh |
302 |
|
|
%{_bindir}/omshell |
303 |
|
|
%{_mandir}/man1/omshell.1* |
304 |
|
|
%{_mandir}/man3/omapi.3* |
305 |
|
|
%{_mandir}/man5/dhcpd.conf.5* |
306 |
|
|
%{_mandir}/man5/dhcpd.leases.5* |
307 |
|
|
%{_mandir}/man5/dhcp-eval.5* |
308 |
|
|
%{_mandir}/man8/dhcpd.8* |
309 |
|
|
%dir %{_var}/run/dhcpd |
310 |
|
|
|
311 |
|
|
%files relay |
312 |
|
|
%defattr(-,root,root) |
313 |
|
|
%{_initrddir}/dhcrelay |
314 |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay |
315 |
|
|
%{_sbindir}/dhcrelay |
316 |
|
|
%{_mandir}/man8/dhcrelay.8* |
317 |
|
|
|
318 |
|
|
%files client |
319 |
|
|
%defattr(-,root,root) |
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 |
|
|
%defattr(-,root,root) |
331 |
|
|
%{_includedir}/* |
332 |
|
|
%{_libdir}/*.a |
333 |
|
|
%{_mandir}/man3/* |
334 |
|
|
|
335 |
|
|
|