]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
- install libdhcp4client headers
[packages/dhcp.git] / dhcp.spec
1 #
2 # Conditional build:
3 %bcond_without  ldap    # without support for ldap storage
4 #
5 Summary:        DHCP Server
6 Summary(es.UTF-8):      Servidor DHCP
7 Summary(pl.UTF-8):      Serwer DHCP
8 Summary(pt_BR.UTF-8):   Servidor DHCP (Protocolo de configuração dinâmica de hosts)
9 Name:           dhcp
10 Version:        4.0.0
11 # don't put int release until all patches are updated/ported(!)
12 Release:        0.1
13 Epoch:          4
14 License:        MIT
15 Group:          Networking/Daemons
16 Source0:        ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
17 # Source0-md5:  31d79b27ce4a94089a0b9ce7f72307fa
18 Source1:        %{name}.init
19 Source2:        %{name}6.init
20 Source3:        %{name}-relay.init
21 Source4:        %{name}.sysconfig
22 Source5:        %{name}-relay.sysconfig
23 Source6:        %{name}-libdhcp4client.pc
24 Source7:        %{name}-dhcp4client.h
25 Source8:        %{name}-libdhcp4client.make
26 Source9:        %{name}-libdhcp_control.h
27 Source10:       %{name}.schema
28 Patch0:         %{name}-dhclient.script.patch
29 Patch1:         %{name}-release-by-ifup.patch
30 # from fedora 9-dev
31 Patch2:         %{name}-ldap.patch
32 Patch3:         %{name}-client-script-redhat.patch
33 Patch4:         %{name}-3.0.3-x-option.patch
34
35 Patch6:         %{name}-arg-concat.patch
36 Patch7:         %{name}-split-VARDB.patch
37 Patch8:         %{name}-timeouts.patch
38 Patch9:         %{name}-options.patch
39 Patch10:        %{name}-libdhcp4client.patch
40 Patch11:        %{name}-prototypes.patch
41 URL:            http://www.isc.org/sw/dhcp/
42 BuildRequires:  autoconf
43 BuildRequires:  automake
44 BuildRequires:  libtool
45 BuildRequires:  groff
46 %{?with_ldap:BuildRequires:     openldap-devel}
47 %{?with_ldap:BuildRequires:     openssl-devel}
48 BuildRequires:  rpmbuild(macros) >= 1.304
49 Requires(post): coreutils
50 Requires(post,preun):   /sbin/chkconfig
51 Requires:       rc-scripts >= 0.2.0
52 Provides:       dhcpd
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %define         _sbindir        /sbin
56 %define         schemadir       /usr/share/openldap/schema
57
58 %description
59 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
60 individual devices on an IP network to get their own network
61 configuration information (IP address, subnetmask, broadcast address,
62 etc.) from a DHCP server. The overall purpose of DHCP is to make it
63 easier to administer a large network.
64
65 %description -l es.UTF-8
66 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
67 direcciones IP alocadas dinámicamente, permite también descubrir
68 información sobre la red en que están conectados. BOOTP provee una
69 funcionalidad similar, con ciertas restricciones. Este servidor
70 también las atiende.
71
72 %description -l pl.UTF-8
73 Serwer DHCP (Dynamic Host Configuration Protocol).
74
75 DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
76 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
77 rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
78 dużymi sieciami IP.
79
80 %description -l pt_BR.UTF-8
81 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
82 endereços IP alocados dinamicamente, permite também descobrir
83 informações sobre a rede em que estão conectados. BOOTP provê uma
84 funcionalidade similar, com certas restrições. Este servidor também
85 atende aquelas requisições. Esta versão é ainda considerada um
86 software BETA.
87
88 %package -n openldap-schema-dhcp
89 Summary:        LDAP Schema for DHCP Server
90 Summary(pl.UTF-8):      Schemat LDAP dla serwera DHCP
91 Group:          Networking/Daemons
92 Requires(post,postun):  sed >= 4.0
93 Requires:       openldap-servers
94
95 %description -n openldap-schema-dhcp
96 This package contains LDAPv3 schema for use with the DHCP Server.
97
98 %description -n openldap-schema-dhcp -l pl.UTF-8
99 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
100
101 %package client
102 Summary:        DHCP Client
103 Summary(pl.UTF-8):      Klient DHCP
104 Group:          Networking/Daemons
105 Requires:       coreutils
106 Requires:       iproute2
107 Requires:       net-tools
108 Obsoletes:      dhclient
109
110 %description client
111 Dynamic Host Configuration Protocol Client.
112
113 %description client -l pl.UTF-8
114 Klient DHCP (Dynamic Host Configuration Protocol).
115
116 %package relay
117 Summary:        DHCP Relay Agent
118 Summary(pl.UTF-8):      Agent przekazywania informacji DHCP
119 Group:          Networking/Daemons
120 Requires(post): coreutils
121 Requires(post,preun):   /sbin/chkconfig
122 Requires:       rc-scripts >= 0.2.0
123
124 %description relay
125 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
126 with DHCP clients to "relay" their requests to a subnet that has a
127 DHCP server on it. Because DHCP packets can be broadcast, they will
128 not be routed off of the local subnet. The DHCP relay takes care of
129 this for the client.
130
131 %description relay -l pl.UTF-8
132 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
133 podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
134 rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
135 podsieci.
136
137 %package devel
138 Summary:        DHCP development includes and libs
139 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
140 Group:          Development/Libraries
141
142 %description devel
143 Includes OMAPI and dhcptl libraries.
144
145 OMAPI is an programming layer designed for controlling remote
146 applications, and for querying them for their state. It is currently
147 used by the ISC DHCP server.
148
149 The dhcpctl set of functions provide an API that can be used to
150 communicate with and manipulate a running ISC DHCP server.
151
152 %description devel -l pl.UTF-8
153 Zawiera biblioteki OMAPI oraz dhcpctl.
154
155 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
156 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
157
158 dhcpctl to zbiór funkcji tworzących API, które może być używane do
159 komunikacji z działającym serwerem ISC DHCP i jego kontroli.
160
161 %package -n libdhcp4client
162 Summary:        The DHCP client in a library for invocation by other programs
163 Summary(pl.UTF-8):      Klient DHCP w postaci biblioteki do wykorzystania w innych programach
164 Group:          Development/Libraries
165
166 %description -n libdhcp4client
167 Provides the client for the DHCP protocol.
168
169 %description -n libdhcp4client -l pl.UTF-8
170 Ten pakiet zawiera klienta protokołu DHCP.
171
172 %package -n libdhcp4client-devel
173 Summary:        Header files for development with the DHCP client library
174 Summary(pl.UTF-8):      Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP
175 Group:          Development/Libraries
176 License:        GPL v2+
177 Requires:       libdhcp4client = %{epoch}:%{version}-%{release}
178
179 %description -n libdhcp4client-devel
180 Header files for development with the DHCP client library.
181
182 %description -n libdhcp4client-devel -l pl.UTF-8
183 Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP.
184
185 %package -n libdhcp4client-static
186 Summary:        Static DHCP client library
187 Summary(pl.UTF-8):      Statyczna biblioteka kliencka DHCP
188 Group:          Development/Libraries
189 Requires:       libdhcp4client-devel = %{epoch}:%{version}-%{release}
190
191 %description -n libdhcp4client-static
192 Static DHCP client library.
193
194 %description -n libdhcp4client-static -l pl.UTF-8
195 Statyczna biblioteka kliencka DHCP.
196
197 %prep
198 %setup -q
199 %patch0 -p1
200 %patch1 -p1
201 %{?with_ldap:%patch2 -p1}
202 # These two patches are required for dhcdbd to function
203 %patch3 -p1
204 # CHECK ME, NO IDEA
205 #%patch4 -p1
206 %patch6 -p1
207 # CHECK ME, NO IDEA
208 #%patch7 -p1
209 %patch8 -p1
210 %patch9 -p1
211 %patch10 -p1
212 %patch11 -p1
213
214 sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE5} > libdhcp4client.pc
215 mkdir -p libdhcp4client
216 cp %{SOURCE7} libdhcp4client/dhcp4client.h
217 cp %{SOURCE8} libdhcp4client/Makefile.dist
218 cp %{SOURCE9} includes/isc-dhcp/libdhcp_control.h
219
220 %build
221 %{__libtoolize}
222 %{__aclocal}
223 %{__autoconf}
224 %{__autoheader}
225 %{__automake}
226 CFLAGS="%{rpmcflags} -fPIC"
227 %configure \
228         --enable-dhcpv6 \
229         --with-srv-lease-file="/var/lib/%{name}/dhcpd.leases" \
230         --with-cli-lease-file="/var/lib/dhclient/dhclient.leases"
231 %{__make}
232
233 %install
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{schemadir},%{_pkgconfigdir},/var/lib/{%{name},dhclient}}
236
237 %{__make} install \
238         DESTDIR=$RPM_BUILD_ROOT
239
240 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
241 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd6
242 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
243 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
244 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
245
246 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
247 %if %{with ldap}
248 install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir}
249 %endif
250
251 # Install headers for libdhcp4client-devel
252 install -d $RPM_BUILD_ROOT%{_includedir}/dhcp4client/minires
253 install -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_includedir}/dhcp4client
254 for hdr in cdefs.h ctrace.h dhcp.h dhcp6.h dhcpd.h dhctoken.h failover.h \
255            heap.h inet.h minires/minires.h minires/res_update.h \
256            minires/resolv.h osdep.h site.h statement.h tree.h ; do
257     install -p -m 0644 includes/${hdr} $RPM_BUILD_ROOT%{_includedir}/dhcp4client/${hdr}
258 done
259
260 touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
261
262 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
263 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
264
265 install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc
266
267 %clean
268 rm -rf $RPM_BUILD_ROOT
269
270 %post
271 /sbin/chkconfig --add dhcpd
272 /sbin/chkconfig --add dhcpd6
273 touch /var/lib/%{name}/dhcpd.leases
274 %service dhcpd restart "dhcpd daemon"
275 %service dhcpd6 restart "dhcpd IPv6 daemon"
276
277 %preun
278 if [ "$1" = "0" ];then
279         %service dhcpd stop
280         %service dhcpd6 stop
281         /sbin/chkconfig --del dhcpd
282         /sbin/chkconfig --del dhcpd6
283 fi
284
285 %triggerpostun -- dhcp < 3.0
286 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
287         umask 027
288         echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
289         echo "" >> /etc/dhcpd.conf.tmp
290         cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
291         mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf
292 fi
293
294 %post -n openldap-schema-dhcp
295 %openldap_schema_register %{schemadir}/dhcp.schema -d core
296 %service -q ldap restart
297
298 %postun -n openldap-schema-dhcp
299 if [ "$1" = "0" ]; then
300         %openldap_schema_unregister %{schemadir}/dhcp.schema
301         %service -q ldap restart
302 fi
303
304 %post client
305 if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
306         mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
307 fi
308
309 %post relay
310 /sbin/chkconfig --add dhcp-relay
311 if [ -f /var/lock/subsys/dhcrelay ]; then
312         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
313 fi
314 %service dhcp-relay restart "dhcrelay daemon"
315
316 %preun relay
317 if [ "$1" = "0" ];then
318         %service dhcp-relay stop
319         /sbin/chkconfig --del dhcp-relay
320 fi
321
322 %post   -n libdhcp4client -p /sbin/ldconfig
323 %postun -n libdhcp4client -p /sbin/ldconfig
324
325 %files
326 %defattr(644,root,root,755)
327 %doc doc/* README RELNOTES server/dhcpd.conf LICENSE contrib/ms2isc
328 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
329 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
330 %attr(755,root,root) %{_bindir}/omshell
331 %attr(755,root,root) %{_sbindir}/dhcpd
332 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
333 %attr(754,root,root) /etc/rc.d/init.d/dhcpd6
334 %attr(750,root,root) %dir /var/lib/%{name}
335 %ghost /var/lib/%{name}/dhcpd.leases
336 %{_mandir}/man1/omshell.1*
337 %{_mandir}/man5/dhcp-eval.5*
338 %{_mandir}/man5/dhcp-options.5*
339 %{_mandir}/man5/dhcpd.conf.5*
340 %{_mandir}/man5/dhcpd.leases.5*
341 %{_mandir}/man8/dhcpd.8*
342
343 %if %{with ldap}
344 %files -n openldap-schema-dhcp
345 %defattr(644,root,root,755)
346 %{schemadir}/dhcp.schema
347 %endif
348
349 %files client
350 %defattr(644,root,root,755)
351 %doc contrib/sethostname.sh
352 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
353 %attr(755,root,root) /sbin/dhclient
354 #%attr(755,root,root) /sbin/dhclient-script
355 %{_mandir}/man5/dhclient.conf.5*
356 %{_mandir}/man5/dhclient.leases.5*
357 %{_mandir}/man8/dhclient.8*
358 %{_mandir}/man8/dhclient-script.8*
359 %attr(750,root,root) %dir /var/lib/dhclient
360 %ghost /var/lib/dhclient/dhclient.leases
361
362 %files relay
363 %defattr(644,root,root,755)
364 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
365 %attr(755,root,root) %{_sbindir}/dhcrelay
366 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
367 %{_mandir}/man8/dhcrelay.8*
368
369 %files devel
370 %defattr(644,root,root,755)
371 %{_libdir}/libdhcpctl.a
372 %{_libdir}/libdst.a
373 %{_libdir}/libomapi.a
374 %{_includedir}/dhcpctl
375 %{_includedir}/isc-dhcp
376 %{_includedir}/omapip
377 %{_mandir}/man3/dhcpctl.3*
378 %{_mandir}/man3/omapi.3*
379
380 %files -n libdhcp4client
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/libdhcp4client-*.so.*
383
384 %files -n libdhcp4client-devel
385 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_libdir}/libdhcp4client.so
387 %{_includedir}/dhcp4client
388 %{_pkgconfigdir}/libdhcp4client.pc
389 %{_libdir}/libdhcp4client.la
390
391 %files -n libdhcp4client-static
392 %defattr(644,root,root,755)
393 %{_libdir}/libdhcp4client.a
This page took 0.080868 seconds and 3 git commands to generate.