nfs-utils/nfs-utils.spec

340 lines
11 KiB
RPMSpec
Raw Permalink Normal View History

%define rpcuser_uid 65050
%define rpcuser_gid 65050
%define nobodygroupid 65013
%define nobodyuserid 65013
#%define nfsnobody_uid 65051
%define with_rquotad 1
%define with_mount 1
Name: nfs-utils
Version: 1.2.9
Release: 4mamba
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
Group: Network/File Systems
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://nfs.sourceforge.net
#Source0: http://www.kernel.org/pub/linux/utils/nfs/nfs-utils-%{version}.tar.bz2
Source0: http://downloads.sourceforge.net/project/nfs/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2
Source1: nfs-utils-nfs.sysconfig
Source2: nfs-utils-nfs.init
Source3: nfs-utils-nfslock.init
Source4: nfs-utils-rpcidmapd.init
Source5: nfs-utils-rpcgssd.init
Source6: nfs-utils-rpcsvcgssd.init
Source7: nfs-utils-idmapd.conf
Patch0: %{name}-1.2.5-arm-PAGE_SIZE.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libblkid-devel
BuildRequires: libcap-devel
BuildRequires: libdevmapper-devel
BuildRequires: libe2fs-devel
BuildRequires: libevent-devel
BuildRequires: libgssglue-devel
BuildRequires: libkeyutils-devel
%if "%{stage1}" != "1"
BuildRequires: libkrb5-devel
%endif
BuildRequires: libnfsidmap-devel
BuildRequires: librpcsecgss-devel
BuildRequires: libsqlite-devel
BuildRequires: libtirpc-devel
BuildRequires: libuuid-devel
BuildRequires: libwrap-devel
## AUTOBUILDREQ-END
BuildRequires: chkconfig
BuildRequires: pkgconfig
# build libraries needed to support nfsv4
BuildRequires: tcp_wrappers-devel >= 7.6
Requires(pre): /sbin/nologin
Requires: rpcbind
BuildRoot: %{_tmppath}/%{name}-%{version}-root
# FIXME:
# configure: WARNING: could not locate SPKM3 header; will not have SPKM3 support
# Note for linux kernel 2.6.x :
# With 2.6 we have the option of having the kernel tell mountd when it
# gets a request from an unknown host, and mountd can give appropriate
# export information to the kernel. This removes the dependency on
# rmtab and means that the kernel only needs to know about currently
# active clients.
#
# To enable this new functionality, you need to:
#
# mount -t nfsd nfsd /proc/fs/nfs
#
# before running exportfs or mountd. It is recommended that all NFS
# services be protected from the internet-at-large by a firewall where
# that is possible.
%description
The nfs-utils package provides a daemon for the kernel NFS server and related tools, which provides a much higher level of performance than the traditional Linux NFS server used by most users.
This package also contains the showmount program. Showmount queries the mount daemon on a remote host for information about the NFS (Network File System) server on the remote host. For example, showmount can display the clients which are mounted on that host.
%prep
%setup -q
#%patch0 -p1
%build
# --disable-tirpc: we currently use portmap.
# Enabling tirpc causes nfs.mountd not to start when IPv6 is disabled
%configure \
--enable-nfsv4 \
--enable-tirpc \
%if "%{stage1}" == "1"
--disable-gss \
%else
--enable-gss \
%endif
%if %{with_mount}
--enable-mount \
%else
--disable-mount \
%endif
--with-tcp-wrappers \
--enable-shared \
--disable-static \
--with-statduser=rpcuser \
--with-start-statd=/sbin/start-statd \
%if "%{_host}" != "%{_build}"
--without-krb5 \
LDFLAGS="-L%{_prefix}/%{_host}/lib -lnsl -ldl -luuid -lgssglue -lrpcsecgss"
%endif
#% if %{with_rquotad}
# --enable-rquotad \
#% else
# --disable-rquotad \
#% endif
# --enable-nfsv3 \
# --enable-secure-statd
make all CC=%{_host}-gcc CFLAGS="%{optflags}" LDFLAGS="-lrpcsecgss"
#%if "%{_host}" != "%{_build}"
# LDFLAGS="-L%{_prefix}/%{_host}/lib -lnsl -ldl -luuid -l"
#%endif
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
install -d -m0755 %{buildroot}/sbin
%makeinstall statduser=$USER
mv %{buildroot}%{_sbindir}/{start-statd,rpc.statd} %{buildroot}/sbin
install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/sysconfig/nfs
install -D -m 755 %{S:2} %{buildroot}%{_initrddir}/nfs
install -D -m 755 %{S:3} %{buildroot}%{_initrddir}/nfslock
install -D -m 755 %{S:4} %{buildroot}%{_initrddir}/rpcidmapd
install -D -m 755 %{S:5} %{buildroot}%{_initrddir}/rpcgssd
install -D -m 755 %{S:6} %{buildroot}%{_initrddir}/rpcsvcgssd
#install -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/idmapd.conf
install -d %{buildroot}/var/lib/nfs/rpc_pipefs
install -d %{buildroot}/var/lib/nfs/statd
install -d %{buildroot}/var/lib/nfs/v4recovery
touch %{buildroot}%{_sysconfdir}/exports
touch %{buildroot}/var/lib/nfs/rmtab
%pre
if [ $1 -ge 1 ]; then
/usr/sbin/groupadd -g %{rpcuser_gid} rpcuser 2>/dev/null
/usr/sbin/useradd -c "RPC Service User" \
-s /bin/false -u %{rpcuser_uid} -g rpcuser -d /var/lib/nfs rpcuser 2>/dev/null
/usr/sbin/groupadd nobody -g %{nobodygroupid} 2>/dev/null
/usr/sbin/useradd -c nobody -u %{nobodyuserid} -d /dev/null -g nobody \
-s /bin/false nobody 2>/dev/null
fi
exit 0
%post
if [ $1 -ge 1 ]; then
#/sbin/chkconfig --add nfs
/sbin/chkconfig --del nfslock
#/sbin/chkconfig --add rpcidmapd
#/sbin/chkconfig --add rpcgssd
#/sbin/chkconfig --add rpcsvcgssd
fi
exit 0
%postun
if [ $1 -ge 1 ]; then
for daemon in rpcidmapd rpcgssd nfs; do
service $daemon condrestart >/dev/null
done
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
for daemon in nfs rpcidmapd rpcgssd rpcsvcgssd nfslock; do
service $daemon stop 2>/dev/null
/sbin/chkconfig --del $daemon
done
/usr/sbin/userdel rpcuser 2>/dev/null
/usr/sbin/groupdel rpcuser 2>/dev/null
rm -rf /var/lib/nfs/statd/*
rm -rf /var/lib/nfs/v4recovery/*
fi
exit 0
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%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/umount.nfs4
%endif
/sbin/osd_login
/sbin/start-statd
/sbin/rpc.statd
%{_sbindir}/blkmapd
%{_sbindir}/exportfs
%{_sbindir}/mountstats
%{_sbindir}/nfsdcltrack
%{_sbindir}/nfsidmap
%{_sbindir}/nfsiostat
%if "%{stage1}" != "1"
#%{_sbindir}/gss_clnt_send_err
#%{_sbindir}/gss_destroy_creds
%{_sbindir}/rpc.gssd
%{_sbindir}/rpc.svcgssd
%endif
%{_sbindir}/nfsstat
#%{_sbindir}/nhfsgraph
#%{_sbindir}/nhfsnums
#%{_sbindir}/nhfsrun
#%{_sbindir}/nhfsstone
%{_sbindir}/rpcdebug
%{_sbindir}/rpc.idmapd
%{_sbindir}/rpc.mountd
%{_sbindir}/rpc.nfsd
#%if %{with_rquotad}
#%{_sbindir}/rpc.rquotad
#%endif
%{_sbindir}/showmount
%{_sbindir}/sm-notify
%{_initrddir}/nfs
%{_initrddir}/nfslock
%{_initrddir}/rpcidmapd
%{_initrddir}/rpcgssd
%{_initrddir}/rpcsvcgssd
%config(noreplace) %{_sysconfdir}/exports
#%config(noreplace) %{_sysconfdir}/idmapd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/nfs
%dir /var/lib/nfs
%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd
%dir /var/lib/nfs/v4recovery
%dir /var/lib/nfs/rpc_pipefs
%dir /var/lib/nfs/sm
%dir /var/lib/nfs/sm.bak
%config(noreplace) /var/lib/nfs/etab
%config(noreplace) /var/lib/nfs/rmtab
%config(noreplace) /var/lib/nfs/state
%config(noreplace) /var/lib/nfs/xtab
%{_mandir}/man5/exports.5*
#%exclude %{_mandir}/man5/idmapd.conf.5*
%{_mandir}/man5/nfs.5*
%{_mandir}/man7/nfsd.7*
%{_mandir}/man8/*
%doc COPYING linux-nfs/*
%changelog
* Tue Jun 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.9-4mamba
- initscript: move down 'exportfs -r' after rpc.nfsd to avoid returning error on boot
* Sat May 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.9-3mamba
- require nfsbind replacing portmap
- nfslock initscript: remove pid files on stop and make better checks on start
* Sat May 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.9-2mamba
- x86_64: unstaged build
- fix path check for rpc.statd in nfs initscript
* Wed Nov 27 2013 Automatic Build System <autodist@mambasoft.it> 1.2.9-1mamba
- automatic version update by autodist
* Thu May 16 2013 Automatic Build System <autodist@mambasoft.it> 1.2.8-1mamba
- automatic version update by autodist
* Wed Aug 22 2012 Automatic Build System <autodist@mambasoft.it> 1.2.6-1mamba
- automatic version update by autodist
* Fri Mar 16 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.5-4mamba
- precreate nobody group and user
* Thu Feb 16 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.5-3mamba
- rebuilt with libkeyutils
* Mon Feb 06 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.5-2mamba
- disable nfslock initscript, as rpc.statd is called by mount in clients now and by nfs init in server
- include directory /var/lib/nfs/sm to fix file locking support on client
* Sun Sep 25 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.5-1mamba
- update to 1.2.5
* Thu Dec 03 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-4mamba
- remove /etc/idmapd.conf to fix conflict with libnfsidmap
* Sat Aug 01 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-3mamba
- exclude idmapd.conf man entry moved to libnfsidmap
* Fri Jul 17 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.2.0-2mamba
- minor fix in the initscripts for nfsd and nfslock
* Thu Jun 11 2009 Automatic Build System <autodist@mambasoft.it> 1.2.0-1mamba
- automatic update by autodist
* Fri May 08 2009 Automatic Build System <autodist@mambasoft.it> 1.1.6-1mamba
- automatic update by autodist
* Wed Mar 11 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.5-1mamba
- automatic update by autodist
* Wed Oct 22 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.4-1mamba
- update to 1.1.4
- nfslock: activate service on install
* Fri Jun 06 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.1-1mamba
- update to 1.1.1
* Sat Jul 07 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.0-1mamba
- update to 1.1.0
- fixes rpcidmapd initscript (don't load module but mount rpc_pipefs)
* Tue May 08 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.12-1mamba
- update to 1.0.12
- changed uid and gid of rpcuser and nfsnobody to avoid overlap (see resources db)
* Tue Jan 23 2007 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.10-1qilnx
- update to version 1.0.10 by autospec
- /sbin/rpcdebug moved to /usr/sbin directory
- dropped patch for gcc4 compiler
- fixed permissions for /var/lib/nfs/statd
* Fri Dec 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.7-2qilnx
- rebuilt with new releases of libnfsidmap and libevent
- gcc4 patch applied
* Fri Apr 01 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.7-1qilnx
- update to version 1.0.7 by autospec
- also fix security issue QSA-2005-035 (CAN-2004-1014)
- added /etc/exports to be compliant with LSB requirements
* Wed Nov 19 2003 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.6-1qilnx
- first build