]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
- update from fedora r1.7
[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 Summary:        DHCP Server
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)
10 Name:           dhcp
11 # 4.1.0a1 is on DEVEL
12 Version:        4.0.0
13 # don't put int release until all patches are updated/ported(!)
14 Release:        0.1
15 Epoch:          4
16 License:        MIT
17 Group:          Networking/Daemons
18 Source0:        ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
19 # Source0-md5:  31d79b27ce4a94089a0b9ce7f72307fa
20 Source1:        %{name}.init
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
32 # from fedora 9-dev
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
47 BuildRequires:  groff
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
54 Provides:       dhcpd
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %define         _sbindir        /sbin
58 %define         schemadir       /usr/share/openldap/schema
59
60 %description
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.
66
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
72 también las atiende.
73
74 %description -l pl.UTF-8
75 Serwer DHCP (Dynamic Host Configuration Protocol).
76
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
80 dużymi sieciami IP.
81
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
88 software BETA.
89
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
96
97 %description -n openldap-schema-dhcp
98 This package contains LDAPv3 schema for use with the DHCP Server.
99
100 %description -n openldap-schema-dhcp -l pl.UTF-8
101 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
102
103 %package client
104 Summary:        DHCP Client
105 Summary(pl.UTF-8):      Klient DHCP
106 Group:          Networking/Daemons
107 Requires:       coreutils
108 Requires:       iproute2
109 Requires:       net-tools
110 Obsoletes:      dhclient
111
112 %description client
113 Dynamic Host Configuration Protocol Client.
114
115 %description client -l pl.UTF-8
116 Klient DHCP (Dynamic Host Configuration Protocol).
117
118 %package relay
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
125
126 %description relay
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
131 this for the client.
132
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
137 podsieci.
138
139 %package devel
140 Summary:        DHCP development includes and libs
141 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
142 Group:          Development/Libraries
143
144 %description devel
145 Includes OMAPI and dhcptl libraries.
146
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.
150
151 The dhcpctl set of functions provide an API that can be used to
152 communicate with and manipulate a running ISC DHCP server.
153
154 %description devel -l pl.UTF-8
155 Zawiera biblioteki OMAPI oraz dhcpctl.
156
157 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
158 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
159
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.
162
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
167
168 %description -n libdhcp4client
169 Provides the client for the DHCP protocol.
170
171 %description -n libdhcp4client -l pl.UTF-8
172 Ten pakiet zawiera klienta protokołu DHCP.
173
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
178 License:        GPL v2+
179 Requires:       libdhcp4client = %{epoch}:%{version}-%{release}
180
181 %description -n libdhcp4client-devel
182 Header files for development with the DHCP client library.
183
184 %description -n libdhcp4client-devel -l pl.UTF-8
185 Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP.
186
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}
192
193 %description -n libdhcp4client-static
194 Static DHCP client library.
195
196 %description -n libdhcp4client-static -l pl.UTF-8
197 Statyczna biblioteka kliencka DHCP.
198
199 %prep
200 %setup -q
201 %patch0 -p1
202 %patch1 -p1
203 %{?with_ldap:%patch2 -p1}
204 # These two patches are required for dhcdbd to function
205 %patch3 -p1
206 # CHECK ME, NO IDEA
207 #%patch4 -p1
208 %patch5 -p1
209 %patch6 -p1
210 # CHECK ME, NO IDEA
211 #%patch7 -p1
212 %patch8 -p1
213 %patch9 -p1
214 %patch10 -p1
215 %patch11 -p1
216
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
222
223 %build
224 %{__libtoolize}
225 %{__aclocal}
226 %{__autoconf}
227 %{__autoheader}
228 %{__automake}
229 CFLAGS="%{rpmcflags} -fPIC"
230 %configure \
231         %{!?with_static_libs:--disable-static} \
232         --enable-dhcpv6 \
233         --with-srv-lease-file="/var/lib/%{name}/dhcpd.leases" \
234         --with-cli-lease-file="/var/lib/dhclient/dhclient.leases"
235 %{__make}
236
237 %install
238 rm -rf $RPM_BUILD_ROOT
239 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{schemadir},%{_pkgconfigdir},/var/lib/{%{name},dhclient}}
240
241 %{__make} install \
242         DESTDIR=$RPM_BUILD_ROOT
243
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
249
250 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
251 %if %{with ldap}
252 install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir}
253 %endif
254
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}
262 done
263
264 touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
265
266 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
267 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
268
269 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd6.leases
270 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient6.leases
271
272 install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc
273
274 %if %{with static_libs}
275 # HACK: strip doesn't like .a inside .a
276 mkdir -p stripworkdir
277 cd stripworkdir
278 for a in $RPM_BUILD_ROOT%{_libdir}/*.a; do
279         archives=$(ar t $a | grep '\.a$' || :)
280         [ "$archives" ] || continue
281
282         # hope we don't have to recurse here
283         for ar in $archives; do
284                 rm -f *.o *.a
285                 ar x $a $ar
286                 ar x $ar
287                 ar d $a $ar
288                 ar cr $a *.o
289         done
290 done
291 cd -
292 %endif
293
294 %clean
295 rm -rf $RPM_BUILD_ROOT
296
297 %post
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"
303
304 %preun
305 if [ "$1" = "0" ];then
306         %service dhcpd stop
307         %service dhcpd6 stop
308         /sbin/chkconfig --del dhcpd
309         /sbin/chkconfig --del dhcpd6
310 fi
311
312 %triggerpostun -- dhcp < 3.0
313 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
314         umask 027
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
319 fi
320
321 %post -n openldap-schema-dhcp
322 %openldap_schema_register %{schemadir}/dhcp.schema -d core
323 %service -q ldap restart
324
325 %postun -n openldap-schema-dhcp
326 if [ "$1" = "0" ]; then
327         %openldap_schema_unregister %{schemadir}/dhcp.schema
328         %service -q ldap restart
329 fi
330
331 %post client
332 if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
333         mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
334 fi
335
336 %post relay
337 /sbin/chkconfig --add dhcp-relay
338 if [ -f /var/lock/subsys/dhcrelay ]; then
339         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
340 fi
341 %service dhcp-relay restart "dhcrelay daemon"
342
343 %preun relay
344 if [ "$1" = "0" ];then
345         %service dhcp-relay stop
346         /sbin/chkconfig --del dhcp-relay
347 fi
348
349 %post   -n libdhcp4client -p /sbin/ldconfig
350 %postun -n libdhcp4client -p /sbin/ldconfig
351
352 %files
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*
370
371 %if %{with ldap}
372 %files -n openldap-schema-dhcp
373 %defattr(644,root,root,755)
374 %{schemadir}/dhcp.schema
375 %endif
376
377 %files client
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
390
391 %files relay
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*
397
398 %files devel
399 %defattr(644,root,root,755)
400 %{_libdir}/libdhcpctl.a
401 %{_libdir}/libdst.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*
408
409 %files -n libdhcp4client
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_libdir}/libdhcp4client-*.so.*
412
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
419
420 %if %{with static_libs}
421 %files -n libdhcp4client-static
422 %defattr(644,root,root,755)
423 %{_libdir}/libdhcp4client.a
424 %endif
This page took 0.116772 seconds and 3 git commands to generate.