]>
Commit | Line | Data |
---|---|---|
fa424e73 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with ldap # with support for ldap storage | |
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 |
0ed97b59 | 10 | Version: 3.1.0a3 |
b0caeee3 | 11 | Release: 0.2 |
9598ee90 | 12 | Epoch: 4 |
aa104090 | 13 | License: distributable |
cd3ce1e4 | 14 | Group: Networking/Daemons |
748a53c8 | 15 | Source0: ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz |
0ed97b59 | 16 | # Source0-md5: d09be1a80982b78482e8fbd416924468 |
a4dfcb55 | 17 | Source1: %{name}.init |
18 | Source2: %{name}-relay.init | |
19 | Source3: %{name}-relay.sysconfig | |
20 | Source4: %{name}d.conf.sample | |
21 | Source5: %{name}.sysconfig | |
5c01071a | 22 | Patch0: %{name}-if_buffer_size.patch |
811bb64d AG |
23 | Patch1: %{name}-ldap.patch |
24 | Patch2: %{name}-ldap1.patch | |
19440167 | 25 | Patch3: %{name}-client-script-redhat.patch |
414c12c9 | 26 | Patch4: %{name}-3.0.3-x-option.patch |
74b36fbe JR |
27 | Patch5: %{name}-typo.patch |
28 | Patch6: %{name}-arg-concat.patch | |
b0caeee3 | 29 | Patch7: %{name}-split-VARDB.patch |
5ea0fa25 | 30 | URL: http://www.isc.org/sw/dhcp/ |
bca716bd | 31 | BuildRequires: groff |
5deae13f | 32 | %{?with_ldap:BuildRequires: openldap-devel} |
30c45ada | 33 | BuildRequires: rpmbuild(macros) >= 1.268 |
208108e2 | 34 | Requires(post): fileutils |
ac30bae3 ER |
35 | Requires(post,preun): /sbin/chkconfig |
36 | Requires: rc-scripts >= 0.2.0 | |
73612d9c | 37 | Provides: dhcpd |
bf74a63f | 38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
cd3ce1e4 | 39 | |
40 | %description | |
0770f14a | 41 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
37bec083 | 42 | individual devices on an IP network to get their own network |
43 | configuration information (IP address, subnetmask, broadcast address, | |
44 | etc.) from a DHCP server. The overall purpose of DHCP is to make it | |
45 | easier to administer a large network. | |
0770f14a | 46 | |
39cd54ba | 47 | %description -l es.UTF-8 |
1f522308 | 48 | DHCP permite que hosts en una red TCP/IP soliciten y tengan sus |
39cd54ba JR |
49 | direcciones IP alocadas dinámicamente, permite también descubrir |
50 | información sobre la red en que están conectados. BOOTP provee una | |
1f522308 | 51 | funcionalidad similar, con ciertas restricciones. Este servidor |
39cd54ba | 52 | también las atiende. |
1f522308 | 53 | |
39cd54ba | 54 | %description -l pl.UTF-8 |
b7cc5fa2 | 55 | Serwer DHCP (Dynamic Host Configuration Protocol). |
cd3ce1e4 | 56 | |
39cd54ba | 57 | DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na |
cd42af6b | 58 | pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu |
39cd54ba JR |
59 | rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie |
60 | dużymi sieciami IP. | |
cd42af6b | 61 | |
39cd54ba | 62 | %description -l pt_BR.UTF-8 |
1f522308 | 63 | DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus |
39cd54ba JR |
64 | endereços IP alocados dinamicamente, permite também descobrir |
65 | informações sobre a rede em que estão conectados. BOOTP provê uma | |
66 | funcionalidade similar, com certas restrições. Este servidor também | |
67 | atende aquelas requisições. Esta versão é ainda considerada um | |
1f522308 | 68 | software BETA. |
69 | ||
3bb4bab9 | 70 | %package client |
71 | Summary: DHCP Client | |
6e8d2260 | 72 | Summary(pl.UTF-8): Klient DHCP |
3bb4bab9 | 73 | Group: Networking/Daemons |
208108e2 | 74 | Requires(post): fileutils |
dd3090a5 | 75 | Obsoletes: dhclient |
30c45ada | 76 | Obsoletes: pump |
3bb4bab9 | 77 | |
78 | %description client | |
0770f14a | 79 | Dynamic Host Configuration Protocol Client. |
3bb4bab9 | 80 | |
39cd54ba | 81 | %description client -l pl.UTF-8 |
0770f14a | 82 | Klient DHCP (Dynamic Host Configuration Protocol). |
3bb4bab9 | 83 | |
45ef0575 | 84 | %package relay |
85 | Summary: DHCP Relay Agent | |
6e8d2260 | 86 | Summary(pl.UTF-8): Agent przekazywania informacji DHCP |
45ef0575 | 87 | Group: Networking/Daemons |
208108e2 | 88 | Requires(post): fileutils |
ac30bae3 ER |
89 | Requires(post,preun): /sbin/chkconfig |
90 | Requires: rc-scripts >= 0.2.0 | |
45ef0575 | 91 | |
92 | %description relay | |
a4dfcb55 | 93 | Dhcp relay is a relay agent for DHCP packets. It is used on a subnet |
94 | with DHCP clients to "relay" their requests to a subnet that has a | |
95 | DHCP server on it. Because DHCP packets can be broadcast, they will | |
96 | not be routed off of the local subnet. The DHCP relay takes care of | |
97 | this for the client. | |
98 | ||
39cd54ba JR |
99 | %description relay -l pl.UTF-8 |
100 | Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między | |
101 | podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie | |
102 | rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej | |
cd42af6b | 103 | podsieci. |
45ef0575 | 104 | |
1d526f5b JK |
105 | %package devel |
106 | Summary: DHCP development includes and libs | |
6e8d2260 | 107 | Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP |
1d526f5b JK |
108 | Group: Development/Libraries |
109 | ||
110 | %description devel | |
111 | Includes OMAPI and dhcptl libraries. | |
112 | ||
113 | OMAPI is an programming layer designed for controlling remote | |
114 | applications, and for querying them for their state. It is currently | |
115 | used by the ISC DHCP server. | |
116 | ||
117 | The dhcpctl set of functions provide an API that can be used to | |
118 | communicate with and manipulate a running ISC DHCP server. | |
119 | ||
39cd54ba | 120 | %description devel -l pl.UTF-8 |
1d526f5b JK |
121 | Zawiera biblioteki OMAPI oraz dhcpctl. |
122 | ||
123 | OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i | |
39cd54ba | 124 | odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP. |
1d526f5b | 125 | |
39cd54ba JR |
126 | dhcpctl to zbiór funkcji tworzących API, które może być używane do |
127 | komunikacji z działającym serwerem ISC DHCP i jego kontroli. | |
1d526f5b | 128 | |
cd3ce1e4 | 129 | %prep |
748a53c8 | 130 | %setup -q |
ca2187eb | 131 | install %{SOURCE4} . |
5c01071a | 132 | %patch0 -p1 |
5deae13f | 133 | %{?with_ldap:%patch1 -p1} |
134 | %{?with_ldap:%patch2 -p1} | |
19440167 | 135 | %patch3 -p1 |
ed53e987 | 136 | # This patch is required for dhcdbd to function |
9598ee90 | 137 | %patch4 -p1 |
fb6403fa | 138 | %patch5 -p1 |
74b36fbe | 139 | %patch6 -p1 |
b0caeee3 | 140 | %patch7 -p1 |
4b8d2654 | 141 | |
0770f14a | 142 | %build |
c5dc12be | 143 | # NOTE: this is not autoconf configure - do not change it to %%configure |
ca2187eb | 144 | ./configure |
cd3ce1e4 | 145 | |
fa424e73 | 146 | %{__make} \ |
a63fcfce | 147 | CC="%{__cc}" \ |
0c23a828 | 148 | CC_OPTIONS="%{rpmcflags} \ |
b955a7fa ER |
149 | -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \ |
150 | -DEXTENDED_NEW_OPTION_INFO \ | |
b0caeee3 | 151 | -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhclient/dhclient.leases\\\" \ |
b955a7fa | 152 | " |
fdc24592 | 153 | LFLAGS="%{rpmldflags}" \ |
154 | DEBUG="" \ | |
b0caeee3 JR |
155 | VARDBS="/var/lib/%{name}" |
156 | VARDBC="/var/lib/dhclient" | |
cd3ce1e4 | 157 | |
158 | %install | |
159 | rm -rf $RPM_BUILD_ROOT | |
a451dd85 | 160 | install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \ |
0e6925b2 | 161 | $RPM_BUILD_ROOT{/var/lib/%{name},%{_sysconfdir}/{rc.d/init.d,sysconfig}} |
cd3ce1e4 | 162 | |
771aee8c | 163 | %{__make} install \ |
5eb60a7e PG |
164 | DESTDIR=$RPM_BUILD_ROOT \ |
165 | CLIENTBINDIR=/sbin \ | |
166 | BINDIR=%{_sbindir} \ | |
167 | LIBDIR=%{_libdir} \ | |
168 | INCDIR=%{_includedir} \ | |
169 | ADMMANDIR=%{_mandir}/man8 \ | |
cd3ce1e4 | 170 | ADMMANEXT=.8 \ |
5eb60a7e PG |
171 | FFMANDIR=%{_mandir}/man5 \ |
172 | LIBMANDIR=%{_mandir}/man3 \ | |
1d526f5b | 173 | LIBMANEXT=.3 \ |
5eb60a7e | 174 | USRMANDIR=%{_mandir}/man1 \ |
1d526f5b | 175 | USRMANEXT=.1 \ |
b0caeee3 JR |
176 | VARDBS=/var/lib/%{name} \ |
177 | VARDBC=/var/lib/dhclient \ | |
cd3ce1e4 | 178 | FFMANEXT=.5 |
179 | ||
180 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd | |
3ac86cff | 181 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay |
182 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay | |
ac30bae3 | 183 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd.conf |
6d98e2f2 | 184 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd |
cd3ce1e4 | 185 | |
1d526f5b JK |
186 | mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \ |
187 | $RPM_BUILD_ROOT%{_mandir}/man1/omshell.1 | |
188 | ||
fd8c978e | 189 | install client/scripts/linux $RPM_BUILD_ROOT%{_sbindir}/dhclient-script |
9da55644 | 190 | |
b0caeee3 JR |
191 | touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases |
192 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases | |
3bb4bab9 | 193 | |
82fbb222 JB |
194 | %clean |
195 | rm -rf $RPM_BUILD_ROOT | |
196 | ||
cd3ce1e4 | 197 | %post |
3a01d42c | 198 | /sbin/chkconfig --add dhcpd |
d6a3364d | 199 | touch /var/lib/%{name}/dhcpd.leases |
30c45ada | 200 | %service dhcpd restart "dhcpd daemon" |
cd3ce1e4 | 201 | |
208108e2 JB |
202 | %preun |
203 | if [ "$1" = "0" ];then | |
30c45ada | 204 | %service dhcpd stop |
208108e2 JB |
205 | /sbin/chkconfig --del dhcpd |
206 | fi | |
207 | ||
208 | %post client | |
b0caeee3 JR |
209 | if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then |
210 | mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases | |
208108e2 JB |
211 | fi |
212 | ||
7940deed | 213 | %post relay |
3a01d42c | 214 | /sbin/chkconfig --add dhcp-relay |
3a01d42c | 215 | if [ -f /var/lock/subsys/dhcrelay ]; then |
30c45ada | 216 | mv -f /var/lock/subsys/{dhcrelay,dhcp-relay} |
3a01d42c | 217 | fi |
30c45ada | 218 | %service dhcp-relay restart "dhcrelay daemon" |
7940deed | 219 | |
7940deed | 220 | %preun relay |
3a01d42c | 221 | if [ "$1" = "0" ];then |
30c45ada | 222 | %service dhcp-relay stop |
3a01d42c | 223 | /sbin/chkconfig --del dhcp-relay |
224 | fi | |
7940deed | 225 | |
b7f7d94b | 226 | %triggerpostun -- dhcp < 3.0 |
30c45ada | 227 | if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then |
208108e2 | 228 | umask 027 |
b7f7d94b | 229 | echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp |
230 | echo "" >> /etc/dhcpd.conf.tmp | |
231 | cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp | |
232 | mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf | |
233 | fi | |
234 | ||
cd3ce1e4 | 235 | %files |
236 | %defattr(644,root,root,755) | |
79e4cc69 | 237 | %doc doc/* README RELNOTES dhcpd.conf.sample LICENSE |
5deae13f | 238 | %{?with_ldap:%doc contrib/*} |
1d526f5b | 239 | %{_mandir}/man1/* |
3bb4bab9 | 240 | %{_mandir}/man5/dhcp* |
241 | %{_mandir}/man8/dhcp* | |
ac30bae3 ER |
242 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd |
243 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf | |
1d526f5b | 244 | %attr(755,root,root) %{_bindir}/* |
cd3ce1e4 | 245 | %attr(755,root,root) %{_sbindir}/dhcpd |
d3d402da | 246 | %attr(754,root,root) /etc/rc.d/init.d/dhcpd |
d6a3364d JR |
247 | %attr(750,root,root) %dir /var/lib/%{name} |
248 | %ghost /var/lib/%{name}/dhcpd.leases | |
3bb4bab9 | 249 | |
250 | %files client | |
ccf64540 | 251 | %defattr(644,root,root,755) |
3bb4bab9 | 252 | %attr(755,root,root) /sbin/dhclient |
f9cc1a26 | 253 | %attr(755,root,root) /sbin/dhclient-script |
d3d402da | 254 | %{_mandir}/man[58]/dhclient* |
b0caeee3 JR |
255 | %attr(750,root,root) %dir /var/lib/dhclient |
256 | %ghost /var/lib/dhclient/dhclient.leases | |
45ef0575 | 257 | |
258 | %files relay | |
259 | %defattr(644,root,root,755) | |
260 | %{_mandir}/man8/dhcrelay* | |
ac30bae3 | 261 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay |
45ef0575 | 262 | %attr(755,root,root) %{_sbindir}/dhcrelay |
3ac86cff | 263 | %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay |
1d526f5b JK |
264 | |
265 | %files devel | |
266 | %defattr(644,root,root,755) | |
79686690 | 267 | %{_mandir}/man3/* |
1d526f5b JK |
268 | %{_libdir}/*.a |
269 | %{_includedir}/* |