3 %bcond_without ldap # without support for ldap storage
4 %bcond_without static_libs # don't build static library
7 Summary(es.UTF-8): Servidor DHCP
8 Summary(pl.UTF-8): Serwer DHCP
9 Summary(pt_BR.UTF-8): Servidor DHCP (Protocolo de configuração dinâmica de hosts)
13 # don't put int release until all patches are updated/ported(!)
17 Group: Networking/Daemons
18 Source0: ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
19 # Source0-md5: 31d79b27ce4a94089a0b9ce7f72307fa
21 Source2: %{name}6.init
22 Source3: %{name}-relay.init
23 Source4: %{name}.sysconfig
24 Source5: %{name}-relay.sysconfig
25 Source6: %{name}-libdhcp4client.pc
26 Source7: %{name}-dhcp4client.h
27 Source8: %{name}-libdhcp4client.make
28 Source9: %{name}-libdhcp_control.h
29 Source10: %{name}.schema
30 Patch0: %{name}-dhclient.script.patch
31 Patch1: %{name}-release-by-ifup.patch
33 Patch2: %{name}-ldap.patch
34 Patch3: %{name}-client-script-redhat.patch
35 Patch4: %{name}-3.0.3-x-option.patch
36 Patch5: %{name}-paths.patch
37 Patch6: %{name}-arg-concat.patch
38 Patch7: %{name}-split-VARDB.patch
39 Patch8: %{name}-timeouts.patch
40 Patch9: %{name}-options.patch
41 Patch10: %{name}-libdhcp4client.patch
42 Patch11: %{name}-prototypes.patch
43 URL: http://www.isc.org/sw/dhcp/
44 BuildRequires: autoconf
45 BuildRequires: automake
46 BuildRequires: libtool
48 %{?with_ldap:BuildRequires: openldap-devel}
49 %{?with_ldap:BuildRequires: openssl-devel}
50 BuildRequires: rpmbuild(macros) >= 1.304
51 Requires(post): coreutils
52 Requires(post,preun): /sbin/chkconfig
53 Requires: rc-scripts >= 0.2.0
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 %define _sbindir /sbin
58 %define schemadir /usr/share/openldap/schema
61 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
62 individual devices on an IP network to get their own network
63 configuration information (IP address, subnetmask, broadcast address,
64 etc.) from a DHCP server. The overall purpose of DHCP is to make it
65 easier to administer a large network.
67 %description -l es.UTF-8
68 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
69 direcciones IP alocadas dinámicamente, permite también descubrir
70 información sobre la red en que están conectados. BOOTP provee una
71 funcionalidad similar, con ciertas restricciones. Este servidor
74 %description -l pl.UTF-8
75 Serwer DHCP (Dynamic Host Configuration Protocol).
77 DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
78 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
79 rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
82 %description -l pt_BR.UTF-8
83 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
84 endereços IP alocados dinamicamente, permite também descobrir
85 informações sobre a rede em que estão conectados. BOOTP provê uma
86 funcionalidade similar, com certas restrições. Este servidor também
87 atende aquelas requisições. Esta versão é ainda considerada um
90 %package -n openldap-schema-dhcp
91 Summary: LDAP Schema for DHCP Server
92 Summary(pl.UTF-8): Schemat LDAP dla serwera DHCP
93 Group: Networking/Daemons
94 Requires(post,postun): sed >= 4.0
95 Requires: openldap-servers
97 %description -n openldap-schema-dhcp
98 This package contains LDAPv3 schema for use with the DHCP Server.
100 %description -n openldap-schema-dhcp -l pl.UTF-8
101 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
105 Summary(pl.UTF-8): Klient DHCP
106 Group: Networking/Daemons
113 Dynamic Host Configuration Protocol Client.
115 %description client -l pl.UTF-8
116 Klient DHCP (Dynamic Host Configuration Protocol).
119 Summary: DHCP Relay Agent
120 Summary(pl.UTF-8): Agent przekazywania informacji DHCP
121 Group: Networking/Daemons
122 Requires(post): coreutils
123 Requires(post,preun): /sbin/chkconfig
124 Requires: rc-scripts >= 0.2.0
127 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
128 with DHCP clients to "relay" their requests to a subnet that has a
129 DHCP server on it. Because DHCP packets can be broadcast, they will
130 not be routed off of the local subnet. The DHCP relay takes care of
133 %description relay -l pl.UTF-8
134 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
135 podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
136 rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
140 Summary: DHCP development includes and libs
141 Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
142 Group: Development/Libraries
145 Includes OMAPI and dhcptl libraries.
147 OMAPI is an programming layer designed for controlling remote
148 applications, and for querying them for their state. It is currently
149 used by the ISC DHCP server.
151 The dhcpctl set of functions provide an API that can be used to
152 communicate with and manipulate a running ISC DHCP server.
154 %description devel -l pl.UTF-8
155 Zawiera biblioteki OMAPI oraz dhcpctl.
157 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
158 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
160 dhcpctl to zbiór funkcji tworzących API, które może być używane do
161 komunikacji z działającym serwerem ISC DHCP i jego kontroli.
163 %package -n libdhcp4client
164 Summary: The DHCP client in a library for invocation by other programs
165 Summary(pl.UTF-8): Klient DHCP w postaci biblioteki do wykorzystania w innych programach
166 Group: Development/Libraries
168 %description -n libdhcp4client
169 Provides the client for the DHCP protocol.
171 %description -n libdhcp4client -l pl.UTF-8
172 Ten pakiet zawiera klienta protokołu DHCP.
174 %package -n libdhcp4client-devel
175 Summary: Header files for development with the DHCP client library
176 Summary(pl.UTF-8): Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP
177 Group: Development/Libraries
179 Requires: libdhcp4client = %{epoch}:%{version}-%{release}
181 %description -n libdhcp4client-devel
182 Header files for development with the DHCP client library.
184 %description -n libdhcp4client-devel -l pl.UTF-8
185 Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP.
187 %package -n libdhcp4client-static
188 Summary: Static DHCP client library
189 Summary(pl.UTF-8): Statyczna biblioteka kliencka DHCP
190 Group: Development/Libraries
191 Requires: libdhcp4client-devel = %{epoch}:%{version}-%{release}
193 %description -n libdhcp4client-static
194 Static DHCP client library.
196 %description -n libdhcp4client-static -l pl.UTF-8
197 Statyczna biblioteka kliencka DHCP.
203 %{?with_ldap:%patch2 -p1}
204 # These two patches are required for dhcdbd to function
217 sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE5} > libdhcp4client.pc
218 mkdir -p libdhcp4client
219 cp %{SOURCE7} libdhcp4client/dhcp4client.h
220 cp %{SOURCE8} libdhcp4client/Makefile.dist
221 cp %{SOURCE9} includes/isc-dhcp/libdhcp_control.h
229 CFLAGS="%{rpmcflags} -fPIC"
231 %{!?with_static_libs:--disable-static} \
233 --with-srv-lease-file="/var/lib/%{name}/dhcpd.leases" \
234 --with-cli-lease-file="/var/lib/dhclient/dhclient.leases"
238 rm -rf $RPM_BUILD_ROOT
239 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{schemadir},%{_pkgconfigdir},/var/lib/{%{name},dhclient}}
242 DESTDIR=$RPM_BUILD_ROOT
244 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
245 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd6
246 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
247 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
248 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
250 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
252 install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir}
255 # Install headers for libdhcp4client-devel
256 install -d $RPM_BUILD_ROOT%{_includedir}/dhcp4client/minires
257 install -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_includedir}/dhcp4client
258 for hdr in cdefs.h ctrace.h dhcp.h dhcp6.h dhcpd.h dhctoken.h failover.h \
259 heap.h inet.h minires/minires.h minires/res_update.h \
260 minires/resolv.h osdep.h site.h statement.h tree.h ; do
261 install -p -m 0644 includes/${hdr} $RPM_BUILD_ROOT%{_includedir}/dhcp4client/${hdr}
264 touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
266 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
267 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
269 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd6.leases
270 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient6.leases
272 install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc
274 %if %{with static_libs}
275 # HACK: strip doesn't like .a inside .a
276 mkdir -p stripworkdir
278 for a in $RPM_BUILD_ROOT%{_libdir}/*.a; do
279 archives=$(ar t $a | grep '\.a$' || :)
280 [ "$archives" ] || continue
282 # hope we don't have to recurse here
283 for ar in $archives; do
295 rm -rf $RPM_BUILD_ROOT
298 /sbin/chkconfig --add dhcpd
299 /sbin/chkconfig --add dhcpd6
300 touch /var/lib/%{name}/dhcpd.leases
301 %service dhcpd restart "dhcpd daemon"
302 %service dhcpd6 restart "dhcpd IPv6 daemon"
305 if [ "$1" = "0" ];then
308 /sbin/chkconfig --del dhcpd
309 /sbin/chkconfig --del dhcpd6
312 %triggerpostun -- dhcp < 3.0
313 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
315 echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
316 echo "" >> /etc/dhcpd.conf.tmp
317 cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
318 mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf
321 %post -n openldap-schema-dhcp
322 %openldap_schema_register %{schemadir}/dhcp.schema -d core
323 %service -q ldap restart
325 %postun -n openldap-schema-dhcp
326 if [ "$1" = "0" ]; then
327 %openldap_schema_unregister %{schemadir}/dhcp.schema
328 %service -q ldap restart
332 if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
333 mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
337 /sbin/chkconfig --add dhcp-relay
338 if [ -f /var/lock/subsys/dhcrelay ]; then
339 mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
341 %service dhcp-relay restart "dhcrelay daemon"
344 if [ "$1" = "0" ];then
345 %service dhcp-relay stop
346 /sbin/chkconfig --del dhcp-relay
349 %post -n libdhcp4client -p /sbin/ldconfig
350 %postun -n libdhcp4client -p /sbin/ldconfig
353 %defattr(644,root,root,755)
354 %doc doc/* README RELNOTES server/dhcpd.conf LICENSE contrib/ms2isc
355 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
356 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
357 %attr(755,root,root) %{_bindir}/omshell
358 %attr(755,root,root) %{_sbindir}/dhcpd
359 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
360 %attr(754,root,root) /etc/rc.d/init.d/dhcpd6
361 %attr(750,root,root) %dir /var/lib/%{name}
362 %ghost /var/lib/%{name}/dhcpd.leases
363 %ghost /var/lib/%{name}/dhcpd6.leases
364 %{_mandir}/man1/omshell.1*
365 %{_mandir}/man5/dhcp-eval.5*
366 %{_mandir}/man5/dhcp-options.5*
367 %{_mandir}/man5/dhcpd.conf.5*
368 %{_mandir}/man5/dhcpd.leases.5*
369 %{_mandir}/man8/dhcpd.8*
372 %files -n openldap-schema-dhcp
373 %defattr(644,root,root,755)
374 %{schemadir}/dhcp.schema
378 %defattr(644,root,root,755)
379 %doc contrib/sethostname.sh
380 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
381 %attr(755,root,root) /sbin/dhclient
382 #%attr(755,root,root) /sbin/dhclient-script
383 %{_mandir}/man5/dhclient.conf.5*
384 %{_mandir}/man5/dhclient.leases.5*
385 %{_mandir}/man8/dhclient.8*
386 %{_mandir}/man8/dhclient-script.8*
387 %attr(750,root,root) %dir /var/lib/dhclient
388 %ghost /var/lib/dhclient/dhclient.leases
389 %ghost /var/lib/dhclient/dhclient6.leases
392 %defattr(644,root,root,755)
393 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
394 %attr(755,root,root) %{_sbindir}/dhcrelay
395 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
396 %{_mandir}/man8/dhcrelay.8*
399 %defattr(644,root,root,755)
400 %{_libdir}/libdhcpctl.a
402 %{_libdir}/libomapi.a
403 %{_includedir}/dhcpctl
404 %{_includedir}/isc-dhcp
405 %{_includedir}/omapip
406 %{_mandir}/man3/dhcpctl.3*
407 %{_mandir}/man3/omapi.3*
409 %files -n libdhcp4client
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_libdir}/libdhcp4client-*.so.*
413 %files -n libdhcp4client-devel
414 %defattr(644,root,root,755)
415 %attr(755,root,root) %{_libdir}/libdhcp4client.so
416 %{_includedir}/dhcp4client
417 %{_pkgconfigdir}/libdhcp4client.pc
418 %{_libdir}/libdhcp4client.la
420 %if %{with static_libs}
421 %files -n libdhcp4client-static
422 %defattr(644,root,root,755)
423 %{_libdir}/libdhcp4client.a