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