nfs-utils/nfs-utils.spec

465 lines
15 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: 2.4.1
Release: 2mamba
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-sysconfig
Source2: nfs-utils_env.sh
Source7: nfs-utils-idmapd.conf
Patch0: %{name}-1.2.5-arm-PAGE_SIZE.patch
Patch1: nfs-utils-1.3.3-rundir.patch
Patch2: nfs-utils-2.4.1-arm-int64.patch
Patch3: nfs-utils-2.4.1-arm-llx.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
BuildRequires: libkrb5-devel
BuildRequires: libmount-devel
%if "%{stage1}" != "1"
BuildRequires: libnfsidmap-devel
%endif
BuildRequires: libpcre-devel
BuildRequires: librpcsecgss-devel
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libsqlite-devel
BuildRequires: libtirpc-devel
BuildRequires: libuuid-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
Requires: libnfsidmap = %{?epoch:%epoch:}%{version}-%{release}
%systemd_requires
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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.
%package -n nfs-server
Group: System/Servers
Summary: NFS server and services
Requires(post):%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n nfs-server
This package contains libraries and header files for developing applications that use %{name}.
%package -n libnfsidmap
Group: System/Libraries
Summary: A NFS library holding mulitiple methods of mapping names to id's and visa versa
%description -n libnfsidmap
libnfsidmap is a library holding mulitiple methods of mapping names to id's and visa versa, mainly for NFSv4.
%package -n libnfsidmap-devel
Group: Development/Libraries
Summary: Development files for libnfsidmap
%description -n libnfsidmap-devel
libnfsidmap is a library holding mulitiple methods of mapping names to id's and visa versa, mainly for NFSv4.
This package contains the files needed for development with this library.
%prep
%setup -q
#% patch1 -p1
%ifarch arm
%patch2 -p1
%patch3 -p1
%endif
sed -i "s|/run/sysconfig|/run|" systemd/*
%build
# --disable-tirpc: we currently use portmap.
# Enabling tirpc causes nfs.mountd not to start when IPv6 is disabled
%configure \
--enable-tirpc \
%if "%{stage1}" == "1"
--disable-gss \
%else
--enable-gss \
--enable-ipv6 \
--with-statedir=/var/lib/nfs \
%endif
--with-pluginpath=%{_libdir}/libnfsidmap \
%if %{with_mount}
--enable-mount \
--enable-libmount-mount \
--enable-mountconfig \
%else
--disable-mount \
%endif
--without-tcp-wrappers \
--enable-shared \
--disable-static \
--with-systemd=%{_unitdir} \
--with-statduser=rpcuser \
--with-start-statd=%{_sbindir}/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" \
generator_dir=%{_systemdgeneratordir}
#%if "%{_host}" != "%{_build}"
# LDFLAGS="-L%{_prefix}/%{_host}/lib -lnsl -ldl -luuid -l"
#%endif
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%makeinstall statduser=$USER generator_dir=%{_systemdgeneratordir}
install -d %{buildroot}/var/lib/nfs/rpc_pipefs
install -d %{buildroot}/var/lib/nfs/statd
install -d %{buildroot}/var/lib/nfs/v4recovery
touch %{buildroot}/var/lib/nfs/rmtab
install -d %{buildroot}%{_sysconfdir}
touch %{buildroot}%{_sysconfdir}/exports
#install -d -m0755 %{buildroot}%{_unitdir}
#cp -a systemd/*.service %{buildroot}%{_unitdir}
#cp -a systemd/*.target %{buildroot}%{_unitdir}
#cp -a systemd/*.mount %{buildroot}%{_unitdir}
#rm -f %{buildroot}%{_unitdir}/nfs-idmapd.service
install -D -m0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/nfs
install -D -m0755 %{SOURCE2} %{buildroot}%{_prefix}/libexec/nfs-utils/nfs-utils_env.sh
install -D -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/idmapd.conf
%pre
if [ $1 -ge 1 ]; then
chkconfig nfs off 2>/dev/null || true
rm -f /etc/rc*.d/S55nfs
chkconfig nfslock off 2>/dev/null || true
/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
:
%preun
if [ $1 -eq 0 ]; then
/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
:
%post -n nfs-server
%systemd_post nfs-server
:
%preun -n nfs-server
%systemd_preun nfs-server
:
%postun -n nfs-server
%systemd_postun_with_restart nfs-server
:
%posttrans -n nfs-server
[ ! -e /etc/exportfs -a -e /etc/exportfs.rpmsave ] && \
mv /etc/exportfs.rpmsave /etc/exportfs
:
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sysconfig/nfs
%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/nfsdcltrack
/sbin/nfsdcld
%{_sbindir}/blkmapd
%{_sbindir}/mountstats
%{_sbindir}/nfsconf
%{_sbindir}/nfsidmap
%{_sbindir}/nfsiostat
%{_sbindir}/nfsstat
%{_sbindir}/rpcdebug
%{_sbindir}/rpc.idmapd
%if "%{stage1}" != "1"
%{_sbindir}/rpc.gssd
#%{_sbindir}/rpc.svcgssd
%endif
#%if %{with_rquotad}
#%{_sbindir}/rpc.rquotad
#%endif
%{_sbindir}/rpc.statd
%{_sbindir}/showmount
%{_sbindir}/sm-notify
%{_sbindir}/start-statd
%{_unitdir}/nfs-client.target
#%{_unitdir}/nfs-config.service
%{_unitdir}/rpc-statd.service
%{_unitdir}/nfs-utils.service
%{_unitdir}/nfs-blkmap.service
%{_unitdir}/nfs-idmapd.service
%{_unitdir}/nfs-mountd.service
%{_unitdir}/rpc-gssd.service
%{_unitdir}/rpc-statd-notify.service
%{_prefix}/libexec/nfs-utils/nfs-utils_env.sh
%dir %attr(-,rpcuser,rpcuser) /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/nfs.5*
%{_mandir}/man5/nfsmount.conf.5*
%{_mandir}/man8/blkmapd.8*
%{_mandir}/man8/gssd.8*
%{_mandir}/man8/idmapd.8*
%{_mandir}/man8/mount.nfs.8*
%{_mandir}/man8/mountstats.8*
%{_mandir}/man8/nfsdcltrack.8*
%{_mandir}/man8/nfsdcld.8*
%{_mandir}/man8/nfsidmap.8*
%{_mandir}/man8/nfsiostat.8*
%{_mandir}/man8/nfsstat.8*
%{_mandir}/man8/rpc.gssd.8*
%{_mandir}/man8/rpc.idmapd.8*
%{_mandir}/man8/rpc.sm-notify.8*
%{_mandir}/man8/rpc.statd.8*
%{_mandir}/man8/rpcdebug.8*
%{_mandir}/man8/showmount.8*
%{_mandir}/man8/sm-notify.8*
%{_mandir}/man8/statd.8*
#%{_mandir}/man8/svcgssd.8*
%{_mandir}/man8/umount.nfs.8*
%doc COPYING
#linux-nfs/*
%files -n nfs-server
%defattr(-,root,root)
%config %{_sysconfdir}/idmapd.conf
%config(noreplace) %{_sysconfdir}/exports
%{_sbindir}/exportfs
%{_sbindir}/rpc.mountd
%{_sbindir}/rpc.nfsd
%{_unitdir}/auth-rpcgss-module.service
%{_unitdir}/nfs-server.service
%{_unitdir}/proc-fs-nfsd.mount
%{_unitdir}/rpc_pipefs.target
%{_unitdir}/var-lib-nfs-rpc_pipefs.mount
%{_systemdgeneratordir}/nfs-server-generator
%{_systemdgeneratordir}/rpc-pipefs-generator
%{_mandir}/man3/nfs4_uid_to_name.3*
%{_mandir}/man5/exports.5*
%{_mandir}/man5/idmapd.conf.5*
%{_mandir}/man5/nfs.conf.5*
%{_mandir}/man7/nfsd.7*
%{_mandir}/man7/nfs.systemd.7*
%{_mandir}/man8/exportfs.8*
%{_mandir}/man8/mountd.8*
%{_mandir}/man8/nfsd.8*
%{_mandir}/man8/rpc.mountd.8*
%{_mandir}/man8/rpc.nfsd.8*
%{_mandir}/man8/nfsconf.8*
%files -n libnfsidmap
%defattr(-,root,root)
%{_libdir}/libnfsidmap.so.*
%dir %{_libdir}/libnfsidmap
%{_libdir}/libnfsidmap/nsswitch.la
%{_libdir}/libnfsidmap/nsswitch.so
%{_libdir}/libnfsidmap/static.la
%{_libdir}/libnfsidmap/static.so
%{_libdir}/libnfsidmap/umich_ldap.la
%{_libdir}/libnfsidmap/umich_ldap.so
%files -n libnfsidmap-devel
%defattr(-,root,root)
%{_includedir}/nfsidmap.h
%{_includedir}/nfsidmap_plugin.h
%{_libdir}/libnfsidmap.la
%{_libdir}/libnfsidmap.so
%{_libdir}/pkgconfig/libnfsidmap.pc
%changelog
* Sun Jul 28 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-2mamba
- x86_64: fixed plugin path by passing --with-pluginpath
* Wed Jul 24 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-1mamba
- update to 2.4.1
* Sun May 26 2019 Automatic Build System <autodist@mambasoft.it> 2.3.4-1mamba
- automatic version update by autodist
* Tue Apr 23 2019 Automatic Build System <autodist@mambasoft.it> 2.3.3-1mamba
- automatic version update by autodist
* Sun Oct 30 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.4-2mamba
- correctly provide nfs-utils_env.sh
* Tue Oct 04 2016 Automatic Build System <autodist@mambasoft.it> 1.3.4-1mamba
- automatic version update by autodist
* Sat Jul 23 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.3-5mamba
- trying to re-enable nfsv4 and added more options to configure
* Tue Dec 01 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.3-4mamba
- remove nfs-idmapd.service since disabling nfs4
* Fri Nov 06 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.3-3mamba
- move nfs-config.service to client package
- patch for /run instead of /var/run
- fix configured path for start-statd
* Fri Oct 30 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.3-2mamba
- disable nfsv4 and move rpc-statd and other services from server to client package
* Wed Oct 28 2015 Automatic Build System <autodist@mambasoft.it> 1.3.3-1mamba
- automatic version update by autodist
* Tue Feb 17 2015 Automatic Build System <autodist@mambasoft.it> 1.3.2-1mamba
- automatic version update by autodist
* Wed Oct 01 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.1-2mamba
- provide nfs-utils_env.sh script and /etc/sysconfig/nfs
* Tue Sep 30 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.1-1mamba
- update to 1.3.1
- systemd support and added nfs-server package
* Fri Jun 27 2014 Automatic Build System <autodist@mambasoft.it> 1.3.0-1mamba
- automatic version update by autodist
* 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