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