]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - should unmount /proc/fs/nfsd and /var/lib/nfs/rpc_pipefs at package | |
3 | # uninstall (or in service nfs stop) | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without nfs4 # without NFSv4 support | |
7 | %bcond_without mount # don't build mount.nfs program | |
8 | # | |
9 | Summary: Kernel NFS server | |
10 | Summary(pl.UTF-8): Działający na poziomie jądra serwer NFS | |
11 | Summary(pt_BR.UTF-8): Os utilitários para o cliente e servidor NFS do Linux | |
12 | Summary(ru.UTF-8): Утилиты для NFS и демоны поддержки для NFS-сервера ядра | |
13 | Summary(uk.UTF-8): Утиліти для NFS та демони підтримки для NFS-сервера ядра | |
14 | Name: nfs-utils | |
15 | Version: 1.1.3 | |
16 | Release: 4 | |
17 | License: GPL v2 | |
18 | Group: Networking/Daemons | |
19 | Source0: ftp://ftp.kernel.org/pub/linux/utils/nfs/%{name}-%{version}.tar.gz | |
20 | # Source0-md5: 167d231850b00c7c63300747aeb94c38 | |
21 | #Source1: ftp://ftp.linuxnfs.sourceforge.org/pub/nfs/nfs.doc.tar.gz | |
22 | Source1: nfs.doc.tar.gz | |
23 | # Source1-md5: ae7db9c61c5ad04f83bb99e5caed73da | |
24 | Source2: nfs.init | |
25 | Source3: nfslock.init | |
26 | Source4: nfsfs.init | |
27 | Source5: rpcidmapd.init | |
28 | Source6: rpcgssd.init | |
29 | Source7: rpcsvcgssd.init | |
30 | Source8: nfs.sysconfig | |
31 | Source9: nfslock.sysconfig | |
32 | Source10: nfsfs.sysconfig | |
33 | Patch0: %{name}-eepro-support.patch | |
34 | Patch1: %{name}-install.patch | |
35 | Patch2: %{name}-statdpath.patch | |
36 | Patch3: %{name}-mountd.patch | |
37 | Patch4: %{name}-idmapd.conf.patch | |
38 | Patch5: %{name}-keytab-path.patch | |
39 | Patch6: %{name}-subsys.patch | |
40 | URL: http://nfs.sourceforge.net/ | |
41 | BuildRequires: autoconf >= 2.59 | |
42 | BuildRequires: automake | |
43 | BuildRequires: cpp | |
44 | BuildRequires: e2fsprogs-devel >= 1.39-5 | |
45 | %if %{with nfs4} | |
46 | BuildRequires: krb5-devel >= 1.6 | |
47 | BuildRequires: libevent-devel >= 1.2 | |
48 | BuildRequires: libgssglue-devel >= 0.1 | |
49 | BuildRequires: libnfsidmap-devel | |
50 | BuildRequires: librpcsecgss-devel >= 0.16 | |
51 | %endif | |
52 | BuildRequires: libtool | |
53 | BuildRequires: libwrap-devel | |
54 | BuildRequires: pkgconfig | |
55 | BuildRequires: sed >= 4.0 | |
56 | # lucid context fields mismatch with current version of spkm3.h | |
57 | BuildConflicts: gss_mech_spkm3-devel | |
58 | Requires(post): fileutils | |
59 | Requires(post): sed >= 4.0 | |
60 | Requires(post,preun): /sbin/chkconfig | |
61 | Requires: %{name}-common = %{version}-%{release} | |
62 | Requires: portmap >= 4.0 | |
63 | Requires: rc-scripts >= 0.4.1.5 | |
64 | Requires: setup >= 2.4.6-7 | |
65 | Provides: nfsdaemon | |
66 | Obsoletes: knfsd | |
67 | Obsoletes: nfs-server | |
68 | Obsoletes: nfsdaemon | |
69 | Conflicts: kernel < 2.2.5 | |
70 | ExcludeArch: armv4l | |
71 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
72 | ||
73 | %description | |
74 | This is the *new* kernel NFS server and related tools. It provides a | |
75 | much higher level of performance than the traditional Linux user-land | |
76 | NFS server. | |
77 | ||
78 | %description -l pl.UTF-8 | |
79 | To jest *nowy* działający na poziomie jądra serwer NFS oraz związane z | |
80 | nim narzędzia. Serwer ten dostarcza znacznie większą wydajność niż | |
81 | tradycyjny, działający na poziomie użytkownika serwer NFS. | |
82 | ||
83 | %description -l pt_BR.UTF-8 | |
84 | O pacote nfs-utils provê os utilitários para o cliente e servidor NFS | |
85 | do Linux. | |
86 | ||
87 | %description -l ru.UTF-8 | |
88 | Пакет nfs-utils предоставляет демона для NFS-сервера, включенного в | |
89 | ядро, и сопутствующие утилиты, которые обеспечивают намного большую | |
90 | производительность, чем традиционные Linux NFS-сервера, используемые | |
91 | большинством пользователей. | |
92 | ||
93 | %description -l uk.UTF-8 | |
94 | Пакет nfs-utils надає демона для NFS-сервера, вбудованого в ядро, та | |
95 | супутні утиліти, які забезпечують набагато більшу продуктивність, ніж | |
96 | традиційні Linux NFS-сервери, які використовує більшість користувачів. | |
97 | ||
98 | %package clients | |
99 | Summary: Clients for connecting to a remote NFS server | |
100 | Summary(pl.UTF-8): Klienci do łączenia się ze zdalnym serwerem NFS | |
101 | Group: Networking | |
102 | Requires(post,preun): /sbin/chkconfig | |
103 | Requires: %{name}-common = %{version}-%{release} | |
104 | Requires: psmisc | |
105 | Requires: rc-scripts | |
106 | Provides: nfs-server-clients | |
107 | Provides: nfsclient | |
108 | Obsoletes: knfsd-clients | |
109 | Obsoletes: nfs-server-clients | |
110 | Obsoletes: nfsclient | |
111 | ||
112 | %description clients | |
113 | The nfs-server-clients package contains the showmount program. | |
114 | Showmount queries the mount daemon on a remote host for information | |
115 | about the NFS (Network File System) server on the remote host. For | |
116 | example, showmount can display the clients which are mounted on that | |
117 | host. This package is not needed to mount NFS volumes. | |
118 | ||
119 | %description clients -l pl.UTF-8 | |
120 | Pakiet zawiera program showmount służący do odpytywania serwera NFS. | |
121 | Showmount pyta demona na zdalnej maszynie o informacje NFS na zdalnym | |
122 | hoście. Na przykład, showmount potrafi pokazać klientów, którzy są | |
123 | zamountowani na tym serwerze. Ten pakiet nie jest konieczny do | |
124 | zamountowania zasobów NFS. | |
125 | ||
126 | %package lock | |
127 | Summary: Programs for NFS file locking | |
128 | Summary(pl.UTF-8): Programy do obsługi blokowania plików poprzez NFS (lock) | |
129 | Group: Networking | |
130 | Requires(post,preun): /sbin/chkconfig | |
131 | Requires: portmap >= 4.0 | |
132 | Requires: rc-scripts | |
133 | Provides: group(rpcstatd) | |
134 | Provides: user(rpcstatd) | |
135 | Provides: nfslockd | |
136 | Obsoletes: knfsd-lock | |
137 | Obsoletes: nfslockd | |
138 | ||
139 | %description lock | |
140 | The nfs-lock pacage contains programs which support the NFS file lock. | |
141 | Install nfs-lock if you want to use file lock over NFS. | |
142 | ||
143 | %description lock -l pl.UTF-8 | |
144 | Ten pakiet zawiera programy umożliwiające wykonywanie blokowania | |
145 | plików (file locking) poprzez NFS. | |
146 | ||
147 | %package common | |
148 | Summary: Common programs for NFS | |
149 | Summary(pl.UTF-8): Wspólne programy do obsługi NFS | |
150 | Group: Networking | |
151 | Conflicts: mount < 2.13-0.pre7.1 | |
152 | ||
153 | %description common | |
154 | Common programs for NFS. | |
155 | ||
156 | %description common -l pl.UTF-8 | |
157 | Wspólne programy do obsługi NFS. | |
158 | ||
159 | %prep | |
160 | %setup -q -a1 | |
161 | %patch0 -p1 | |
162 | %patch1 -p1 | |
163 | %patch2 -p1 | |
164 | %patch3 -p1 | |
165 | %patch4 -p1 | |
166 | %patch5 -p1 | |
167 | %patch6 -p1 | |
168 | ||
169 | # conflict with GNU stdio extension | |
170 | sed -i -e 's/dprintf/dbgprintf/' support/include/ha-callout.h utils/statd/*.[ch] | |
171 | ||
172 | %build | |
173 | %{__libtoolize} | |
174 | %{__aclocal} -I aclocal | |
175 | %{__autoconf} | |
176 | %{__autoheader} | |
177 | %{__automake} | |
178 | %configure \ | |
179 | %if %{with nfs4} | |
180 | --enable-gss \ | |
181 | --with-krb5=%{_prefix} \ | |
182 | --enable-nfsv4 \ | |
183 | %else | |
184 | --disable-gss \ | |
185 | --disable-nfsv4 \ | |
186 | %endif | |
187 | %{?with_mount:--enable-mount} \ | |
188 | --enable-nfsv3 \ | |
189 | --enable-secure-statd \ | |
190 | --with-statedir=/var/lib/nfs \ | |
191 | --with-tcp-wrappers | |
192 | ||
193 | %{__make} all | |
194 | ||
195 | %install | |
196 | rm -rf $RPM_BUILD_ROOT | |
197 | install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_mandir}/man{5,8}} \ | |
198 | $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \ | |
199 | $RPM_BUILD_ROOT%{_var}/lib/nfs/{rpc_pipefs,v4recovery,statd} | |
200 | ||
201 | %{__make} install \ | |
202 | DESTDIR=$RPM_BUILD_ROOT | |
203 | ||
204 | cat >$RPM_BUILD_ROOT%{_sbindir}/start-statd <<EOF | |
205 | #!/bin/sh | |
206 | # mount.nfs calls this script when mounting a filesystem with locking | |
207 | # enabled, but when statd does not seem to be running (based on | |
208 | # /var/run/rpc.statd.pid). | |
209 | exec /sbin/service nfslock start | |
210 | EOF | |
211 | ||
212 | sed -e "s|#!/bin/bash|#!/bin/sh|" utils/gssd/gss_destroy_creds > $RPM_BUILD_ROOT%{_sbindir}/gss_destroy_creds | |
213 | ||
214 | mv $RPM_BUILD_ROOT%{_sbindir}/rpcdebug $RPM_BUILD_ROOT/sbin | |
215 | install utils/idmapd/idmapd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ | |
216 | ||
217 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfs | |
218 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfslock | |
219 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfsfs | |
220 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/idmapd | |
221 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/gssd | |
222 | install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/svcgssd | |
223 | install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/nfsd | |
224 | install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/nfslock | |
225 | install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/nfsfs | |
226 | ||
227 | > $RPM_BUILD_ROOT%{_var}/lib/nfs/rmtab | |
228 | > $RPM_BUILD_ROOT%{_sysconfdir}/exports | |
229 | ||
230 | rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{mountd,nfsd,statd,sm-notify}.8 | |
231 | echo ".so mountd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.mountd.8 | |
232 | echo ".so nfsd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.nfsd.8 | |
233 | echo ".so statd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.statd.8 | |
234 | echo ".so sm-notify.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.sm-notify.8 | |
235 | %if %{with nfs4} | |
236 | rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{svcgssd,gssd,idmapd}.8 | |
237 | echo ".so gssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.gssd.8 | |
238 | echo ".so idmapd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.idmapd.8 | |
239 | echo ".so svcgssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.svcgssd.8 | |
240 | %endif | |
241 | ||
242 | touch $RPM_BUILD_ROOT/var/lib/nfs/xtab | |
243 | ||
244 | ln -sf /bin/true $RPM_BUILD_ROOT/sbin/fsck.nfs | |
245 | ||
246 | cp -a nfs html | |
247 | ||
248 | %clean | |
249 | rm -rf $RPM_BUILD_ROOT | |
250 | ||
251 | %post | |
252 | /sbin/chkconfig --add nfs | |
253 | %service nfs restart "NFS daemon" | |
254 | %if %{with nfs4} | |
255 | /sbin/chkconfig --add svcgssd | |
256 | %service svcgssd restart "RPC svcgssd" | |
257 | %endif | |
258 | ||
259 | %preun | |
260 | if [ "$1" = "0" ]; then | |
261 | %service nfs stop | |
262 | /sbin/chkconfig --del nfs | |
263 | %if %{with nfs4} | |
264 | %service svcgssd stop | |
265 | /sbin/chkconfig --del svcgssd | |
266 | %endif | |
267 | fi | |
268 | ||
269 | %post clients | |
270 | /sbin/chkconfig --add nfsfs | |
271 | %service nfsfs restart | |
272 | %if %{with nfs4} | |
273 | /sbin/chkconfig --add gssd | |
274 | %service gssd restart "RPC gssd" | |
275 | %endif | |
276 | ||
277 | %preun clients | |
278 | if [ "$1" = "0" ]; then | |
279 | %service nfsfs stop | |
280 | /sbin/chkconfig --del nfsfs | |
281 | %if %{with nfs4} | |
282 | %service gssd stop | |
283 | /sbin/chkconfig --del gssd | |
284 | %endif | |
285 | fi | |
286 | ||
287 | %pre lock | |
288 | %groupadd -g 191 rpcstatd | |
289 | %useradd -u 191 -d /var/lib/nfs/statd -s /bin/false -c "RPC statd user" -g rpcstatd rpcstatd | |
290 | ||
291 | %post lock | |
292 | /sbin/chkconfig --add nfslock | |
293 | %service nfslock restart "RPC statd" | |
294 | ||
295 | %preun lock | |
296 | if [ "$1" = "0" ]; then | |
297 | %service nfslock stop | |
298 | /sbin/chkconfig --del nfslock | |
299 | fi | |
300 | ||
301 | %postun lock | |
302 | if [ "$1" = "0" ]; then | |
303 | %userremove rpcstatd | |
304 | %groupremove rpcstatd | |
305 | fi | |
306 | ||
307 | %if %{with nfs4} | |
308 | %post common | |
309 | /sbin/chkconfig --add idmapd | |
310 | %service idmapd restart "RPC idmapd" | |
311 | ||
312 | %preun common | |
313 | if [ "$1" = "0" ]; then | |
314 | %service idmapd stop | |
315 | /sbin/chkconfig --del idmapd | |
316 | fi | |
317 | %endif | |
318 | ||
319 | %triggerpostun -- %{name} < 1.1.0-0.rc1.1 | |
320 | /sbin/chkconfig nfs reset | |
321 | %if %{with nfs4} | |
322 | /sbin/chkconfig svcgssd reset | |
323 | %endif | |
324 | ||
325 | %triggerpostun lock -- %{name}-lock < 1.1.0-0.rc1.1 | |
326 | /sbin/chkconfig nfslock reset | |
327 | ||
328 | %triggerpostun clients -- %{name}-clients < 1.1.0-0.rc1.1 | |
329 | if [ -f /etc/sysconfig/nfsclient.rpmsave ]; then | |
330 | mv -f /etc/sysconfig/nfsfs{,.rpmnew} | |
331 | mv -f /etc/sysconfig/nfsclient.rpmsave /etc/sysconfig/nfsfs | |
332 | fi | |
333 | /sbin/chkconfig nfsfs reset | |
334 | %if %{with nfs4} | |
335 | /sbin/chkconfig gssd reset | |
336 | %endif | |
337 | ||
338 | %if %{with nfs4} | |
339 | %triggerpostun common -- %{name}-common < 1.1.0-0.rc1.1 | |
340 | /sbin/chkconfig idmapd reset | |
341 | %endif | |
342 | ||
343 | %files | |
344 | %defattr(644,root,root,755) | |
345 | %doc ChangeLog README html | |
346 | %attr(755,root,root) /sbin/rpcdebug | |
347 | %attr(755,root,root) /sbin/fsck.nfs | |
348 | %attr(755,root,root) %{_sbindir}/exportfs | |
349 | %attr(755,root,root) %{_sbindir}/rpc.mountd | |
350 | %attr(755,root,root) %{_sbindir}/rpc.nfsd | |
351 | %attr(755,root,root) %{_sbindir}/nfsstat | |
352 | ||
353 | %attr(754,root,root) /etc/rc.d/init.d/nfs | |
354 | ||
355 | %attr(664,root,fileshare) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/exports | |
356 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsd | |
357 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/xtab | |
358 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/etab | |
359 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/rmtab | |
360 | ||
361 | %{_mandir}/man5/exports.5* | |
362 | %{_mandir}/man7/nfsd.7* | |
363 | %{_mandir}/man8/exportfs.8* | |
364 | %{_mandir}/man8/mountd.8* | |
365 | %{_mandir}/man8/nfsd.8* | |
366 | %{_mandir}/man8/nfsstat.8* | |
367 | %{_mandir}/man8/rpc.mountd.8* | |
368 | %{_mandir}/man8/rpc.nfsd.8* | |
369 | %{_mandir}/man8/rpcdebug.8* | |
370 | %if %{with nfs4} | |
371 | %attr(754,root,root) /etc/rc.d/init.d/svcgssd | |
372 | %attr(755,root,root) %{_sbindir}/rpc.svcgssd | |
373 | %{_mandir}/man8/*svcgss* | |
374 | %endif | |
375 | ||
376 | %files lock | |
377 | %defattr(644,root,root,755) | |
378 | %attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd | |
379 | %attr(755,root,root) %{_sbindir}/rpc.statd | |
380 | %attr(755,root,root) %{_sbindir}/sm-notify | |
381 | %attr(755,root,root) %{_sbindir}/start-statd | |
382 | %attr(754,root,root) /etc/rc.d/init.d/nfslock | |
383 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfslock | |
384 | %{_mandir}/man8/*statd.8* | |
385 | %{_mandir}/man8/*sm-notify.8* | |
386 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/state | |
387 | ||
388 | %files clients | |
389 | %defattr(644,root,root,755) | |
390 | %attr(754,root,root) /etc/rc.d/init.d/nfsfs | |
391 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsfs | |
392 | %attr(755,root,root) %{_sbindir}/showmount | |
393 | %{_mandir}/man8/showmount.8* | |
394 | %if %{with mount} | |
395 | %attr(4755,root,root) /sbin/mount.nfs | |
396 | %attr(4755,root,root) /sbin/mount.nfs4 | |
397 | %attr(4755,root,root) /sbin/umount.nfs | |
398 | %attr(4755,root,root) /sbin/umount.nfs4 | |
399 | %{_mandir}/man8/*mount.nfs.8* | |
400 | %endif | |
401 | %if %{with nfs4} | |
402 | %attr(754,root,root) /etc/rc.d/init.d/gssd | |
403 | %attr(755,root,root) %{_sbindir}/rpc.gssd | |
404 | %{_mandir}/man8/rpc.gssd* | |
405 | %{_mandir}/man8/gssd* | |
406 | %endif | |
407 | ||
408 | %files common | |
409 | %defattr(644,root,root,755) | |
410 | %attr(755,root,root) %dir %{_var}/lib/nfs | |
411 | %attr(755,root,root) %dir %{_var}/lib/nfs/rpc_pipefs | |
412 | %attr(755,root,root) %dir %{_var}/lib/nfs/v4recovery | |
413 | %{_mandir}/man5/nfs* | |
414 | %if %{with nfs4} | |
415 | %attr(754,root,root) /etc/rc.d/init.d/idmapd | |
416 | %attr(755,root,root) %{_sbindir}/gss_* | |
417 | %attr(755,root,root) %{_sbindir}/rpc.idmapd | |
418 | %attr(660,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/idmapd.conf | |
419 | %{_mandir}/man[58]/*idmap* | |
420 | %endif |