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