3 %bcond_with krb5 # build with MIT Kerberos (+libgssglue) instead of Heimdal
4 %bcond_without tirpc # use librpcsecgss instead of libtirpc
6 Summary: Kernel NFS server
7 Summary(pl.UTF-8): Działający na poziomie jądra serwer NFS
8 Summary(pt_BR.UTF-8): Os utilitários para o cliente e servidor NFS do Linux
9 Summary(ru.UTF-8): Утилиты для NFS и демоны поддержки для NFS-сервера ядра
10 Summary(uk.UTF-8): Утиліти для NFS та демони підтримки для NFS-сервера ядра
15 Group: Networking/Daemons
16 #Source0: http://www.kernel.org/pub/linux/utils/nfs/%{name}-%{version}.tar.bz2
17 Source0: http://downloads.sourceforge.net/nfs/%{name}-%{version}.tar.bz2
18 # Source0-md5: 8395ac770720b83c5c469f88306d7765
19 #Source1: ftp://ftp.linuxnfs.sourceforge.org/pub/nfs/nfs.doc.tar.gz
20 Source1: nfs.doc.tar.gz
21 # Source1-md5: ae7db9c61c5ad04f83bb99e5caed73da
25 Source5: rpcidmapd.init
27 Source7: rpcsvcgssd.init
28 Source8: nfs.sysconfig
29 Source9: nfslock.sysconfig
30 Source10: nfsfs.sysconfig
31 Source11: blkmapd.init
32 Source100: proc-fs-nfsd.mount
33 Source101: var-lib-nfs-rpc_pipefs.mount
34 Source102: nfsd.service
35 Source103: nfs-blkmapd.service
36 Source104: nfs-exportfs.service
37 Source105: nfs-gssd.service
38 Source106: nfs-idmapd.service
39 Source107: nfs-lock.service
40 Source108: nfs-mountd.service
41 Source109: nfs-svcgssd.service
42 Source110: nfsd.postconfig
43 Source111: nfsd.preconfig
44 Source112: nfs-lock.preconfig
45 Patch0: %{name}-install.patch
46 Patch1: %{name}-statdpath.patch
47 Patch2: %{name}-subsys.patch
48 Patch3: %{name}-union-mount.patch
49 Patch4: %{name}-heimdal.patch
50 Patch5: %{name}-heimdal-kcm.patch
51 URL: http://nfs.sourceforge.net/
52 BuildRequires: autoconf >= 2.59
53 BuildRequires: automake
55 BuildRequires: keyutils-devel
56 BuildRequires: libblkid-devel >= 1.40
57 BuildRequires: libmount-devel
58 BuildRequires: libcap-devel
59 BuildRequires: device-mapper-devel
60 BuildRequires: libevent-devel >= 1.2
61 BuildRequires: libnfsidmap-devel >= 0.24
62 BuildRequires: libtool
63 BuildRequires: libwrap-devel
64 BuildRequires: pkgconfig
65 BuildRequires: rpm-pythonprov
67 BuildRequires: libtirpc-devel >= 1:0.1.10-4
69 BuildRequires: librpcsecgss-devel >= 0.16
72 BuildRequires: krb5-devel >= 1.6
73 BuildRequires: libgssglue-devel >= 0.3
75 BuildRequires: heimdal-devel >= 1.0
77 BuildRequires: rpmbuild(macros) >= 1.623
78 # lucid context fields mismatch with current version of spkm3.h
79 BuildConflicts: gss_mech_spkm3-devel
80 Requires(post): fileutils
81 Requires(post): sed >= 4.0
82 Requires(post,preun): /sbin/chkconfig
83 Requires: %{name}-common = %{version}-%{release}
84 Requires: libevent >= 2.0.14-2
85 Requires: rc-scripts >= 0.4.1.5
86 Requires: rpcbind >= 0.1.7
87 Requires: setup >= 2.4.6-7
92 Conflicts: kernel < 2.2.5
93 Conflicts: krb5-common < 1.7
95 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
98 This is the *new* kernel NFS server and related tools. It provides a
99 much higher level of performance than the traditional Linux user-land
102 %description -l pl.UTF-8
103 To jest *nowy* działający na poziomie jądra serwer NFS oraz związane z
104 nim narzędzia. Serwer ten dostarcza znacznie większą wydajność niż
105 tradycyjny, działający na poziomie użytkownika serwer NFS.
107 %description -l pt_BR.UTF-8
108 O pacote nfs-utils provê os utilitários para o cliente e servidor NFS
111 %description -l ru.UTF-8
112 Пакет nfs-utils предоставляет демона для NFS-сервера, включенного в
113 ядро, и сопутствующие утилиты, которые обеспечивают намного большую
114 производительность, чем традиционные Linux NFS-сервера, используемые
115 большинством пользователей.
117 %description -l uk.UTF-8
118 Пакет nfs-utils надає демона для NFS-сервера, вбудованого в ядро, та
119 супутні утиліти, які забезпечують набагато більшу продуктивність, ніж
120 традиційні Linux NFS-сервери, які використовує більшість користувачів.
123 Summary: systemd units for NFS server services
124 Summary(pl.UTF-8): Jednostki systemd dla serwisów serwera NFS
126 Requires: %{name} = %{version}-%{release}
128 Requires: systemd-units
131 Systemd units for NFS server services.
133 %description systemd -l pl.UTF-8
134 Jednostki systemd dla serwisów serwera NFS.
137 Summary: Clients for connecting to a remote NFS server
138 Summary(pl.UTF-8): Klienci do łączenia się ze zdalnym serwerem NFS
140 Requires(post,preun): /sbin/chkconfig
141 Requires: %{name}-common = %{version}-%{release}
144 Provides: nfs-server-clients
146 Obsoletes: knfsd-clients
147 Obsoletes: nfs-server-clients
149 Conflicts: krb5-common < 1.7
152 The nfs-server-clients package contains the showmount program.
153 Showmount queries the mount daemon on a remote host for information
154 about the NFS (Network File System) server on the remote host. For
155 example, showmount can display the clients which are mounted on that
156 host. This package is not needed to mount NFS volumes.
158 %description clients -l pl.UTF-8
159 Pakiet zawiera program showmount służący do odpytywania serwera NFS.
160 Showmount pyta demona na zdalnej maszynie o informacje NFS na zdalnym
161 hoście. Na przykład, showmount potrafi pokazać klientów, którzy są
162 zamountowani na tym serwerze. Ten pakiet nie jest konieczny do
163 zamountowania zasobów NFS.
165 %package clients-systemd
166 Summary: systemd units for NFS clients
167 Summary(pl.UTF-8): Jednostki systemd dla klientów NFS
169 Requires: %{name}-clients = %{version}-%{release}
171 Requires: systemd-units
173 %description clients-systemd
174 Systemd units for NFS clients.
176 %description clients-systemd -l pl.UTF-8
177 Jednostki systemd dla klientów NFS.
180 Summary: Common programs for NFS
181 Summary(pl.UTF-8): Wspólne programy do obsługi NFS
183 Requires(post,preun): /sbin/chkconfig
184 Provides: user(rpcstatd)
185 Provides: group(rpcstatd)
187 Provides: nfs-utils-lock
188 Requires: libnfsidmap >= 0.25-3
190 Requires: rpcbind >= 0.1.7
191 Obsoletes: nfs-utils-lock
192 Obsoletes: knfsd-lock
194 Conflicts: mount < 2.13-0.pre7.1
197 Common programs for NFS.
199 %description common -l pl.UTF-8
200 Wspólne programy do obsługi NFS.
202 %package common-systemd
203 Summary: systemd units for common NFS services
204 Summary(pl.UTF-8): Jednostki systemd dla wspólnych serwisów NFS
206 Requires: %{name}-common = %{version}-%{release}
208 Requires: systemd-units
210 %description common-systemd
211 Systemd units for common NFS services.
213 %description common-systemd -l pl.UTF-8
214 Jednostki systemd dla wspólnych serwisów NFS.
227 %{__aclocal} -I aclocal
237 --enable-mountconfig \
238 --enable-libmount-mount \
246 --with-statdpath=/var/lib/nfs/statd \
247 --with-statedir=/var/lib/nfs \
248 --with-statduser=rpcstatd \
249 --with-start-statd=/sbin/start-statd \
250 --with-tcp-wrappers \
256 rm -rf $RPM_BUILD_ROOT
257 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,exports.d} \
258 $RPM_BUILD_ROOT%{_var}/lib/nfs/{rpc_pipefs,v4recovery} \
259 $RPM_BUILD_ROOT{%{systemdunitdir},%{_datadir}/nfs-utils}
262 DESTDIR=$RPM_BUILD_ROOT
264 install -p utils/mount/nfsmount.conf $RPM_BUILD_ROOT/etc
266 cat >$RPM_BUILD_ROOT/sbin/start-statd <<EOF
268 # mount.nfs calls this script when mounting a filesystem with locking
269 # enabled, but when statd does not seem to be running (based on
270 # /var/run/rpc.statd.pid).
271 exec /sbin/rpc.statd --no-notify
274 %{__sed} -i -e "s|#!/bin/bash|#!/bin/sh|" $RPM_BUILD_ROOT%{_sbindir}/gss_destroy_creds
275 %{__sed} -i -e 's|%{_sbindir}nfsidmap|/sbin/nfsidmap|g' $RPM_BUILD_ROOT%{_mandir}/man8/nfsidmap.8
277 for f in rpcdebug blkmapd nfsidmap rpc.gssd rpc.idmapd rpc.statd ; do
278 mv $RPM_BUILD_ROOT%{_sbindir}/$f $RPM_BUILD_ROOT/sbin
281 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfs
282 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfslock
283 install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfsfs
284 install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/idmapd
285 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/gssd
286 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/svcgssd
287 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/blkmapd
288 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/nfsd
289 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/nfslock
290 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/nfsfs
292 install %{SOURCE100} $RPM_BUILD_ROOT%{systemdunitdir}/proc-fs-nfsd.mount
293 install %{SOURCE101} $RPM_BUILD_ROOT%{systemdunitdir}/var-lib-nfs-rpc_pipefs.mount
294 install %{SOURCE102} $RPM_BUILD_ROOT%{systemdunitdir}/nfsd.service
295 install %{SOURCE103} $RPM_BUILD_ROOT%{systemdunitdir}/blkmapd.service
296 install %{SOURCE104} $RPM_BUILD_ROOT%{systemdunitdir}/nfsd-exportfs.service
297 install %{SOURCE105} $RPM_BUILD_ROOT%{systemdunitdir}/gssd.service
298 install %{SOURCE106} $RPM_BUILD_ROOT%{systemdunitdir}/idmapd.service
299 install %{SOURCE107} $RPM_BUILD_ROOT%{systemdunitdir}/nfslock.service
300 install %{SOURCE108} $RPM_BUILD_ROOT%{systemdunitdir}/nfsd-mountd.service
301 install %{SOURCE109} $RPM_BUILD_ROOT%{systemdunitdir}/svcgssd.service
302 install %{SOURCE110} $RPM_BUILD_ROOT%{_datadir}/nfs-utils/nfsd.postconfig
303 install %{SOURCE111} $RPM_BUILD_ROOT%{_datadir}/nfs-utils/nfsd.preconfig
304 install %{SOURCE112} $RPM_BUILD_ROOT%{_datadir}/nfs-utils/nfslock.preconfig
306 # Disable old SysV service for systemd installs
307 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/nfs.service
308 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/nfsfs.service
310 > $RPM_BUILD_ROOT%{_var}/lib/nfs/rmtab
311 > $RPM_BUILD_ROOT%{_sysconfdir}/exports
313 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{mountd,nfsd,statd,sm-notify,svcgssd,gssd,idmapd}.8
314 echo ".so mountd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.mountd.8
315 echo ".so nfsd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.nfsd.8
316 echo ".so statd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.statd.8
317 echo ".so sm-notify.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.sm-notify.8
318 echo ".so gssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.gssd.8
319 echo ".so idmapd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.idmapd.8
320 echo ".so svcgssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.svcgssd.8
322 touch $RPM_BUILD_ROOT/var/lib/nfs/xtab
324 ln -sf /bin/true $RPM_BUILD_ROOT/sbin/fsck.nfs
329 rm -rf $RPM_BUILD_ROOT
332 /sbin/chkconfig --add nfs
333 %service nfs restart "NFS daemon"
334 /sbin/chkconfig --add svcgssd
335 %service svcgssd restart "RPC svcgssd"
338 if [ "$1" = "0" ]; then
340 /sbin/chkconfig --del nfs
341 %service svcgssd stop
342 /sbin/chkconfig --del svcgssd
346 %systemd_post nfsd.service
347 %systemd_post nfsd-exportfs.service
348 %systemd_post nfsd-mountd.service
349 %systemd_post svcgssd.service
352 %systemd_preun nfsd.service
353 %systemd_preun nfsd-exportfs.service
354 %systemd_preun nfsd-mountd.service
355 %systemd_preun svcgssd.service
361 /sbin/chkconfig --add nfsfs
362 %service nfsfs restart
363 /sbin/chkconfig --add gssd
364 %service gssd restart "RPC gssd"
365 /sbin/chkconfig --add blkmapd
366 %service blkmapd restart "pNFS blkmapd"
369 if [ "$1" = "0" ]; then
371 /sbin/chkconfig --del nfsfs
373 /sbin/chkconfig --del gssd
374 %service blkmapd stop
375 /sbin/chkconfig --del blkmapd
378 %post clients-systemd
379 %systemd_post blkmapd.service
380 %systemd_post gssd.service
382 %preun clients-systemd
383 %systemd_preun blkmapd.service
384 %systemd_preun gssd.service
386 %postun clients-systemd
390 %groupadd -g 191 rpcstatd
391 %useradd -u 191 -d /var/lib/nfs/statd -s /bin/false -c "RPC statd user" -g rpcstatd rpcstatd
394 /sbin/chkconfig --add idmapd
395 %service idmapd restart "RPC idmapd"
396 /sbin/chkconfig --add nfslock
397 %service nfslock restart "RPC statd"
400 if [ "$1" = "0" ]; then
402 /sbin/chkconfig --del idmapd
403 %service nfslock stop
404 /sbin/chkconfig --del nfslock
408 if [ "$1" = "0" ]; then
410 %groupremove rpcstatd
414 %systemd_post idmapd.service
415 %systemd_post nfslock.service
417 %preun common-systemd
418 %systemd_preun idmapd.service
419 %systemd_preun nfslock.service
421 %postun common-systemd
424 %triggerpostun -- %{name} < 1.2.5-4
425 if [ -f /etc/sysconfig/nfsd ]; then
426 . /etc/sysconfig/nfsd
428 [ -n "$MOUNTD_PORT" ] && __RPCMOUNTDOPTIONS="-p $MOUNTD_PORT"
429 for vers in 2 3 4 ; do
430 __var=$(eval echo \$NFSv$vers)
431 [ -n "$__var" -a "$__var" != "yes" ] && \
432 __RPCMOUNTDOPTIONS="$__RPCMOUNTDOPTIONS --no-nfs-version $vers"
434 [ -z "$__RPCMOUNTDOPTIONS" ] && exit 0
435 cp -f /etc/sysconfig/nfsd{,.rpmsave}
436 echo >>/etc/sysconfig/nfsd
437 echo "# Added by rpm trigger" >>/etc/sysconfig/nfsd
438 echo "RPCMOUNTDOPTIONS=\"$RPCMOUNTOPTIONS $__RPCMOUNTDOPTIONS\"" >>/etc/sysconfig/nfsd
441 %triggerpostun common -- %{name}-lock < 1.2.5-3
442 if [ -f /etc/sysconfig/nfslock.rpmsave ]; then
443 mv -f /etc/sysconfig/nfslock{,.rpmnew}
444 mv -f /etc/sysconfig/nfslock.rpmsave /etc/sysconfig/nfslock
447 %triggerpostun common -- %{name}-common < 1.2.5-4
448 if [ -f /etc/sysconfig/nfslock ]; then
449 . /etc/sysconfig/nfslock
450 [ -n "$STATD_PORT" ] && STATDOPTS="$STATDOPTS -p $STATD_PORT"
451 [ -n "$STATD_OUTPORT" ] && STATDOPTS="$STATDOPTS -o $STATD_OUTPORT"
452 [ -z "$STATDOPTS" ] && exit 0
453 cp -f /etc/sysconfig/nfslock{,.rpmsave}
454 echo >>/etc/sysconfig/nfslock
455 echo "# Added by rpm trigger" >>/etc/sysconfig/nfslock
456 echo "STATDOPTIONS=\"$STATDOPTS\"" >>/etc/sysconfig/nfslock
460 %defattr(644,root,root,755)
461 %doc ChangeLog README html
462 %attr(755,root,root) /sbin/rpcdebug
463 %attr(755,root,root) /sbin/fsck.nfs
464 %attr(755,root,root) %{_sbindir}/exportfs
465 %attr(755,root,root) %{_sbindir}/rpc.mountd
466 %attr(755,root,root) %{_sbindir}/rpc.nfsd
467 %attr(755,root,root) %{_sbindir}/rpc.svcgssd
468 %attr(755,root,root) %{_sbindir}/nfsstat
470 %attr(754,root,root) /etc/rc.d/init.d/nfs
471 %attr(754,root,root) /etc/rc.d/init.d/svcgssd
473 %attr(664,root,fileshare) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/exports
474 %dir %{_sysconfdir}/exports.d
476 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsd
477 %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/xtab
478 %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/etab
479 %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/rmtab
481 %{_mandir}/man5/exports.5*
482 %{_mandir}/man7/nfsd.7*
483 %{_mandir}/man8/exportfs.8*
484 %{_mandir}/man8/mountd.8*
485 %{_mandir}/man8/nfsd.8*
486 %{_mandir}/man8/nfsstat.8*
487 %{_mandir}/man8/rpc.mountd.8*
488 %{_mandir}/man8/rpc.nfsd.8*
489 %{_mandir}/man8/rpc.svcgssd.8*
490 %{_mandir}/man8/rpcdebug.8*
491 %{_mandir}/man8/svcgssd.8*
494 %defattr(644,root,root,755)
495 %{systemdunitdir}/nfs.service
496 %{systemdunitdir}/nfsd.service
497 %{systemdunitdir}/nfsd-exportfs.service
498 %{systemdunitdir}/nfsd-mountd.service
499 %{systemdunitdir}/svcgssd.service
500 %{systemdunitdir}/proc-fs-nfsd.mount
501 %attr(755,root,root) %{_datadir}/nfs-utils/nfsd.postconfig
502 %attr(755,root,root) %{_datadir}/nfs-utils/nfsd.preconfig
505 %defattr(644,root,root,755)
506 %attr(754,root,root) /etc/rc.d/init.d/blkmapd
507 %attr(754,root,root) /etc/rc.d/init.d/gssd
508 %attr(754,root,root) /etc/rc.d/init.d/nfsfs
509 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsfs
510 %attr(664,root,fileshare) %config(noreplace) %verify(not md5 mtime size) /etc/nfsmount.conf
511 %attr(4755,root,root) /sbin/mount.nfs
512 %attr(4755,root,root) /sbin/umount.nfs
513 %attr(4755,root,root) /sbin/mount.nfs4
514 %attr(4755,root,root) /sbin/umount.nfs4
515 %attr(755,root,root) /sbin/blkmapd
516 %attr(755,root,root) /sbin/rpc.gssd
517 %attr(755,root,root) %{_sbindir}/mountstats
518 %attr(755,root,root) %{_sbindir}/nfsiostat
519 %attr(755,root,root) %{_sbindir}/showmount
520 %{_mandir}/man5/nfsmount.conf.5*
521 %{_mandir}/man8/blkmapd.8*
522 %{_mandir}/man8/gssd.8*
523 %{_mandir}/man8/mount.nfs.8*
524 %{_mandir}/man8/mountstats.8*
525 %{_mandir}/man8/nfsiostat.8*
526 %{_mandir}/man8/rpc.gssd.8*
527 %{_mandir}/man8/showmount.8*
528 %{_mandir}/man8/umount.nfs.8*
530 %files clients-systemd
531 %defattr(644,root,root,755)
532 %{systemdunitdir}/nfsfs.service
533 %{systemdunitdir}/blkmapd.service
534 %{systemdunitdir}/gssd.service
537 %defattr(644,root,root,755)
538 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfslock
539 %attr(754,root,root) /etc/rc.d/init.d/idmapd
540 %attr(754,root,root) /etc/rc.d/init.d/nfslock
541 %attr(755,root,root) %{_sbindir}/gss_clnt_send_err
542 %attr(755,root,root) %{_sbindir}/gss_destroy_creds
543 %attr(755,root,root) %{_sbindir}/sm-notify
544 %attr(755,root,root) /sbin/nfsidmap
545 %attr(755,root,root) /sbin/rpc.idmapd
546 %attr(755,root,root) /sbin/rpc.statd
547 %attr(755,root,root) /sbin/start-statd
549 %dir %{_var}/lib/nfs/rpc_pipefs
550 %dir %{_var}/lib/nfs/v4recovery
551 %attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd
552 %attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd/sm
553 %attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd/sm.bak
554 %attr(600,rpcstatd,rpcstatd) %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/statd/state
555 %{_mandir}/man5/nfs.5*
556 %{_mandir}/man8/idmapd.8*
557 %{_mandir}/man8/nfsidmap.8*
558 %{_mandir}/man8/rpc.idmapd.8*
559 %{_mandir}/man8/rpc.sm-notify.8*
560 %{_mandir}/man8/rpc.statd.8*
561 %{_mandir}/man8/sm-notify.8*
562 %{_mandir}/man8/statd.8*
564 %files common-systemd
565 %defattr(644,root,root,755)
566 %{systemdunitdir}/idmapd.service
567 %{systemdunitdir}/nfslock.service
568 %{systemdunitdir}/var-lib-nfs-rpc_pipefs.mount
569 %dir %{_datadir}/nfs-utils
570 %attr(755,root,root) %{_datadir}/nfs-utils/nfslock.preconfig