]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
- patch no-ipv6 - don't require ipv6 support in kernel
[packages/dhcp.git] / dhcp.spec
1 #
2 # Conditional build:
3 %bcond_without  ldap    # without support for ldap storage
4 %bcond_without  static_libs     # don't build static library
5
6 # vendor string
7 %define vvendor PLD/Linux
8 #
9 Summary:        DHCP Server
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)
13 Name:           dhcp
14 # 4.1.0a1 is on DEVEL
15 Version:        4.0.0
16 Release:        6
17 Epoch:          4
18 License:        MIT
19 Group:          Networking/Daemons
20 Source0:        ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
21 # Source0-md5:  31d79b27ce4a94089a0b9ce7f72307fa
22 Source1:        %{name}.init
23 Source2:        %{name}6.init
24 Source3:        %{name}-relay.init
25 Source4:        %{name}.sysconfig
26 Source5:        %{name}-relay.sysconfig
27 Source6:        %{name}-libdhcp4client.pc
28 Source7:        %{name}-dhcp4client.h
29 Source8:        %{name}-libdhcp4client.make
30 Source9:        %{name}-libdhcp_control.h
31 Source10:       %{name}.schema
32 Source11:       %{name}-README.ldap
33 Source12:       draft-ietf-dhc-ldap-schema-01.txt
34 Source13:       dhcpd-conf-to-ldap
35 Source14:       dhcp-dhclient-script
36 Patch0:         %{name}-release-by-ifup.patch
37 # from fedora 9-dev
38 Patch1:         %{name}-ldap.patch
39 Patch2:         %{name}-3.0.3-x-option.patch
40 Patch3:         %{name}-paths.patch
41 Patch4:         %{name}-arg-concat.patch
42 Patch5:         %{name}-timeouts.patch
43 Patch6:         %{name}-options.patch
44 Patch7:         %{name}-libdhcp4client.patch
45 Patch8:         %{name}-prototypes.patch
46 Patch9:         %{name}-errwarn-message.patch
47 Patch10:        %{name}-memory.patch
48 Patch11:        %{name}-dhclient-decline-backoff.patch
49 Patch12:        %{name}-unicast-bootp.patch
50 Patch13:        %{name}-fast-timeout.patch
51 Patch14:        %{name}-failover-ports.patch
52 Patch15:        %{name}-dhclient-usage.patch
53 Patch16:        %{name}-default-requested-options.patch
54 Patch17:        %{name}-xen-checksum.patch
55 Patch18:        %{name}-dhclient-anycast.patch
56 Patch19:        %{name}-manpages.patch
57 Patch20:        %{name}-NetworkManager-crash.patch
58 Patch21:        %{name}-no-ipv6.patch
59 URL:            http://www.isc.org/sw/dhcp/
60 BuildRequires:  autoconf
61 BuildRequires:  automake
62 BuildRequires:  groff
63 BuildRequires:  libtool
64 %{?with_ldap:BuildRequires:     openldap-devel}
65 %{?with_ldap:BuildRequires:     openssl-devel}
66 BuildRequires:  rpmbuild(macros) >= 1.304
67 Requires(post): coreutils
68 Requires(post,preun):   /sbin/chkconfig
69 Requires:       rc-scripts >= 0.2.0
70 Provides:       dhcpd
71 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73 %define         _sbindir        /sbin
74 %define         schemadir       /usr/share/openldap/schema
75
76 %description
77 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
78 individual devices on an IP network to get their own network
79 configuration information (IP address, subnetmask, broadcast address,
80 etc.) from a DHCP server. The overall purpose of DHCP is to make it
81 easier to administer a large network.
82
83 %description -l es.UTF-8
84 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
85 direcciones IP alocadas dinámicamente, permite también descubrir
86 información sobre la red en que están conectados. BOOTP provee una
87 funcionalidad similar, con ciertas restricciones. Este servidor
88 también las atiende.
89
90 %description -l pl.UTF-8
91 Serwer DHCP (Dynamic Host Configuration Protocol).
92
93 DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
94 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
95 rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
96 dużymi sieciami IP.
97
98 %description -l pt_BR.UTF-8
99 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
100 endereços IP alocados dinamicamente, permite também descobrir
101 informações sobre a rede em que estão conectados. BOOTP provê uma
102 funcionalidade similar, com certas restrições. Este servidor também
103 atende aquelas requisições. Esta versão é ainda considerada um
104 software BETA.
105
106 %package -n openldap-schema-dhcp
107 Summary:        LDAP Schema for DHCP Server
108 Summary(pl.UTF-8):      Schemat LDAP dla serwera DHCP
109 Group:          Networking/Daemons
110 Requires(post,postun):  sed >= 4.0
111 Requires:       openldap-servers
112
113 %description -n openldap-schema-dhcp
114 This package contains LDAPv3 schema for use with the DHCP Server.
115
116 %description -n openldap-schema-dhcp -l pl.UTF-8
117 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
118
119 %package client
120 Summary:        DHCP Client
121 Summary(pl.UTF-8):      Klient DHCP
122 Group:          Networking/Daemons
123 Requires:       coreutils
124 Requires:       iproute2
125 Requires:       net-tools
126 Obsoletes:      dhclient
127
128 %description client
129 Dynamic Host Configuration Protocol Client.
130
131 %description client -l pl.UTF-8
132 Klient DHCP (Dynamic Host Configuration Protocol).
133
134 %package relay
135 Summary:        DHCP Relay Agent
136 Summary(pl.UTF-8):      Agent przekazywania informacji DHCP
137 Group:          Networking/Daemons
138 Requires(post): coreutils
139 Requires(post,preun):   /sbin/chkconfig
140 Requires:       rc-scripts >= 0.2.0
141
142 %description relay
143 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
144 with DHCP clients to "relay" their requests to a subnet that has a
145 DHCP server on it. Because DHCP packets can be broadcast, they will
146 not be routed off of the local subnet. The DHCP relay takes care of
147 this for the client.
148
149 %description relay -l pl.UTF-8
150 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
151 podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
152 rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
153 podsieci.
154
155 %package devel
156 Summary:        DHCP development includes and libs
157 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
158 Group:          Development/Libraries
159
160 %description devel
161 Includes OMAPI and dhcptl libraries.
162
163 OMAPI is an programming layer designed for controlling remote
164 applications, and for querying them for their state. It is currently
165 used by the ISC DHCP server.
166
167 The dhcpctl set of functions provide an API that can be used to
168 communicate with and manipulate a running ISC DHCP server.
169
170 %description devel -l pl.UTF-8
171 Zawiera biblioteki OMAPI oraz dhcpctl.
172
173 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
174 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
175
176 dhcpctl to zbiór funkcji tworzących API, które może być używane do
177 komunikacji z działającym serwerem ISC DHCP i jego kontroli.
178
179 %package -n libdhcp4client
180 Summary:        The DHCP client in a library for invocation by other programs
181 Summary(pl.UTF-8):      Klient DHCP w postaci biblioteki do wykorzystania w innych programach
182 Group:          Development/Libraries
183
184 %description -n libdhcp4client
185 Provides the client for the DHCP protocol.
186
187 %description -n libdhcp4client -l pl.UTF-8
188 Ten pakiet zawiera klienta protokołu DHCP.
189
190 %package -n libdhcp4client-devel
191 Summary:        Header files for development with the DHCP client library
192 Summary(pl.UTF-8):      Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP
193 License:        GPL v2+
194 Group:          Development/Libraries
195 Requires:       libdhcp4client = %{epoch}:%{version}-%{release}
196
197 %description -n libdhcp4client-devel
198 Header files for development with the DHCP client library.
199
200 %description -n libdhcp4client-devel -l pl.UTF-8
201 Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej
202 DHCP.
203
204 %package -n libdhcp4client-static
205 Summary:        Static DHCP client library
206 Summary(pl.UTF-8):      Statyczna biblioteka kliencka DHCP
207 Group:          Development/Libraries
208 Requires:       libdhcp4client-devel = %{epoch}:%{version}-%{release}
209
210 %description -n libdhcp4client-static
211 Static DHCP client library.
212
213 %description -n libdhcp4client-static -l pl.UTF-8
214 Statyczna biblioteka kliencka DHCP.
215
216 %prep
217 %setup -q
218 %patch0 -p1
219 %{?with_ldap:%patch1 -p1}
220 # This patch is required for dhcdbd to function
221 # CHECK ME: adds -x (formerly -y):
222 #The -x argument enables extended option information to be created in the
223 #-s dhclient-script environment, which would allow applications running
224 #in that environment to handle options they do not know about in advance -
225 #this is a Red Hat extension to support dhcdbd and NetworkManager.
226 # however, fedora doesn't have this patch anymore, so can drop?
227 #%%patch2 -p1
228 %patch3 -p1
229 %patch4 -p1
230 %patch5 -p1
231 %patch6 -p1
232 %patch7 -p1
233 %patch8 -p1
234 %patch9 -p1
235 %patch10 -p1
236 %patch11 -p1
237 %patch12 -p1
238 %patch13 -p1
239 %patch14 -p1
240 %patch15 -p1
241 %patch16 -p1
242 %patch17 -p1
243 %patch18 -p1
244 %patch19 -p1
245 %patch20 -p1
246 %patch21 -p1
247
248 # Copy in documentation and example scripts for LDAP patch to dhcpd
249 cp -a %{SOURCE11} README.ldap
250 cp -a %{SOURCE12} doc
251 cp -a %{SOURCE13} contrib
252
253 # Copy in the libdhcp4client headers and Makefile.dist
254 install -d libdhcp4client
255 cp %{SOURCE7} libdhcp4client/dhcp4client.h
256 cp %{SOURCE8} libdhcp4client/Makefile.dist
257
258 # Copy in libdhcp_control.h to the isc-dhcp includes directory
259 cp %{SOURCE9} includes/isc-dhcp/libdhcp_control.h
260
261 # Replace @PRODUCTNAME@
262 %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' common/dhcp-options.5
263 %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' configure.ac
264
265 # Update paths in all man pages
266 for page in client/dhclient.conf.5 client/dhclient.leases.5 client/dhclient-script.8 client/dhclient.8; do
267         %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
268                         -e 's|RUNDIR|%{_localstatedir}/run|g' \
269                         -e 's|DBDIR|%{_localstatedir}/db/dhclient|g' \
270                         -e 's|ETCDIR|%{_sysconfdir}|g' $page
271 done
272
273 for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8; do
274         %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
275                                 -e 's|RUNDIR|%{_localstatedir}/run|g' \
276                                 -e 's|DBDIR|%{_localstatedir}/db/dhcpd|g' \
277                                 -e 's|ETCDIR|%{_sysconfdir}|g' $page
278 done
279
280 sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE6} > libdhcp4client.pc
281
282 %build
283 %{__libtoolize}
284 %{__aclocal}
285 %{__autoconf}
286 %{__autoheader}
287 %{__automake}
288 CFLAGS="%{rpmcflags} -fPIC -D_GNU_SOURCE=1"
289 %configure \
290         %{!?with_static_libs:--disable-static} \
291         --enable-dhcpv6 \
292     --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
293     --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
294     --with-srv-pid-file=/var/run/dhcpd.pid \
295     --with-cli-pid-file=/var/run/dhclient.pid \
296     --with-relay-pid-file=/var/run/dhcrelay.pid
297 %{__make}
298
299 %install
300 rm -rf $RPM_BUILD_ROOT
301 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_pkgconfigdir},/var/lib/{dhcpd,dhclient}}
302
303 %{__make} install \
304         DESTDIR=$RPM_BUILD_ROOT
305
306 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
307 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd6
308 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
309 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
310 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
311 install %{SOURCE14} $RPM_BUILD_ROOT/sbin/dhclient-script
312
313 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
314
315 %if %{with ldap}
316 install -d $RPM_BUILD_ROOT%{schemadir}
317 install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir}
318 %endif
319
320 # Install headers for libdhcp4client-devel
321 install -d $RPM_BUILD_ROOT%{_includedir}/dhcp4client
322 install libdhcp4client/dhcp4client.h $RPM_BUILD_ROOT%{_includedir}/dhcp4client/dhcp4client.h
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}
328 done
329
330 :> $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
331
332 touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd.leases
333 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
334
335 touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd6.leases
336 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient6.leases
337
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
341
342 %if %{with static_libs}
343 # HACK: strip doesn't like .a inside .a
344 install -d stripworkdir
345 cd stripworkdir
346 for a in $RPM_BUILD_ROOT%{_libdir}/*.a; do
347         archives=$(ar t $a | grep '\.a$' || :)
348         [ "$archives" ] || continue
349
350         # hope we don't have to recurse here
351         for ar in $archives; do
352                 rm -f *.o *.a
353                 ar x $a $ar
354                 ar x $ar
355                 ar d $a $ar
356                 ar cr $a *.o
357         done
358 done
359 cd -
360 %endif
361
362 %clean
363 rm -rf $RPM_BUILD_ROOT
364
365 %post
366 touch /var/lib/dhcpd/dhcpd.leases
367 touch /var/lib/dhcpd/dhcpd6.leases
368 /sbin/chkconfig --add dhcpd
369 %service dhcpd restart "dhcpd daemon"
370 /sbin/chkconfig --add dhcpd6
371 %service dhcpd6 restart "dhcpd IPv6 daemon"
372
373 %preun
374 if [ "$1" = "0" ];then
375         %service dhcpd stop
376         /sbin/chkconfig --del dhcpd
377         %service dhcpd6 stop
378         /sbin/chkconfig --del dhcpd6
379 fi
380
381 %triggerpostun -- dhcp < 3.0
382 if ! grep -q ddns-update-style /etc/dhcpd.conf; then
383         %{__sed} -i -e '1iddns-update-style none;' /etc/dhcpd.conf
384 fi
385
386 %post -n openldap-schema-dhcp
387 %openldap_schema_register %{schemadir}/dhcp.schema -d core
388 %service -q ldap restart
389
390 %postun -n openldap-schema-dhcp
391 if [ "$1" = "0" ]; then
392         %openldap_schema_unregister %{schemadir}/dhcp.schema
393         %service -q ldap restart
394 fi
395
396 %post relay
397 /sbin/chkconfig --add dhcp-relay
398 if [ -f /var/lock/subsys/dhcrelay ]; then
399         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
400 fi
401 %service dhcp-relay restart "dhcrelay daemon"
402
403 %preun relay
404 if [ "$1" = "0" ];then
405         %service dhcp-relay stop
406         /sbin/chkconfig --del dhcp-relay
407 fi
408
409 %post   -n libdhcp4client -p /sbin/ldconfig
410 %postun -n libdhcp4client -p /sbin/ldconfig
411
412 %files
413 %defattr(644,root,root,755)
414 %doc doc/* README RELNOTES server/dhcpd.conf LICENSE contrib/ms2isc
415 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
416 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
417 %attr(755,root,root) %{_bindir}/omshell
418 %attr(755,root,root) %{_sbindir}/dhcpd
419 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
420 %attr(754,root,root) /etc/rc.d/init.d/dhcpd6
421 %attr(750,root,root) %dir /var/lib/dhcpd
422 %ghost /var/lib/dhcpd/dhcpd.leases
423 %ghost /var/lib/dhcpd/dhcpd6.leases
424 %{_mandir}/man1/omshell.1*
425 %{_mandir}/man5/dhcp-eval.5*
426 %{_mandir}/man5/dhcp-options.5*
427 %{_mandir}/man5/dhcpd.conf.5*
428 %{_mandir}/man5/dhcpd.leases.5*
429 %{_mandir}/man8/dhcpd.8*
430
431 %files client
432 %defattr(644,root,root,755)
433 %doc contrib/sethostname.sh client/dhclient.conf
434 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
435 %attr(755,root,root) /sbin/dhclient
436 %attr(755,root,root) /sbin/dhclient-script
437 %{_mandir}/man5/dhclient.conf.5*
438 %{_mandir}/man5/dhclient.leases.5*
439 %{_mandir}/man8/dhclient.8*
440 %{_mandir}/man8/dhclient-script.8*
441 %dir %attr(750,root,root) /var/lib/dhclient
442 %ghost /var/lib/dhclient/dhclient.leases
443 %ghost /var/lib/dhclient/dhclient6.leases
444
445 %files relay
446 %defattr(644,root,root,755)
447 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
448 %attr(755,root,root) %{_sbindir}/dhcrelay
449 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
450 %{_mandir}/man8/dhcrelay.8*
451
452 %files devel
453 %defattr(644,root,root,755)
454 %{_libdir}/libdhcpctl.a
455 %{_libdir}/libdst.a
456 %{_libdir}/libomapi.a
457 %{_includedir}/dhcpctl
458 %{_includedir}/isc-dhcp
459 %{_includedir}/omapip
460 %{_mandir}/man3/dhcpctl.3*
461 %{_mandir}/man3/omapi.3*
462
463 %files -n libdhcp4client
464 %defattr(644,root,root,755)
465 %attr(755,root,root) %{_libdir}/libdhcp4client-*.so.*
466
467 %files -n libdhcp4client-devel
468 %defattr(644,root,root,755)
469 %attr(755,root,root) %{_libdir}/libdhcp4client.so
470 %{_includedir}/dhcp4client
471 %{_pkgconfigdir}/libdhcp4client.pc
472 %{_libdir}/libdhcp4client.la
473
474 %if %{with static_libs}
475 %files -n libdhcp4client-static
476 %defattr(644,root,root,755)
477 %{_libdir}/libdhcp4client.a
478 %endif
479
480 %if %{with ldap}
481 %files -n openldap-schema-dhcp
482 %defattr(644,root,root,755)
483 %{schemadir}/dhcp.schema
484 %endif
This page took 0.052987 seconds and 3 git commands to generate.