]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without ldap # without support for ldap storage | |
4 | # | |
5 | Summary: DHCP Server | |
6 | Summary(es.UTF-8): Servidor DHCP | |
7 | Summary(pl.UTF-8): Serwer DHCP | |
8 | Summary(pt_BR.UTF-8): Servidor DHCP (Protocolo de configuração dinâmica de hosts) | |
9 | Name: dhcp | |
10 | Version: 3.1.0 | |
11 | Release: 3 | |
12 | Epoch: 4 | |
13 | License: distributable | |
14 | Group: Networking/Daemons | |
15 | Source0: ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 27d179a3c3fbef576566b456a1168246 | |
17 | Source1: %{name}.init | |
18 | Source2: %{name}-relay.init | |
19 | Source3: %{name}.sysconfig | |
20 | Source4: %{name}-relay.sysconfig | |
21 | Source5: %{name}-libdhcp4client.pc | |
22 | Source6: %{name}-dhcp4client.h | |
23 | Source7: %{name}-libdhcp4client.make | |
24 | Source8: %{name}-libdhcp_control.h | |
25 | Patch0: %{name}-dhclient.script.patch | |
26 | Patch1: %{name}-if_buffer_size.patch | |
27 | # http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch | |
28 | Patch2: %{name}-ldap.patch | |
29 | Patch3: %{name}-client-script-redhat.patch | |
30 | Patch4: %{name}-3.0.3-x-option.patch | |
31 | Patch5: %{name}-typo.patch | |
32 | Patch6: %{name}-arg-concat.patch | |
33 | Patch7: %{name}-split-VARDB.patch | |
34 | Patch8: %{name}-timeouts.patch | |
35 | Patch9: %{name}-options.patch | |
36 | Patch10: %{name}-libdhcp4client.patch | |
37 | Patch11: %{name}-prototypes.patch | |
38 | URL: http://www.isc.org/sw/dhcp/ | |
39 | BuildRequires: groff | |
40 | %{?with_ldap:BuildRequires: openldap-devel >= 2.4.6} | |
41 | %{?with_ldap:BuildRequires: openssl-devel} | |
42 | BuildRequires: rpmbuild(macros) >= 1.304 | |
43 | Requires(post): coreutils | |
44 | Requires(post,preun): /sbin/chkconfig | |
45 | Requires: rc-scripts >= 0.2.0 | |
46 | Provides: dhcpd | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %define schemadir /usr/share/openldap/schema | |
50 | ||
51 | %description | |
52 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows | |
53 | individual devices on an IP network to get their own network | |
54 | configuration information (IP address, subnetmask, broadcast address, | |
55 | etc.) from a DHCP server. The overall purpose of DHCP is to make it | |
56 | easier to administer a large network. | |
57 | ||
58 | %description -l es.UTF-8 | |
59 | DHCP permite que hosts en una red TCP/IP soliciten y tengan sus | |
60 | direcciones IP alocadas dinámicamente, permite también descubrir | |
61 | información sobre la red en que están conectados. BOOTP provee una | |
62 | funcionalidad similar, con ciertas restricciones. Este servidor | |
63 | también las atiende. | |
64 | ||
65 | %description -l pl.UTF-8 | |
66 | Serwer DHCP (Dynamic Host Configuration Protocol). | |
67 | ||
68 | DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na | |
69 | pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu | |
70 | rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie | |
71 | dużymi sieciami IP. | |
72 | ||
73 | %description -l pt_BR.UTF-8 | |
74 | DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus | |
75 | endereços IP alocados dinamicamente, permite também descobrir | |
76 | informações sobre a rede em que estão conectados. BOOTP provê uma | |
77 | funcionalidade similar, com certas restrições. Este servidor também | |
78 | atende aquelas requisições. Esta versão é ainda considerada um | |
79 | software BETA. | |
80 | ||
81 | %package -n openldap-schema-dhcp | |
82 | Summary: LDAP Schema for DHCP Server | |
83 | Summary(pl.UTF-8): Schemat LDAP dla serwera DHCP | |
84 | Group: Networking/Daemons | |
85 | Requires(post,postun): sed >= 4.0 | |
86 | Requires: openldap-servers | |
87 | ||
88 | %description -n openldap-schema-dhcp | |
89 | This package contains LDAPv3 schema for use with the DHCP Server. | |
90 | ||
91 | %description -n openldap-schema-dhcp -l pl.UTF-8 | |
92 | Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP. | |
93 | ||
94 | %package client | |
95 | Summary: DHCP Client | |
96 | Summary(pl.UTF-8): Klient DHCP | |
97 | Group: Networking/Daemons | |
98 | Requires: coreutils | |
99 | Requires: iproute2 | |
100 | Requires: net-tools | |
101 | Obsoletes: dhclient | |
102 | ||
103 | %description client | |
104 | Dynamic Host Configuration Protocol Client. | |
105 | ||
106 | %description client -l pl.UTF-8 | |
107 | Klient DHCP (Dynamic Host Configuration Protocol). | |
108 | ||
109 | %package relay | |
110 | Summary: DHCP Relay Agent | |
111 | Summary(pl.UTF-8): Agent przekazywania informacji DHCP | |
112 | Group: Networking/Daemons | |
113 | Requires(post): coreutils | |
114 | Requires(post,preun): /sbin/chkconfig | |
115 | Requires: rc-scripts >= 0.2.0 | |
116 | ||
117 | %description relay | |
118 | Dhcp relay is a relay agent for DHCP packets. It is used on a subnet | |
119 | with DHCP clients to "relay" their requests to a subnet that has a | |
120 | DHCP server on it. Because DHCP packets can be broadcast, they will | |
121 | not be routed off of the local subnet. The DHCP relay takes care of | |
122 | this for the client. | |
123 | ||
124 | %description relay -l pl.UTF-8 | |
125 | Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między | |
126 | podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie | |
127 | rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej | |
128 | podsieci. | |
129 | ||
130 | %package devel | |
131 | Summary: DHCP development includes and libs | |
132 | Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP | |
133 | Group: Development/Libraries | |
134 | ||
135 | %description devel | |
136 | Includes OMAPI and dhcptl libraries. | |
137 | ||
138 | OMAPI is an programming layer designed for controlling remote | |
139 | applications, and for querying them for their state. It is currently | |
140 | used by the ISC DHCP server. | |
141 | ||
142 | The dhcpctl set of functions provide an API that can be used to | |
143 | communicate with and manipulate a running ISC DHCP server. | |
144 | ||
145 | %description devel -l pl.UTF-8 | |
146 | Zawiera biblioteki OMAPI oraz dhcpctl. | |
147 | ||
148 | OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i | |
149 | odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP. | |
150 | ||
151 | dhcpctl to zbiór funkcji tworzących API, które może być używane do | |
152 | komunikacji z działającym serwerem ISC DHCP i jego kontroli. | |
153 | ||
154 | %package -n libdhcp4client | |
155 | Summary: The DHCP client in a library for invocation by other programs | |
156 | Summary(pl.UTF-8): Klient DHCP w postaci biblioteki do wykorzystania w innych programach | |
157 | Group: Development/Libraries | |
158 | ||
159 | %description -n libdhcp4client | |
160 | Provides the client for the DHCP protocol. | |
161 | ||
162 | %description -n libdhcp4client -l pl.UTF-8 | |
163 | Ten pakiet zawiera klienta protokołu DHCP. | |
164 | ||
165 | %package -n libdhcp4client-devel | |
166 | Summary: Header files for development with the DHCP client library | |
167 | Summary(pl.UTF-8): Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP | |
168 | Group: Development/Libraries | |
169 | Requires: libdhcp4client = %{epoch}:%{version}-%{release} | |
170 | ||
171 | %description -n libdhcp4client-devel | |
172 | Header files for development with the DHCP client library. | |
173 | ||
174 | %description -n libdhcp4client-devel -l pl.UTF-8 | |
175 | Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP. | |
176 | ||
177 | %package -n libdhcp4client-static | |
178 | Summary: Static DHCP client library | |
179 | Summary(pl.UTF-8): Statyczna biblioteka kliencka DHCP | |
180 | Group: Development/Libraries | |
181 | Requires: libdhcp4client-devel = %{epoch}:%{version}-%{release} | |
182 | ||
183 | %description -n libdhcp4client-static | |
184 | Static DHCP client library. | |
185 | ||
186 | %description -n libdhcp4client-static -l pl.UTF-8 | |
187 | Statyczna biblioteka kliencka DHCP. | |
188 | ||
189 | %prep | |
190 | %setup -q | |
191 | %patch0 -p1 | |
192 | %patch1 -p1 | |
193 | %{?with_ldap:%patch2 -p1} | |
194 | # These two patches are required for dhcdbd to function | |
195 | %patch3 -p1 | |
196 | %patch4 -p1 | |
197 | # | |
198 | %patch5 -p1 | |
199 | %patch6 -p1 | |
200 | %patch7 -p1 | |
201 | %patch8 -p1 | |
202 | %patch9 -p1 | |
203 | %patch10 -p1 | |
204 | %patch11 -p1 | |
205 | ||
206 | sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE5} > libdhcp4client.pc | |
207 | mkdir -p libdhcp4client | |
208 | cp %{SOURCE6} libdhcp4client/dhcp4client.h | |
209 | cp %{SOURCE7} libdhcp4client/Makefile.dist | |
210 | cp %{SOURCE8} includes/isc-dhcp/libdhcp_control.h | |
211 | ||
212 | %build | |
213 | # NOTE: this is not autoconf configure - do not change it to %%configure | |
214 | ./configure | |
215 | ||
216 | %{__make} \ | |
217 | CC="%{__cc}" \ | |
218 | CC_OPTIONS="%{rpmcflags} \ | |
219 | -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \ | |
220 | -DEXTENDED_NEW_OPTION_INFO \ | |
221 | -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhclient/dhclient.leases\\\" \ | |
222 | " | |
223 | LFLAGS="%{rpmldflags}" \ | |
224 | DEBUG="" \ | |
225 | VARDBS="/var/lib/%{name}" | |
226 | VARDBC="/var/lib/dhclient" | |
227 | ||
228 | %install | |
229 | rm -rf $RPM_BUILD_ROOT | |
230 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{rc.d/init.d,sysconfig},%{schemadir},%{_pkgconfigdir}} | |
231 | ||
232 | %{__make} install \ | |
233 | DESTDIR=$RPM_BUILD_ROOT \ | |
234 | CLIENTBINDIR=/sbin \ | |
235 | BINDIR=%{_sbindir} \ | |
236 | LIBDIR=%{_libdir} \ | |
237 | INCDIR=%{_includedir} \ | |
238 | ADMMANDIR=%{_mandir}/man8 \ | |
239 | ADMMANEXT=.8 \ | |
240 | FFMANDIR=%{_mandir}/man5 \ | |
241 | LIBMANDIR=%{_mandir}/man3 \ | |
242 | LIBMANEXT=.3 \ | |
243 | USRMANDIR=%{_mandir}/man1 \ | |
244 | USRMANEXT=.1 \ | |
245 | VARDBS=/var/lib/%{name} \ | |
246 | VARDBC=/var/lib/dhclient \ | |
247 | FFMANEXT=.5 | |
248 | ||
249 | rm $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3* | |
250 | ||
251 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd | |
252 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay | |
253 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd | |
254 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay | |
255 | ||
256 | install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir} | |
257 | %if %{with ldap} | |
258 | install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir} | |
259 | %endif | |
260 | ||
261 | touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf | |
262 | ||
263 | touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases | |
264 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases | |
265 | ||
266 | install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc | |
267 | ||
268 | %clean | |
269 | rm -rf $RPM_BUILD_ROOT | |
270 | ||
271 | %post | |
272 | /sbin/chkconfig --add dhcpd | |
273 | touch /var/lib/%{name}/dhcpd.leases | |
274 | %service dhcpd restart "dhcpd daemon" | |
275 | ||
276 | %preun | |
277 | if [ "$1" = "0" ];then | |
278 | %service dhcpd stop | |
279 | /sbin/chkconfig --del dhcpd | |
280 | fi | |
281 | ||
282 | %post -n openldap-schema-dhcp | |
283 | %openldap_schema_register %{schemadir}/dhcp.schema -d core | |
284 | %service -q ldap restart | |
285 | ||
286 | %postun -n openldap-schema-dhcp | |
287 | if [ "$1" = "0" ]; then | |
288 | %openldap_schema_unregister %{schemadir}/dhcp.schema | |
289 | %service -q ldap restart | |
290 | fi | |
291 | ||
292 | %post client | |
293 | if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then | |
294 | mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases | |
295 | fi | |
296 | ||
297 | %post relay | |
298 | /sbin/chkconfig --add dhcp-relay | |
299 | if [ -f /var/lock/subsys/dhcrelay ]; then | |
300 | mv -f /var/lock/subsys/{dhcrelay,dhcp-relay} | |
301 | fi | |
302 | %service dhcp-relay restart "dhcrelay daemon" | |
303 | ||
304 | %preun relay | |
305 | if [ "$1" = "0" ];then | |
306 | %service dhcp-relay stop | |
307 | /sbin/chkconfig --del dhcp-relay | |
308 | fi | |
309 | ||
310 | %triggerpostun -- dhcp < 3.0 | |
311 | if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then | |
312 | umask 027 | |
313 | echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp | |
314 | echo "" >> /etc/dhcpd.conf.tmp | |
315 | cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp | |
316 | mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf | |
317 | fi | |
318 | ||
319 | %files | |
320 | %defattr(644,root,root,755) | |
321 | %doc doc/* README RELNOTES server/dhcpd.conf LICENSE | |
322 | %doc contrib/ms2isc | |
323 | %{?with_ldap:%doc README.ldap Changelog-LDAP contrib/dhcpd-conf-to-ldap.pl} | |
324 | %{_mandir}/man1/* | |
325 | %{_mandir}/man5/dhcp* | |
326 | %{_mandir}/man8/dhcp* | |
327 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd | |
328 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf | |
329 | %attr(755,root,root) %{_bindir}/omshell | |
330 | %attr(755,root,root) %{_sbindir}/dhcpd | |
331 | %attr(754,root,root) /etc/rc.d/init.d/dhcpd | |
332 | %attr(750,root,root) %dir /var/lib/%{name} | |
333 | %ghost /var/lib/%{name}/dhcpd.leases | |
334 | ||
335 | %if %{with ldap} | |
336 | %files -n openldap-schema-dhcp | |
337 | %defattr(644,root,root,755) | |
338 | %doc contrib/dhcpd-conf-to-ldap.pl | |
339 | %{schemadir}/*.schema | |
340 | %endif | |
341 | ||
342 | %files client | |
343 | %defattr(644,root,root,755) | |
344 | %doc contrib/sethostname.sh | |
345 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf | |
346 | %attr(755,root,root) /sbin/dhclient | |
347 | %attr(755,root,root) /sbin/dhclient-script | |
348 | %{_mandir}/man[58]/dhclient* | |
349 | %attr(750,root,root) %dir /var/lib/dhclient | |
350 | %ghost /var/lib/dhclient/dhclient.leases | |
351 | ||
352 | %files relay | |
353 | %defattr(644,root,root,755) | |
354 | %{_mandir}/man8/dhcrelay* | |
355 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay | |
356 | %attr(755,root,root) %{_sbindir}/dhcrelay | |
357 | %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay | |
358 | ||
359 | %files devel | |
360 | %defattr(644,root,root,755) | |
361 | %{_mandir}/man3/* | |
362 | %{_libdir}/*.a | |
363 | %{_includedir}/* | |
364 | ||
365 | %files -n libdhcp4client | |
366 | %defattr(644,root,root,755) | |
367 | %attr(755,root,root) %{_libdir}/libdhcp4client-%{version}.so.* | |
368 | ||
369 | %files -n libdhcp4client-devel | |
370 | %defattr(644,root,root,755) | |
371 | %attr(755,root,root) %{_libdir}/libdhcp4client.so | |
372 | %{_includedir}/* | |
373 | %{_pkgconfigdir}/libdhcp4client.pc | |
374 | ||
375 | %files -n libdhcp4client-static | |
376 | %defattr(644,root,root,755) | |
377 | %{_libdir}/libdhcp4client.a |