SPECS/nfs-utils/nfs-utils.spec
f0124dee
 Summary:        NFS client utils
 Name:           nfs-utils
8c2e04a5
 Version:        2.3.3
 Release:        1%{?dist}
f0124dee
 License:        GPLv2+
 URL:            http://sourceforge.net/projects/nfs
 Group:          Applications/Nfs-utils-client
ed8e247b
 Source0:        http://downloads.sourceforge.net/nfs/%{name}-%{version}.tar.xz
8c2e04a5
 %define sha1    nfs-utils=a60aa17b057734c63bf7ce1598898e83f2132644
f0124dee
 Source1:        nfs-client.service
 Source2:        nfs-client.target
 Source3:        rpc-statd.service
 Source4:        rpc-statd-notify.service
 Source5:        nfs-utils.defaults
2fc32649
 Source6:        nfs-server.service
 Source7:        nfs-mountd.service
f0124dee
 Vendor:         VMware, Inc.
c459600f
 Distribution:   Photon
ed8e247b
 BuildRequires:  libtool
 BuildRequires:  krb5-devel
 BuildRequires:  libcap-devel
48cc9384
 BuildRequires:  libtirpc-devel
f0124dee
 BuildRequires:  python3-devel
ed8e247b
 BuildRequires:  libevent-devel
 BuildRequires:  device-mapper-devel
 BuildRequires:  systemd-devel
 BuildRequires:  keyutils-devel
 BuildRequires:  sqlite-devel
 BuildRequires:  libgssglue-devel
 BuildRequires:  librpcsecgss-devel
 BuildRequires:  libnfsidmap-devel
 BuildRequires:  e2fsprogs-devel
f0124dee
 Requires:       libtirpc
 Requires:       rpcbind
75cb675a
 Requires:       shadow
f0124dee
 Requires:       python3-libs
ed8e247b
 Requires(pre):  /usr/sbin/useradd /usr/sbin/groupadd
 Requires(postun):/usr/sbin/userdel /usr/sbin/groupdel
9c1f2d3d
 
 %description
 The nfs-utils package contains simple nfs client service
 
 %prep
 %setup -q -n %{name}-%{version}
 #not prevent statd to start
 sed -i "/daemon_init/s:\!::" utils/statd/statd.c
92f724ea
 sed '/unistd.h/a#include <stdint.h>' -i support/nsm/rpc.c
f0124dee
 find . -iname "*.py" | xargs -I file sed -i '1s/python/python3/g' file
d34c574b
 
9c1f2d3d
 %build
ed8e247b
 ./configure --prefix=%{_prefix}         \
             --sysconfdir=%{_sysconfdir} \
             --enable-libmount-mount     \
             --without-tcp-wrappers      \
             --enable-gss                \
             --enable-nfsv4              \
d34c574b
             --disable-static
 
9c1f2d3d
 make
 %install
 make DESTDIR=%{buildroot} install
48cc9384
 install -v -m644 utils/mount/nfsmount.conf /etc/nfsmount.conf
 
 mkdir -p %{buildroot}/lib/systemd/system/
 mkdir -p %{buildroot}/etc/default
2c4475ce
 mkdir -p %{buildroot}/etc/export.d
 mkdir -p %{buildroot}/var/lib/nfs/v4recovery
 touch %{buildroot}/etc/exports
 
48cc9384
 install -m644 %{SOURCE1} %{buildroot}/lib/systemd/system/
 install -m644 %{SOURCE2} %{buildroot}/lib/systemd/system/
 install -m644 %{SOURCE3} %{buildroot}/lib/systemd/system/
 install -m644 %{SOURCE4} %{buildroot}/lib/systemd/system/
 install -m644 %{SOURCE5} %{buildroot}/etc/default/nfs-utils
2fc32649
 install -m644 %{SOURCE6} %{buildroot}/lib/systemd/system/
 install -m644 %{SOURCE7} %{buildroot}/lib/systemd/system/
ed8e247b
 install -m644 systemd/proc-fs-nfsd.mount %{buildroot}/lib/systemd/system/
 install -m644 systemd/nfs-idmapd.service %{buildroot}/lib/systemd/system/
 install -m644 systemd/rpc_pipefs.target  %{buildroot}/lib/systemd/system/
 install -m644 systemd/var-lib-nfs-rpc_pipefs.mount  %{buildroot}/lib/systemd/system/
 install -m644 systemd/rpc-svcgssd.service %{buildroot}/lib/systemd/system/
 find %{buildroot}/%{_libdir} -name '*.la' -delete
 
 install -vdm755 %{buildroot}/usr/lib/systemd/system-preset
 echo "disable nfs-server.service" > %{buildroot}/usr/lib/systemd/system-preset/50-nfs-server.preset
