]>
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 |
3bb4bab9 | 95 | |
96 | %description client | |
0770f14a | 97 | Dynamic Host Configuration Protocol Client. |
3bb4bab9 | 98 | |
39cd54ba | 99 | %description client -l pl.UTF-8 |
0770f14a | 100 | Klient DHCP (Dynamic Host Configuration Protocol). |
3bb4bab9 | 101 | |
45ef0575 | 102 | %package relay |
103 | Summary: DHCP Relay Agent | |
6e8d2260 | 104 | Summary(pl.UTF-8): Agent przekazywania informacji DHCP |
45ef0575 | 105 | Group: Networking/Daemons |
967af251 | 106 | Requires(post): coreutils |
ac30bae3 ER |
107 | Requires(post,preun): /sbin/chkconfig |
108 | Requires: rc-scripts >= 0.2.0 | |
45ef0575 | 109 | |
110 | %description relay | |
a4dfcb55 | 111 | Dhcp relay is a relay agent for DHCP packets. It is used on a subnet |
112 | with DHCP clients to "relay" their requests to a subnet that has a | |
113 | DHCP server on it. Because DHCP packets can be broadcast, they will | |
114 | not be routed off of the local subnet. The DHCP relay takes care of | |
115 | this for the client. | |
116 | ||
39cd54ba JR |
117 | %description relay -l pl.UTF-8 |
118 | Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między | |
119 | podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie | |
120 | rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej | |
cd42af6b | 121 | podsieci. |
45ef0575 | 122 | |
1d526f5b JK |
123 | %package devel |
124 | Summary: DHCP development includes and libs | |
6e8d2260 | 125 | Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP |
1d526f5b JK |
126 | Group: Development/Libraries |
127 | ||
128 | %description devel | |
129 | Includes OMAPI and dhcptl libraries. | |
130 | ||
131 | OMAPI is an programming layer designed for controlling remote | |
132 | applications, and for querying them for their state. It is currently | |
133 | used by the ISC DHCP server. | |
134 | ||
135 | The dhcpctl set of functions provide an API that can be used to | |
136 | communicate with and manipulate a running ISC DHCP server. | |
137 | ||
39cd54ba | 138 | %description devel -l pl.UTF-8 |
1d526f5b JK |
139 | Zawiera biblioteki OMAPI oraz dhcpctl. |
140 | ||
141 | OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i | |
39cd54ba | 142 | odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP. |
1d526f5b | 143 | |
39cd54ba JR |
144 | dhcpctl to zbiór funkcji tworzących API, które może być używane do |
145 | komunikacji z działającym serwerem ISC DHCP i jego kontroli. | |
1d526f5b | 146 | |
cd3ce1e4 | 147 | %prep |
5bf1b3cd | 148 | %setup -q -n %{name}-%{version}%{_pre} |
5c01071a | 149 | %patch0 -p1 |
eda193cb | 150 | %patch1 -p1 |
5deae13f | 151 | %{?with_ldap:%patch2 -p1} |
eda193cb | 152 | # These two patches are required for dhcdbd to function |
5bf1b3cd | 153 | %patch3 -p1 |
9598ee90 | 154 | %patch4 -p1 |
eda193cb | 155 | # |
5bf1b3cd | 156 | %patch5 -p1 |
74b36fbe | 157 | %patch6 -p1 |
b0caeee3 | 158 | %patch7 -p1 |
4b8d2654 | 159 | |
0770f14a | 160 | %build |
c5dc12be | 161 | # NOTE: this is not autoconf configure - do not change it to %%configure |
ca2187eb | 162 | ./configure |
cd3ce1e4 | 163 | |
fa424e73 | 164 | %{__make} \ |
a63fcfce | 165 | CC="%{__cc}" \ |
0c23a828 | 166 | CC_OPTIONS="%{rpmcflags} \ |
b955a7fa ER |
167 | -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \ |
168 | -DEXTENDED_NEW_OPTION_INFO \ | |
b0caeee3 | 169 | -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhclient/dhclient.leases\\\" \ |
b955a7fa | 170 | " |
fdc24592 | 171 | LFLAGS="%{rpmldflags}" \ |
172 | DEBUG="" \ | |
b0caeee3 JR |
173 | VARDBS="/var/lib/%{name}" |
174 | VARDBC="/var/lib/dhclient" | |
cd3ce1e4 | 175 | |
176 | %install | |
177 | rm -rf $RPM_BUILD_ROOT | |
967af251 | 178 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{rc.d/init.d,sysconfig},%{schemadir}} |
cd3ce1e4 | 179 | |
771aee8c | 180 | %{__make} install \ |
5eb60a7e PG |
181 | DESTDIR=$RPM_BUILD_ROOT \ |
182 | CLIENTBINDIR=/sbin \ | |
183 | BINDIR=%{_sbindir} \ | |
184 | LIBDIR=%{_libdir} \ | |
185 | INCDIR=%{_includedir} \ | |
186 | ADMMANDIR=%{_mandir}/man8 \ | |
cd3ce1e4 | 187 | ADMMANEXT=.8 \ |
5eb60a7e PG |
188 | FFMANDIR=%{_mandir}/man5 \ |
189 | LIBMANDIR=%{_mandir}/man3 \ | |
1d526f5b | 190 | LIBMANEXT=.3 \ |
5eb60a7e | 191 | USRMANDIR=%{_mandir}/man1 \ |
1d526f5b | 192 | USRMANEXT=.1 \ |
b0caeee3 JR |
193 | VARDBS=/var/lib/%{name} \ |
194 | VARDBC=/var/lib/dhclient \ | |
cd3ce1e4 | 195 | FFMANEXT=.5 |
196 | ||
967af251 JR |
197 | rm $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3* |
198 | ||
cd3ce1e4 | 199 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd |
3ac86cff | 200 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay |
967af251 JR |
201 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd |
202 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay | |
cd3ce1e4 | 203 | |
967af251 JR |
204 | install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir} |
205 | %if %{with ldap} | |
206 | install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir} | |
207 | %endif | |
1d526f5b | 208 | |
967af251 | 209 | touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf |
9da55644 | 210 | |
b0caeee3 JR |
211 | touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases |
212 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases | |
3bb4bab9 | 213 | |
82fbb222 JB |
214 | %clean |
215 | rm -rf $RPM_BUILD_ROOT | |
216 | ||
cd3ce1e4 | 217 | %post |
3a01d42c | 218 | /sbin/chkconfig --add dhcpd |
d6a3364d | 219 | touch /var/lib/%{name}/dhcpd.leases |
30c45ada | 220 | %service dhcpd restart "dhcpd daemon" |
cd3ce1e4 | 221 | |
208108e2 JB |
222 | %preun |
223 | if [ "$1" = "0" ];then | |
30c45ada | 224 | %service dhcpd stop |
208108e2 JB |
225 | /sbin/chkconfig --del dhcpd |
226 | fi | |
227 | ||
967af251 JR |
228 | %post ldap-schema |
229 | %openldap_schema_register %{schemadir}/dhcp.schema -d core | |
230 | %service -q ldap restart | |
231 | ||
232 | %postun ldap-schema | |
233 | if [ "$1" = "0" ]; then | |
234 | %openldap_schema_unregister %{schemadir}/dhcp.schema | |
235 | %service -q ldap restart | |
236 | fi | |
237 | ||
208108e2 | 238 | %post client |
b0caeee3 JR |
239 | if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then |
240 | mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases | |
208108e2 JB |
241 | fi |
242 | ||
7940deed | 243 | %post relay |
3a01d42c | 244 | /sbin/chkconfig --add dhcp-relay |
3a01d42c | 245 | if [ -f /var/lock/subsys/dhcrelay ]; then |
30c45ada | 246 | mv -f /var/lock/subsys/{dhcrelay,dhcp-relay} |
3a01d42c | 247 | fi |
30c45ada | 248 | %service dhcp-relay restart "dhcrelay daemon" |
7940deed | 249 | |
7940deed | 250 | %preun relay |
3a01d42c | 251 | if [ "$1" = "0" ];then |
30c45ada | 252 | %service dhcp-relay stop |
3a01d42c | 253 | /sbin/chkconfig --del dhcp-relay |
254 | fi | |
7940deed | 255 | |
b7f7d94b | 256 | %triggerpostun -- dhcp < 3.0 |
30c45ada | 257 | if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then |
208108e2 | 258 | umask 027 |
b7f7d94b | 259 | echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp |
260 | echo "" >> /etc/dhcpd.conf.tmp | |
261 | cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp | |
262 | mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf | |
263 | fi | |
264 | ||
cd3ce1e4 | 265 | %files |
266 | %defattr(644,root,root,755) | |
967af251 JR |
267 | %doc doc/* README RELNOTES server/dhcpd.conf LICENSE |
268 | %doc contrib/ms2isc | |
269 | %{?with_ldap:%doc README.ldap Changelog-LDAP contrib/dhcpd-conf-to-ldap.pl} | |
1d526f5b | 270 | %{_mandir}/man1/* |
3bb4bab9 | 271 | %{_mandir}/man5/dhcp* |
272 | %{_mandir}/man8/dhcp* | |
ac30bae3 ER |
273 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd |
274 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf | |
967af251 | 275 | %attr(755,root,root) %{_bindir}/omshell |
cd3ce1e4 | 276 | %attr(755,root,root) %{_sbindir}/dhcpd |
d3d402da | 277 | %attr(754,root,root) /etc/rc.d/init.d/dhcpd |
d6a3364d JR |
278 | %attr(750,root,root) %dir /var/lib/%{name} |
279 | %ghost /var/lib/%{name}/dhcpd.leases | |
3bb4bab9 | 280 | |
967af251 JR |
281 | %if %{with ldap} |
282 | %files ldap-schema | |
283 | %defattr(644,root,root,755) | |
284 | %doc contrib/dhcpd-conf-to-ldap.pl | |
285 | %{schemadir}/*.schema | |
286 | %endif | |
287 | ||
3bb4bab9 | 288 | %files client |
ccf64540 | 289 | %defattr(644,root,root,755) |
967af251 JR |
290 | %doc contrib/sethostname.sh |
291 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf | |
3bb4bab9 | 292 | %attr(755,root,root) /sbin/dhclient |
f9cc1a26 | 293 | %attr(755,root,root) /sbin/dhclient-script |
d3d402da | 294 | %{_mandir}/man[58]/dhclient* |
b0caeee3 JR |
295 | %attr(750,root,root) %dir /var/lib/dhclient |
296 | %ghost /var/lib/dhclient/dhclient.leases | |
45ef0575 | 297 | |
298 | %files relay | |
299 | %defattr(644,root,root,755) | |
300 | %{_mandir}/man8/dhcrelay* | |
ac30bae3 | 301 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay |
45ef0575 | 302 | %attr(755,root,root) %{_sbindir}/dhcrelay |
3ac86cff | 303 | %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay |
1d526f5b JK |
304 | |
305 | %files devel | |
306 | %defattr(644,root,root,755) | |
79686690 | 307 | %{_mandir}/man3/* |
1d526f5b JK |
308 | %{_libdir}/*.a |
309 | %{_includedir}/* |