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