48cc9384
 
93f50e49
 %check
 #ignore test that might require additional setup
 sed -i '/check_root/i \
 exit 77' tests/t0001-statd-basic-mon-unmon.sh
 make check
 
ed8e247b
 %pre
 if ! getent group nobody >/dev/null; then
     groupadd -r nobody
 fi
 if ! getent passwd nobody >/dev/null; then
     useradd -g named -s /bin/false -M -r nobody
 fi
 
 %post
 /sbin/ldconfig
 %systemd_post nfs-server.service
 
 %preun
 %systemd_preun nfs-server.service
 
 %postun
 /sbin/ldconfig
 %systemd_postun_with_restart nfs-server.service
 
9c1f2d3d
 %files
 %defattr(-,root,root)
 %{_datadir}/*
 /sbin/*
 %{_sbindir}/*
 %{_sharedstatedir}/*
04762b72
 %config(noreplace) /etc/default/nfs-utils
 %config(noreplace) /etc/exports
48cc9384
 /lib/systemd/system/*
ed8e247b
 %{_libdir}/libnfsidmap.so.*
 %{_libdir}/libnfsidmap/nsswitch.so
 %{_libdir}/libnfsidmap/static.so
 %{_libdir}/systemd/system-preset/50-nfs-server.preset
48cc9384
 
ed8e247b
 %{_includedir}/*
 %{_libdir}/libnfsidmap.so
 %{_libdir}/pkgconfig/libnfsidmap.pc
9c1f2d3d
 %changelog
8c2e04a5
 *   Mon Sep 10 2018 Him Kalyan Bordoloi <bordoloih@vmware.com> 2.3.3-1
 -   Update to 2.3.3
04762b72
 *   Thu Jun 07 2018 Anish Swaminathan <anishs@vmware.com> 2.3.1-2
 -   Add noreplace qualifier to config files
ed8e247b
 *   Fri Jan 26 2018 Xiaolin Li <xiaolinl@vmware.com> 2.3.1-1
 -   Update to 2.3.1 and enable nfsv4
75cb675a
 *   Tue Oct 10 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-7
 -   No direct toybox dependency, shadow depends on toybox
7f9d2e12
 *   Mon Sep 18 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-6
 -   Requires shadow or toybox
92f724ea
 *   Thu Aug 24 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-5
 -   Fix compilation issue for glibc-2.26
93f50e49
 *   Wed Aug 16 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.1-4
 -   Add check and ignore test that fails.
2fc32649
 *   Tue Aug 8 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.1-3
 -   Alter nfs-server and nfs-mountd service files to use
 -   environment file and port opts.
f0124dee
 *   Tue May 23 2017 Xiaolin Li <xiaolinl@vmware.com> 2.1.1-2
 -   Build with python3.
d34c574b
 *   Sat Apr 15 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.1-1
 -   Update to 2.1.1
c459600f
 *   Fri Dec 16 2016 Nick Shi <nshi@vmware.com> 1.3.3-6
 -   Requires rpcbind.socket upon starting rpc-statd service (bug 1668405)
 *   Mon Nov 21 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.3.3-5
 -   add shadow to requires
 *   Wed Jul 27 2016 Divya Thaluru <dthaluru@vmware.com> 1.3.3-4
 -   Removed packaging of debug files
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.3.3-3
 -   GA - Bump release of all rpms
2c4475ce
 *   Thu Apr 28 2016 Xiaolin Li <xiaolinl@vmware.com> 1.3.3-2
 -   Add nfs-server.service to rpm.
c459600f
 *   Thu Jan 21 2016 Xiaolin Li <xiaolinl@vmware.com> 1.3.3-1
 -   Updated to version 1.3.3
 *   Tue Dec 8 2015 Divya Thaluru <dthaluru@vmware.com> 1.3.2-2
 -   Adding systemd service files
 *   Tue Jul 14 2015 Rongrong Qiu <rqiu@vmware.com> 1.3.2-1
 -   Initial build.  First version