# uninstall (or in service nfs stop)
#
# Conditional build:
-%bcond_without nfs4 # without NFSv4 support
-%bcond_without mount # don't build mount.nfs program
+%bcond_with heimdal # build with Heimdal Kerberos instead of MIT
#
Summary: Kernel NFS server
Summary(pl.UTF-8): Działający na poziomie jądra serwer NFS
Summary(ru.UTF-8): Утилиты для NFS и демоны поддержки для NFS-сервера ядра
Summary(uk.UTF-8): Утиліти для NFS та демони підтримки для NFS-сервера ядра
Name: nfs-utils
-Version: 1.1.0
-%define _pre rc1
-Release: 0.%{_pre}.1
-License: GPL
+Version: 1.2.0
+Release: 2
+License: GPL v2
Group: Networking/Daemons
-Source0: http://dl.sourceforge.net/nfs/%{name}-%{version}-%{_pre}.tar.gz
-# Source0-md5: 924dd05dc3958d4da585d74808bb84c4
-Source1: ftp://ftp.linuxnfs.sourceforge.org/pub/nfs/nfs.doc.tar.gz
+Source0: http://www.kernel.org/pub/linux/utils/nfs/%{name}-%{version}.tar.bz2
+# Source0-md5: 779cf81044e92cb51ad590960e7b3671
+#Source1: ftp://ftp.linuxnfs.sourceforge.org/pub/nfs/nfs.doc.tar.gz
+Source1: nfs.doc.tar.gz
# Source1-md5: ae7db9c61c5ad04f83bb99e5caed73da
Source2: nfs.init
Source3: nfslock.init
Source8: nfs.sysconfig
Source9: nfslock.sysconfig
Source10: nfsfs.sysconfig
-Patch0: %{name}-eepro-support.patch
-Patch1: %{name}-install.patch
-# http://www.citi.umich.edu/projects/nfsv4/linux/nfs-utils-patches/
-#Patch2: %{name}-1.0.11-CITI_NFS4_ALL-1.dif
-Patch2: %{name}-CITI_NFS4.patch
-Patch3: %{name}-statdpath.patch
-Patch4: %{name}-mount-fake.patch
-Patch5: %{name}-mountd.patch
-Patch6: %{name}-idmapd.conf.patch
-Patch7: %{name}-keytab-path.patch
-Patch8: %{name}-subsys.patch
+Patch0: %{name}-install.patch
+Patch1: %{name}-statdpath.patch
+Patch2: %{name}-keytab-path.patch
+Patch3: %{name}-subsys.patch
+Patch4: %{name}-union-mount.patch
+Patch5: %{name}-kerberos-ac.patch
+Patch6: %{name}-no_libgssapi.patch
+Patch7: %{name}-pkgconfig_ac.patch
+Patch8: %{name}-heimdal_functions.patch
URL: http://nfs.sourceforge.net/
BuildRequires: autoconf >= 2.59
BuildRequires: automake
BuildRequires: cpp
-BuildRequires: e2fsprogs-devel >= 1.39-5
-%if %{with nfs4}
+%if %{with heimdal}
+BuildRequires: heimdal-devel >= 1.0
+%else
BuildRequires: krb5-devel >= 1.6
-BuildRequires: libevent-devel >= 1.2
-BuildRequires: libnfsidmap-devel
-BuildRequires: librpcsecgss-devel >= 0.11-3
+BuildRequires: libgssglue-devel >= 0.1
%endif
+BuildRequires: libblkid-devel
+BuildRequires: libevent-devel >= 1.2
+BuildRequires: libnfsidmap-devel >= 0.21-3
+BuildRequires: librpcsecgss-devel >= 0.16
+BuildRequires: libtirpc-devel >= 1:0.1.10-4
BuildRequires: libtool
BuildRequires: libwrap-devel
BuildRequires: pkgconfig
BuildRequires: sed >= 4.0
+# lucid context fields mismatch with current version of spkm3.h
+BuildConflicts: gss_mech_spkm3-devel
Requires(post): fileutils
Requires(post): sed >= 4.0
Requires(post,preun): /sbin/chkconfig
Requires: %{name}-common = %{version}-%{release}
-Requires: portmap >= 4.0
-Requires: rc-scripts >= 0.4.0
+Requires: rpcbind >= 0.1.7
+Requires: rc-scripts >= 0.4.1.5
Requires: setup >= 2.4.6-7
Provides: nfsdaemon
Obsoletes: knfsd
Summary(pl.UTF-8): Programy do obsługi blokowania plików poprzez NFS (lock)
Group: Networking
Requires(post,preun): /sbin/chkconfig
-Requires: portmap >= 4.0
+Requires: rpcbind >= 0.1.7
Requires: rc-scripts
Provides: group(rpcstatd)
Provides: user(rpcstatd)
Summary: Common programs for NFS
Summary(pl.UTF-8): Wspólne programy do obsługi NFS
Group: Networking
+Requires: libnfsidmap >= 0.21-3
+Conflicts: mount < 2.13-0.pre7.1
%description common
Common programs for NFS.
Wspólne programy do obsługi NFS.
%prep
-%setup -q -a1 -n %{name}-%{version}-%{_pre}
+%setup -q -a1
%patch0 -p1
%patch1 -p1
-%patch2 -p1
+%{!?with_heimdal:%patch2 -p1}
%patch3 -p1
%patch4 -p1
+%if %{with heimdal}
%patch5 -p1
%patch6 -p1
%patch7 -p1
-%patch8 -p1
+%patch8 -p0
+%endif
+
+# conflict with GNU stdio extension
+sed -i -e 's/dprintf/dbgprintf/' support/include/ha-callout.h utils/statd/*.[ch]
%build
+%{__libtoolize}
+%{__aclocal} -I aclocal
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
-%if %{with nfs4}
- --enable-gss \
- --with-krb5=%{_prefix} \
+ --enable-nfsv3 \
--enable-nfsv4 \
+ --enable-gss \
+ --enable-mount \
+ --enable-tirpc \
+ --enable-ipv6 \
+ --with-statedir=/var/lib/nfs \
+ --with-statduser=rpcstatd \
+ --with-start-statd=%{_sbindir}/start-statd \
+ --with-tcp-wrappers \
+%if %{with heimdal}
+ --with-krb5-config=%{_bindir}/krb5-config
%else
- --disable-gss \
- --disable-nfsv4 \
+ --with-krb5=%{_prefix}
%endif
- %{?with_mount:--enable-mount} \
- --disable-rquotad \
- --enable-nfsv3 \
- --enable-secure-statd \
- --with-statedir=/var/lib/nfs \
- --with-tcp-wrappers
%{__make} all
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_mandir}/man{5,8}} \
- $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \
- $RPM_BUILD_ROOT%{_var}/lib/nfs/{rpc_pipefs,v4recovery,statd}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \
+ $RPM_BUILD_ROOT%{_var}/lib/nfs/{rpc_pipefs,v4recovery}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
sed -e "s|#!/bin/bash|#!/bin/sh|" utils/gssd/gss_destroy_creds > $RPM_BUILD_ROOT%{_sbindir}/gss_destroy_creds
mv $RPM_BUILD_ROOT%{_sbindir}/rpcdebug $RPM_BUILD_ROOT/sbin
-install utils/idmapd/idmapd.conf $RPM_BUILD_ROOT%{_sysconfdir}/
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfs
install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfslock
> $RPM_BUILD_ROOT%{_var}/lib/nfs/rmtab
> $RPM_BUILD_ROOT%{_sysconfdir}/exports
-rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{mountd,nfsd,statd,svcgssd,gssd,idmapd,sm-notify}.8
+rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{mountd,nfsd,statd,sm-notify}.8
+rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{svcgssd,gssd,idmapd}.8
echo ".so mountd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.mountd.8
echo ".so nfsd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.nfsd.8
echo ".so statd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.statd.8
echo ".so sm-notify.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.sm-notify.8
-%if %{with nfs4}
echo ".so gssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.gssd.8
echo ".so idmapd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.idmapd.8
echo ".so svcgssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.svcgssd.8
-%endif
touch $RPM_BUILD_ROOT/var/lib/nfs/xtab
%post
/sbin/chkconfig --add nfs
%service nfs restart "NFS daemon"
-%if %{with nfs4}
/sbin/chkconfig --add svcgssd
%service svcgssd restart "RPC svcgssd"
-%endif
%preun
if [ "$1" = "0" ]; then
%service nfs stop
/sbin/chkconfig --del nfs
-%if %{with nfs4}
%service svcgssd stop
/sbin/chkconfig --del svcgssd
-%endif
fi
%post clients
/sbin/chkconfig --add nfsfs
%service nfsfs restart
-%if %{with nfs4}
/sbin/chkconfig --add gssd
%service gssd restart "RPC gssd"
-%endif
%preun clients
if [ "$1" = "0" ]; then
%service nfsfs stop
/sbin/chkconfig --del nfsfs
-%if %{with nfs4}
%service gssd stop
/sbin/chkconfig --del gssd
-%endif
fi
%pre lock
%groupremove rpcstatd
fi
-%if %{with nfs4}
%post common
/sbin/chkconfig --add idmapd
%service idmapd restart "RPC idmapd"
%service idmapd stop
/sbin/chkconfig --del idmapd
fi
-%endif
-%triggerpostun -- %{name} <= 1.1.0-0.rc1.1
+%triggerpostun -- %{name} < 1.1.0-0.rc1.1
/sbin/chkconfig nfs reset
-%if %{with nfs4}
/sbin/chkconfig svcgssd reset
-%endif
-%triggerpostun lock -- %{name}-lock <= 1.1.0-0.rc1.1
+%triggerpostun lock -- %{name}-lock < 1.1.0-0.rc1.1
/sbin/chkconfig nfslock reset
%triggerpostun clients -- %{name}-clients < 1.1.0-0.rc1.1
mv -f /etc/sysconfig/nfsclient.rpmsave /etc/sysconfig/nfsfs
fi
/sbin/chkconfig nfsfs reset
-%if %{with nfs4}
/sbin/chkconfig gssd reset
-%endif
-%if %{with nfs4}
-%triggerpostun common -- %{name}-common <= 1.1.0-0.rc1.1
+%triggerpostun common -- %{name}-common < 1.1.0-0.rc1.1
/sbin/chkconfig idmapd reset
-%endif
%files
%defattr(644,root,root,755)
%{_mandir}/man8/rpc.mountd.8*
%{_mandir}/man8/rpc.nfsd.8*
%{_mandir}/man8/rpcdebug.8*
-%if %{with nfs4}
%attr(754,root,root) /etc/rc.d/init.d/svcgssd
%attr(755,root,root) %{_sbindir}/rpc.svcgssd
%{_mandir}/man8/*svcgss*
-%endif
%files lock
%defattr(644,root,root,755)
%attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd
+%attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd/sm
+%attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd/sm.bak
+%attr(600,rpcstatd,rpcstatd) %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/statd/state
%attr(755,root,root) %{_sbindir}/rpc.statd
%attr(755,root,root) %{_sbindir}/sm-notify
%attr(755,root,root) %{_sbindir}/start-statd
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfslock
%{_mandir}/man8/*statd.8*
%{_mandir}/man8/*sm-notify.8*
-%config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/state
%files clients
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsfs
%attr(755,root,root) %{_sbindir}/showmount
%{_mandir}/man8/showmount.8*
-%if %{with mount}
%attr(4755,root,root) /sbin/mount.nfs
-%attr(4755,root,root) /sbin/mount.nfs4
%attr(4755,root,root) /sbin/umount.nfs
+%attr(4755,root,root) /sbin/mount.nfs4
%attr(4755,root,root) /sbin/umount.nfs4
%{_mandir}/man8/*mount.nfs.8*
-%endif
-%if %{with nfs4}
%attr(754,root,root) /etc/rc.d/init.d/gssd
%attr(755,root,root) %{_sbindir}/rpc.gssd
%{_mandir}/man8/rpc.gssd*
%{_mandir}/man8/gssd*
-%endif
%files common
%defattr(644,root,root,755)
%attr(755,root,root) %dir %{_var}/lib/nfs/rpc_pipefs
%attr(755,root,root) %dir %{_var}/lib/nfs/v4recovery
%{_mandir}/man5/nfs*
-%if %{with nfs4}
%attr(754,root,root) /etc/rc.d/init.d/idmapd
%attr(755,root,root) %{_sbindir}/gss_*
%attr(755,root,root) %{_sbindir}/rpc.idmapd
-%attr(660,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/idmapd.conf
%{_mandir}/man[58]/*idmap*
-%endif