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