3 %bcond_without ldap # without support for ldap storage
4 %bcond_without static_libs # don't build static library
7 %define vvendor PLD/Linux
10 Summary(es.UTF-8): Servidor DHCP
11 Summary(pl.UTF-8): Serwer DHCP
12 Summary(pt_BR.UTF-8): Servidor DHCP (Protocolo de configuração dinâmica de hosts)
16 # don't put int release until all patches are updated/ported(!)
20 Group: Networking/Daemons
21 Source0: ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
22 # Source0-md5: 31d79b27ce4a94089a0b9ce7f72307fa
24 Source2: %{name}6.init
25 Source3: %{name}-relay.init
26 Source4: %{name}.sysconfig
27 Source5: %{name}-relay.sysconfig
28 Source6: %{name}-libdhcp4client.pc
29 Source7: %{name}-dhcp4client.h
30 Source8: %{name}-libdhcp4client.make
31 Source9: %{name}-libdhcp_control.h
32 Source10: %{name}.schema
33 Source11: %{name}-README.ldap
34 Source12: draft-ietf-dhc-ldap-schema-01.txt
35 Source13: dhcpd-conf-to-ldap
36 Source14: dhcp-dhclient-script
37 Patch0: %{name}-dhclient.script.patch
38 Patch1: %{name}-release-by-ifup.patch
40 Patch2: %{name}-ldap.patch
41 Patch3: %{name}-client-script-redhat.patch
42 Patch4: %{name}-3.0.3-x-option.patch
43 Patch5: %{name}-paths.patch
44 Patch6: %{name}-arg-concat.patch
45 Patch8: %{name}-timeouts.patch
46 Patch9: %{name}-options.patch
47 Patch10: %{name}-libdhcp4client.patch
48 Patch11: %{name}-prototypes.patch
49 Patch12: %{name}-errwarn-message.patch
50 Patch13: %{name}-memory.patch
51 Patch14: %{name}-dhclient-decline-backoff.patch
52 Patch15: %{name}-unicast-bootp.patch
53 Patch16: %{name}-fast-timeout.patch
54 Patch17: %{name}-failover-ports.patch
55 Patch18: %{name}-dhclient-usage.patch
56 Patch19: %{name}-default-requested-options.patch
57 Patch20: %{name}-xen-checksum.patch
58 Patch21: %{name}-dhclient-anycast.patch
59 Patch22: %{name}-manpages.patch
60 Patch23: %{name}-NetworkManager-crash.patch
61 URL: http://www.isc.org/sw/dhcp/
62 BuildRequires: autoconf
63 BuildRequires: automake
65 BuildRequires: libtool
66 %{?with_ldap:BuildRequires: openldap-devel}
67 %{?with_ldap:BuildRequires: openssl-devel}
68 BuildRequires: rpmbuild(macros) >= 1.304
69 Requires(post): coreutils
70 Requires(post,preun): /sbin/chkconfig
71 Requires: rc-scripts >= 0.2.0
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define _sbindir /sbin
76 %define schemadir /usr/share/openldap/schema
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.
85 %description -l es.UTF-8
86 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
87 direcciones IP alocadas dinámicamente, permite también descubrir
88 información sobre la red en que están conectados. BOOTP provee una
89 funcionalidad similar, con ciertas restricciones. Este servidor
92 %description -l pl.UTF-8
93 Serwer DHCP (Dynamic Host Configuration Protocol).
95 DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
96 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
97 rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
100 %description -l pt_BR.UTF-8
101 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
102 endereços IP alocados dinamicamente, permite também descobrir
103 informações sobre a rede em que estão conectados. BOOTP provê uma
104 funcionalidade similar, com certas restrições. Este servidor também
105 atende aquelas requisições. Esta versão é ainda considerada um
108 %package -n openldap-schema-dhcp
109 Summary: LDAP Schema for DHCP Server
110 Summary(pl.UTF-8): Schemat LDAP dla serwera DHCP
111 Group: Networking/Daemons
112 Requires(post,postun): sed >= 4.0
113 Requires: openldap-servers
115 %description -n openldap-schema-dhcp
116 This package contains LDAPv3 schema for use with the DHCP Server.
118 %description -n openldap-schema-dhcp -l pl.UTF-8
119 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
123 Summary(pl.UTF-8): Klient DHCP
124 Group: Networking/Daemons
131 Dynamic Host Configuration Protocol Client.
133 %description client -l pl.UTF-8
134 Klient DHCP (Dynamic Host Configuration Protocol).
137 Summary: DHCP Relay Agent
138 Summary(pl.UTF-8): Agent przekazywania informacji DHCP
139 Group: Networking/Daemons
140 Requires(post): coreutils
141 Requires(post,preun): /sbin/chkconfig
142 Requires: rc-scripts >= 0.2.0
145 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
146 with DHCP clients to "relay" their requests to a subnet that has a
147 DHCP server on it. Because DHCP packets can be broadcast, they will
148 not be routed off of the local subnet. The DHCP relay takes care of
151 %description relay -l pl.UTF-8
152 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
153 podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
154 rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
158 Summary: DHCP development includes and libs
159 Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
160 Group: Development/Libraries
163 Includes OMAPI and dhcptl libraries.
165 OMAPI is an programming layer designed for controlling remote
166 applications, and for querying them for their state. It is currently
167 used by the ISC DHCP server.
169 The dhcpctl set of functions provide an API that can be used to
170 communicate with and manipulate a running ISC DHCP server.
172 %description devel -l pl.UTF-8
173 Zawiera biblioteki OMAPI oraz dhcpctl.
175 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
176 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
178 dhcpctl to zbiór funkcji tworzących API, które może być używane do
179 komunikacji z działającym serwerem ISC DHCP i jego kontroli.
181 %package -n libdhcp4client
182 Summary: The DHCP client in a library for invocation by other programs
183 Summary(pl.UTF-8): Klient DHCP w postaci biblioteki do wykorzystania w innych programach
184 Group: Development/Libraries
186 %description -n libdhcp4client
187 Provides the client for the DHCP protocol.
189 %description -n libdhcp4client -l pl.UTF-8
190 Ten pakiet zawiera klienta protokołu DHCP.
192 %package -n libdhcp4client-devel
193 Summary: Header files for development with the DHCP client library
194 Summary(pl.UTF-8): Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP
196 Group: Development/Libraries
197 Requires: libdhcp4client = %{epoch}:%{version}-%{release}
199 %description -n libdhcp4client-devel
200 Header files for development with the DHCP client library.
202 %description -n libdhcp4client-devel -l pl.UTF-8
203 Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej
206 %package -n libdhcp4client-static
207 Summary: Static DHCP client library
208 Summary(pl.UTF-8): Statyczna biblioteka kliencka DHCP
209 Group: Development/Libraries
210 Requires: libdhcp4client-devel = %{epoch}:%{version}-%{release}
212 %description -n libdhcp4client-static
213 Static DHCP client library.
215 %description -n libdhcp4client-static -l pl.UTF-8
216 Statyczna biblioteka kliencka DHCP.
222 %{?with_ldap:%patch2 -p1}
223 # These two patches are required for dhcdbd to function
225 # CHECK ME: adds -x (formerly -y):
226 #The -x argument enables extended option information to be created in the
227 #-s dhclient-script environment, which would allow applications running
228 #in that environment to handle options they do not know about in advance -
229 #this is a Red Hat extension to support dhcdbd and NetworkManager.
250 # Copy in documentation and example scripts for LDAP patch to dhcpd
251 cp -a %{SOURCE11} README.ldap
252 cp -a %{SOURCE12} doc
253 cp -a %{SOURCE13} contrib
255 # Copy in the libdhcp4client headers and Makefile.dist
256 install -d libdhcp4client
257 cp %{SOURCE7} libdhcp4client/dhcp4client.h
258 cp %{SOURCE8} libdhcp4client/Makefile.dist
260 # Copy in libdhcp_control.h to the isc-dhcp includes directory
261 cp %{SOURCE9} includes/isc-dhcp/libdhcp_control.h
263 # Replace @PRODUCTNAME@
264 %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' common/dhcp-options.5
265 %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' configure.ac
267 # Update paths in all man pages
268 for page in client/dhclient.conf.5 client/dhclient.leases.5 client/dhclient-script.8 client/dhclient.8; do
269 %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
270 -e 's|RUNDIR|%{_localstatedir}/run|g' \
271 -e 's|DBDIR|%{_localstatedir}/db/dhclient|g' \
272 -e 's|ETCDIR|%{_sysconfdir}|g' $page
275 for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8; do
276 %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
277 -e 's|RUNDIR|%{_localstatedir}/run|g' \
278 -e 's|DBDIR|%{_localstatedir}/db/dhcpd|g' \
279 -e 's|ETCDIR|%{_sysconfdir}|g' $page
282 sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE5} > libdhcp4client.pc
290 CFLAGS="%{rpmcflags} -fPIC"
292 %{!?with_static_libs:--disable-static} \
294 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
295 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
296 --with-srv-pid-file=/var/run/dhcpd.pid \
297 --with-cli-pid-file=/var/run/dhclient.pid \
298 --with-relay-pid-file=/var/run/dhcrelay.pid
302 rm -rf $RPM_BUILD_ROOT
303 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_pkgconfigdir},/var/lib/{dhcpd,dhclient}}
306 DESTDIR=$RPM_BUILD_ROOT
308 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
309 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd6
310 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
311 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
312 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
313 install %{SOURCE14} $RPM_BUILD_ROOT/sbin/dhclient-script
315 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
318 install -d $RPM_BUILD_ROOT%{schemadir}
319 install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir}
322 # Install headers for libdhcp4client-devel
323 install -d $RPM_BUILD_ROOT%{_includedir}/dhcp4client/minires
324 for hdr in cdefs.h ctrace.h dhcp.h dhcp6.h dhcpd.h dhctoken.h failover.h \
325 heap.h inet.h minires/minires.h minires/res_update.h \
326 minires/resolv.h osdep.h site.h statement.h tree.h; do
327 install -p -m 0644 includes/${hdr} $RPM_BUILD_ROOT%{_includedir}/dhcp4client/${hdr}
330 touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
332 touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd.leases
333 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
335 touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd6.leases
336 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient6.leases
338 # Install pkg-config file
339 install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc
340 cp -a includes/isc-dhcp/libdhcp_control.h $RPM_BUILD_ROOT%{_includedir}/isc-dhcp
342 %if %{with static_libs}
343 # HACK: strip doesn't like .a inside .a
344 install -d stripworkdir
346 for a in $RPM_BUILD_ROOT%{_libdir}/*.a; do
347 archives=$(ar t $a | grep '\.a$' || :)
348 [ "$archives" ] || continue
350 # hope we don't have to recurse here
351 for ar in $archives; do
363 rm -rf $RPM_BUILD_ROOT
366 touch /var/lib/dhcpd/dhcpd.leases
367 /sbin/chkconfig --add dhcpd
368 %service dhcpd restart "dhcpd daemon"
369 /sbin/chkconfig --add dhcpd6
370 %service dhcpd6 restart "dhcpd IPv6 daemon"
373 if [ "$1" = "0" ];then
375 /sbin/chkconfig --del dhcpd
377 /sbin/chkconfig --del dhcpd6
380 %triggerpostun -- dhcp < 3.0
381 if ! grep -q ddns-update-style /etc/dhcpd.conf; then
382 %{__sed} -i -e '1iddns-update-style none;' /etc/dhcpd.conf
385 %post -n openldap-schema-dhcp
386 %openldap_schema_register %{schemadir}/dhcp.schema -d core
387 %service -q ldap restart
389 %postun -n openldap-schema-dhcp
390 if [ "$1" = "0" ]; then
391 %openldap_schema_unregister %{schemadir}/dhcp.schema
392 %service -q ldap restart
396 /sbin/chkconfig --add dhcp-relay
397 if [ -f /var/lock/subsys/dhcrelay ]; then
398 mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
400 %service dhcp-relay restart "dhcrelay daemon"
403 if [ "$1" = "0" ];then
404 %service dhcp-relay stop
405 /sbin/chkconfig --del dhcp-relay
408 %post -n libdhcp4client -p /sbin/ldconfig
409 %postun -n libdhcp4client -p /sbin/ldconfig
412 %defattr(644,root,root,755)
413 %doc doc/* README RELNOTES server/dhcpd.conf LICENSE contrib/ms2isc
414 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
415 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
416 %attr(755,root,root) %{_bindir}/omshell
417 %attr(755,root,root) %{_sbindir}/dhcpd
418 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
419 %attr(754,root,root) /etc/rc.d/init.d/dhcpd6
420 %attr(750,root,root) %dir /var/lib/dhcpd
421 %ghost /var/lib/dhcpd/dhcpd.leases
422 %ghost /var/lib/dhcpd/dhcpd6.leases
423 %{_mandir}/man1/omshell.1*
424 %{_mandir}/man5/dhcp-eval.5*
425 %{_mandir}/man5/dhcp-options.5*
426 %{_mandir}/man5/dhcpd.conf.5*
427 %{_mandir}/man5/dhcpd.leases.5*
428 %{_mandir}/man8/dhcpd.8*
431 %defattr(644,root,root,755)
432 %doc contrib/sethostname.sh client/dhclient.conf
433 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
434 %attr(755,root,root) /sbin/dhclient
435 %attr(755,root,root) /sbin/dhclient-script
436 %{_mandir}/man5/dhclient.conf.5*
437 %{_mandir}/man5/dhclient.leases.5*
438 %{_mandir}/man8/dhclient.8*
439 %{_mandir}/man8/dhclient-script.8*
440 %dir %attr(750,root,root) /var/lib/dhclient
441 %ghost /var/lib/dhclient/dhclient.leases
442 %ghost /var/lib/dhclient/dhclient6.leases
445 %defattr(644,root,root,755)
446 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
447 %attr(755,root,root) %{_sbindir}/dhcrelay
448 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
449 %{_mandir}/man8/dhcrelay.8*
452 %defattr(644,root,root,755)
453 %{_libdir}/libdhcpctl.a
455 %{_libdir}/libomapi.a
456 %{_includedir}/dhcpctl
457 %{_includedir}/isc-dhcp
458 %{_includedir}/omapip
459 %{_mandir}/man3/dhcpctl.3*
460 %{_mandir}/man3/omapi.3*
462 %files -n libdhcp4client
463 %defattr(644,root,root,755)
464 %attr(755,root,root) %{_libdir}/libdhcp4client-*.so.*
466 %files -n libdhcp4client-devel
467 %defattr(644,root,root,755)
468 %attr(755,root,root) %{_libdir}/libdhcp4client.so
469 %{_includedir}/dhcp4client
470 %{_pkgconfigdir}/libdhcp4client.pc
471 %{_libdir}/libdhcp4client.la
473 %if %{with static_libs}
474 %files -n libdhcp4client-static
475 %defattr(644,root,root,755)
476 %{_libdir}/libdhcp4client.a
480 %files -n openldap-schema-dhcp
481 %defattr(644,root,root,755)
482 %{schemadir}/dhcp.schema