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