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