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