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