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