]>
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 JR |
10 | %define _pre a3 |
11 | Version: 3.1.0 | |
12 | Release: 0.%{_pre}.1 | |
9598ee90 | 13 | Epoch: 4 |
aa104090 | 14 | License: distributable |
cd3ce1e4 | 15 | Group: Networking/Daemons |
5bf1b3cd | 16 | Source0: ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}%{_pre}.tar.gz |
0ed97b59 | 17 | # Source0-md5: d09be1a80982b78482e8fbd416924468 |
a4dfcb55 | 18 | Source1: %{name}.init |
19 | Source2: %{name}-relay.init | |
967af251 JR |
20 | Source3: %{name}.sysconfig |
21 | Source4: %{name}-relay.sysconfig | |
eda193cb JR |
22 | Patch0: %{name}-dhclient.script.patch |
23 | Patch1: %{name}-if_buffer_size.patch | |
5bf1b3cd | 24 | # http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch |
eda193cb | 25 | Patch2: %{name}-ldap.patch |
5bf1b3cd JR |
26 | Patch3: %{name}-client-script-redhat.patch |
27 | Patch4: %{name}-3.0.3-x-option.patch | |
28 | Patch5: %{name}-typo.patch | |
29 | Patch6: %{name}-arg-concat.patch | |
30 | Patch7: %{name}-split-VARDB.patch | |
5ea0fa25 | 31 | URL: http://www.isc.org/sw/dhcp/ |
bca716bd | 32 | BuildRequires: groff |
5deae13f | 33 | %{?with_ldap:BuildRequires: openldap-devel} |
5bf1b3cd | 34 | %{?with_ldap:BuildRequires: openssl-devel} |
967af251 JR |
35 | BuildRequires: rpmbuild(macros) >= 1.304 |
36 | Requires(post): coreutils | |
ac30bae3 ER |
37 | Requires(post,preun): /sbin/chkconfig |
38 | Requires: rc-scripts >= 0.2.0 | |
73612d9c | 39 | Provides: dhcpd |
bf74a63f | 40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
cd3ce1e4 | 41 | |
967af251 JR |
42 | %define schemadir /usr/share/openldap/schema |
43 | ||
cd3ce1e4 | 44 | %description |
0770f14a | 45 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
37bec083 | 46 | individual devices on an IP network to get their own network |
47 | configuration information (IP address, subnetmask, broadcast address, | |
48 | etc.) from a DHCP server. The overall purpose of DHCP is to make it | |
49 | easier to administer a large network. | |
0770f14a | 50 | |
39cd54ba | 51 | %description -l es.UTF-8 |
1f522308 | 52 | DHCP permite que hosts en una red TCP/IP soliciten y tengan sus |
39cd54ba JR |
53 | direcciones IP alocadas dinámicamente, permite también descubrir |
54 | información sobre la red en que están conectados. BOOTP provee una | |
1f522308 | 55 | funcionalidad similar, con ciertas restricciones. Este servidor |
39cd54ba | 56 | también las atiende. |
1f522308 | 57 | |
39cd54ba | 58 | %description -l pl.UTF-8 |
b7cc5fa2 | 59 | Serwer DHCP (Dynamic Host Configuration Protocol). |
cd3ce1e4 | 60 | |
39cd54ba | 61 | DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na |
cd42af6b | 62 | pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu |
39cd54ba JR |
63 | rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie |
64 | dużymi sieciami IP. | |
cd42af6b | 65 | |
39cd54ba | 66 | %description -l pt_BR.UTF-8 |
1f522308 | 67 | DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus |
39cd54ba JR |
68 | endereços IP alocados dinamicamente, permite também descobrir |
69 | informações sobre a rede em que estão conectados. BOOTP provê uma | |
70 | funcionalidade similar, com certas restrições. Este servidor também | |
71 | atende aquelas requisições. Esta versão é ainda considerada um | |
1f522308 | 72 | software BETA. |
73 | ||
967af251 JR |
74 | %package ldap-schema |
75 | Summary: LDAP Schema for DHCP Server | |
76 | Summary(pl.UTF-8): Schemat LDAP dla serwera DHCP | |
77 | Group: Networking/Daemons | |
78 | Requires(post,postun): sed >= 4.0 | |
79 | Requires: openldap-servers | |
80 | ||
81 | %description ldap-schema | |
82 | This package contains LDAPv3 schema for use with the DHCP Server. | |
83 | ||
84 | %description ldap-schema -l pl.UTF-8 | |
85 | Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP. | |
86 | ||
3bb4bab9 | 87 | %package client |
88 | Summary: DHCP Client | |
6e8d2260 | 89 | Summary(pl.UTF-8): Klient DHCP |
3bb4bab9 | 90 | Group: Networking/Daemons |
eda193cb JR |
91 | Requires: coreutils |
92 | Requires: iproute2 | |
93 | Requires: net-tools | |
dd3090a5 | 94 | Obsoletes: dhclient |
30c45ada | 95 | Obsoletes: pump |
3bb4bab9 | 96 | |
97 | %description client | |
0770f14a | 98 | Dynamic Host Configuration Protocol Client. |
3bb4bab9 | 99 | |
39cd54ba | 100 | %description client -l pl.UTF-8 |
0770f14a | 101 | Klient DHCP (Dynamic Host Configuration Protocol). |
3bb4bab9 | 102 | |
45ef0575 | 103 | %package relay |
104 | Summary: DHCP Relay Agent | |
6e8d2260 | 105 | Summary(pl.UTF-8): Agent przekazywania informacji DHCP |
45ef0575 | 106 | Group: Networking/Daemons |
967af251 | 107 | Requires(post): coreutils |
ac30bae3 ER |
108 | Requires(post,preun): /sbin/chkconfig |
109 | Requires: rc-scripts >= 0.2.0 | |
45ef0575 | 110 | |
111 | %description relay | |
a4dfcb55 | 112 | Dhcp relay is a relay agent for DHCP packets. It is used on a subnet |
113 | with DHCP clients to "relay" their requests to a subnet that has a | |
114 | DHCP server on it. Because DHCP packets can be broadcast, they will | |
115 | not be routed off of the local subnet. The DHCP relay takes care of | |
116 | this for the client. | |
117 | ||
39cd54ba JR |
118 | %description relay -l pl.UTF-8 |
119 | Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między | |
120 | podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie | |
121 | rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej | |
cd42af6b | 122 | podsieci. |
45ef0575 | 123 | |
1d526f5b JK |
124 | %package devel |
125 | Summary: DHCP development includes and libs | |
6e8d2260 | 126 | Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP |
1d526f5b JK |
127 | Group: Development/Libraries |
128 | ||
129 | %description devel | |
130 | Includes OMAPI and dhcptl libraries. | |
131 | ||
132 | OMAPI is an programming layer designed for controlling remote | |
133 | applications, and for querying them for their state. It is currently | |
134 | used by the ISC DHCP server. | |
135 | ||
136 | The dhcpctl set of functions provide an API that can be used to | |
137 | communicate with and manipulate a running ISC DHCP server. | |
138 | ||
39cd54ba | 139 | %description devel -l pl.UTF-8 |
1d526f5b JK |
140 | Zawiera biblioteki OMAPI oraz dhcpctl. |
141 | ||
142 | OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i | |
39cd54ba | 143 | odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP. |
1d526f5b | 144 | |
39cd54ba JR |
145 | dhcpctl to zbiór funkcji tworzących API, które może być używane do |
146 | komunikacji 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 | |
178 | rm -rf $RPM_BUILD_ROOT | |
967af251 | 179 | install -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 |
198 | rm $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3* |
199 | ||
cd3ce1e4 | 200 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd |
3ac86cff | 201 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay |
967af251 JR |
202 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd |
203 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay | |
cd3ce1e4 | 204 | |
967af251 JR |
205 | install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir} |
206 | %if %{with ldap} | |
207 | install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir} | |
208 | %endif | |
1d526f5b | 209 | |
967af251 | 210 | touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf |
9da55644 | 211 | |
b0caeee3 JR |
212 | touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases |
213 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases | |
3bb4bab9 | 214 | |
82fbb222 JB |
215 | %clean |
216 | rm -rf $RPM_BUILD_ROOT | |
217 | ||
cd3ce1e4 | 218 | %post |
3a01d42c | 219 | /sbin/chkconfig --add dhcpd |
d6a3364d | 220 | touch /var/lib/%{name}/dhcpd.leases |
30c45ada | 221 | %service dhcpd restart "dhcpd daemon" |
cd3ce1e4 | 222 | |
208108e2 JB |
223 | %preun |
224 | if [ "$1" = "0" ];then | |
30c45ada | 225 | %service dhcpd stop |
208108e2 JB |
226 | /sbin/chkconfig --del dhcpd |
227 | fi | |
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 | |
234 | if [ "$1" = "0" ]; then | |
235 | %openldap_schema_unregister %{schemadir}/dhcp.schema | |
236 | %service -q ldap restart | |
237 | fi | |
238 | ||
208108e2 | 239 | %post client |
b0caeee3 JR |
240 | if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then |
241 | mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases | |
208108e2 JB |
242 | fi |
243 | ||
7940deed | 244 | %post relay |
3a01d42c | 245 | /sbin/chkconfig --add dhcp-relay |
3a01d42c | 246 | if [ -f /var/lock/subsys/dhcrelay ]; then |
30c45ada | 247 | mv -f /var/lock/subsys/{dhcrelay,dhcp-relay} |
3a01d42c | 248 | fi |
30c45ada | 249 | %service dhcp-relay restart "dhcrelay daemon" |
7940deed | 250 | |
7940deed | 251 | %preun relay |
3a01d42c | 252 | if [ "$1" = "0" ];then |
30c45ada | 253 | %service dhcp-relay stop |
3a01d42c | 254 | /sbin/chkconfig --del dhcp-relay |
255 | fi | |
7940deed | 256 | |
b7f7d94b | 257 | %triggerpostun -- dhcp < 3.0 |
30c45ada | 258 | if [ "`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 | |
264 | fi | |
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}/* |