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