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