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