Blob Blame History Raw

# %%global prereltag rcfinal
%global            ntirpcname ntirpc
%global            ntirpcvers 1.1.0

%global            _hardened_build 1

%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
%global            _with_systemd true
%endif

# GlusterFS is not available in EPEL
# RHEL finally has 3.6.x, but lacks glusterfs-api-devel
%if ( ! 0%{?rhel} )
%global            with_glusterfs true
%endif

%global            with_cephfs true

%global            with_admintools true

# From https://fedoraproject.org/wiki/Packaging:Python#Macros
%if ( 0%{?rhel} && 0%{?rhel} <= 5 )
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

Name:              nfs-ganesha
Version:           2.1.0
Release:           14%{?prereltag:.%{prereltag}}%{?dist}
Summary:           Ganesha NFS Server
Group:             System Environment/Libraries
License:           LGPLv3+
URL:               https://github.com/nfs-ganesha/nfs-ganesha/wiki
ExclusiveArch:     x86_64
ExclusiveArch:     aarch64

Source0:           https://github.com/%{name}/%{name}/archive/V%{version}/%{name}-%{version}.tar.gz
Source1:           https://github.com/%{name}/%{ntirpcname}/archive/v%{ntirpcvers}/%{ntirpcname}-%{ntirpcvers}.tar.gz
Source2:           nfs-ganesha.service
Patch3:            nfs-ganesha-2.0.0-no-strict-aliasing.patch
Patch6:            nfs-ganesha-2.1.0-config_parsing.patch
Patch7:            nfs-ganesha-2.1.0-cache_inode_getattr.patch
Patch8:            nfs-ganesha-2.1.0-nfs4_pseudo.patch
Patch9:            nfs-ganesha-2.1.0-config-h.in.cmake.patch
Patch10:           nfs-ganesha-2.1.0-commonlib.patch
Patch11:           nfs-ganesha-2.1.0-nfs4_op_secinfo.patch
Patch12:           nfs-ganesha-2.1.0-support-CMakeLists.txt.patch
Patch13:           nfs-ganesha-2.1.0-cache_inode.patch
Patch14:           nfs-ganesha-2.1.0-state_lock.patch

%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}

# Bundling exception through Fedora 23
# https://fedorahosted.org/fpc/ticket/363
Provides:          bundled(libntirpc)

%if ( 0%{?_with_systemd:1} )
BuildRequires:     systemd
%endif
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
BuildRequires:     cmake28
%else
BuildRequires:     cmake >= 2.6.3
%endif
BuildRequires:     bison
BuildRequires:     flex
BuildRequires:     pkgconfig
BuildRequires:     doxygen
BuildRequires:     krb5-devel
BuildRequires:     dbus-devel
BuildRequires:     jemalloc-devel
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
BuildRequires:     xfsprogs-devel
BuildRequires:     libnfsidmap-devel
BuildRequires:     libwbclient-devel
%endif
BuildRequires:     libcap-devel
%if ( 0%{?with_admintools:1} )
BuildRequires:     PyQt4-devel
%endif

%if ( 0%{?_with_systemd:1} )
Requires(post):    systemd
Requires(preun):   systemd
Requires(postun):  systemd
%else
Requires(post):   /sbin/chkconfig
Requires(preun):  /sbin/service
Requires(preun):  /sbin/chkconfig
Requires(postun): /sbin/service
%endif
Requires:          dbus
Requires:          jemalloc
%if ( 0%{?with_admintools:1} )
Requires:          PyQt4
%endif

%description
NFS-Ganesha is a user mode file server with support for both the
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
an internal meta data cache and state manager for performance. It
also provides support for pNFS for multiple clustered file systems
both open source and proprietary. Multiple file systems are supported
via loadable back-end drivers. The VFS back-end supports file systems
via the kernel. Other back-ends can support user mode library based
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
which operates as an NFSv4 client.

%if ( 0%{?with_glusterfs:1} )
%package fsal-gluster
Summary:           Ganesha NFS Server GlusterFS FSAL
Requires:          glusterfs-api >= 3.5.1
BuildRequires:     glusterfs-api-devel >= 3.5.1

%description fsal-gluster
GlusterFS FSAL for nfs-ganesha

NFS-Ganesha is a user mode file server with support for both the
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
an internal meta data cache and state manager for performance. It
also provides support for pNFS for multiple clustered file systems
both open source and proprietary. Multiple file systems are supported
via loadable back-end drivers. The VFS back-end supports file systems
via the kernel. Other back-ends can support user mode library based
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
which operates as an NFSv4 client.
%endif

%if ( 0%{?with_cephfs:1} )
%package fsal-ceph
Summary:           Ganesha NFS Server Ceph FSAL
Requires:          ceph >= 0.78
BuildRequires:     ceph-devel >= 0.78

%description fsal-ceph
Ceph FSAL for nfs-ganesha

NFS-Ganesha is a user mode file server with support for both the
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
an internal meta data cache and state manager for performance. It
also provides support for pNFS for multiple clustered file systems
both open source and proprietary. Multiple file systems are supported
via loadable back-end drivers. The VFS back-end supports file systems
via the kernel. Other back-ends can support user mode library based
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
which operates as an NFSv4 client.
%endif

%package docs
Summary:           Ganesha NFS Server Documentation
BuildArch:         noarch

%description docs
Documentation for nfs-ganesha

NFS-Ganesha is a user mode file server with support for both the 
NFS suite and 9P, the Plan 9 remote file access protocol. It uses 
an internal meta data cache and state manager for performance. It 
also provides support for pNFS for multiple clustered file systems 
both open source and proprietary. Multiple file systems are supported 
via loadable back-end drivers. The VFS back-end supports file systems 
via the kernel. Other back-ends can support user mode library based 
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end 
which operates as an NFSv4 client.

%prep
%setup -q -n %{name}-%{version} -a 1
rm -rf contrib/libzfswrapper
mv %{ntirpcname}-%{ntirpcvers}/* src/libntirpc/
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
%patch3 -p1
%endif
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1

%build
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
%global cmake %cmake28
%endif
%if ( 0%{?with_admintools:1} )
%global config_admin -DUSE_ADMIN_TOOLS=ON
%endif
%cmake -DCMAKE_BUILD_TYPE=Maintainer -DBUILD_CONFIG=everything -DCMAKE_INSTALL_PREFIX=%{buildroot}/usr %{config_admin} ./src
# _smp_mflags elided due to random build errors (cmake related?)
make VERBOSE=1

%install
make install
rm  %{buildroot}%{_bindir}/libntirpc.*
mkdir -p %{buildroot}%{_pkgdocdir}
cp -p src/Docs/*.pdf %{buildroot}%{_pkgdocdir}/
%if ( 0%{?_with_systemd:1} )
install -D -p -m 0644 src/scripts/systemd/nfs-ganesha.service %{buildroot}%{_unitdir}/nfs-ganesha.service
%else
install -D -p -m 0744 src/ganesha.init %{buildroot}%{_sysconfdir}/init.d/nfs-ganesha
%endif
install -D -p -m 0644 src/scripts/systemd/sysconfig/nfs-ganesha %{buildroot}%{_sysconfdir}/sysconfig/nfs-ganesha
install -D -p -m 0644 src/scripts/ganeshactl/org.ganesha.nfsd.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.ganesha.nfsd.conf

%post
/sbin/ldconfig
%if ( 0%{?_with_systemd:1} )
%systemd_post nfs-ganesha.service
%else
/sbin/chkconfig --add nfs-ganesha
%endif

%preun
%if ( 0%{?_with_systemd:1} )
%systemd_preun nfs-ganesha.service
%else
/sbin/service nfs-ganesha stop &>/dev/null
/sbin/chkconfig --del nfs-ganesha
/sbin/service nfs-ganesha condrestart &>/dev/null
%endif

%postun
/sbin/ldconfig
%if ( 0%{?_with_systemd:1} )
%systemd_postun_with_restart nfs-ganesha.service
%endif

%files
%doc src/ChangeLog src/LICENSE.txt src/Docs/*.pdf
%exclude %{_pkgdocdir}/*.pdf
%if ( 0%{?with_glusterfs:1} )
%exclude %{_libdir}/ganesha/libfsalgluster.*
%endif
%if ( 0%{?with_cephfs:1} )
%exclude %{_libdir}/ganesha/libfsalceph.*
%endif
%{_libdir}/*
%{_bindir}/*
%if ( 0%{?_with_systemd:1} )
%{_unitdir}/*
%else
%{_sysconfdir}/init.d/*
%endif
%{_sysconfdir}/sysconfig/*
%{_sysconfdir}/dbus-1/system.d/*
%if ( 0%{?with_admintools:1} )
%{python_sitelib}/*
%endif

%if ( 0%{?with_glusterfs:1} )
%files fsal-gluster
%{_libdir}/ganesha/libfsalgluster.*
%endif

%if ( 0%{?with_cephfs:1} )
%files fsal-ceph
%{_libdir}/ganesha/libfsalceph.*
%endif

%files docs
%{_pkgdocdir}/LICENSE.txt
%{_pkgdocdir}/*
%dir %{_pkgdocdir}

%changelog
* Thu Feb 12 2015 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-14
- Fedora 23/rawhide build fixes
- Ceph restored in EPEL

* Mon Jan 19 2015 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-13
- Ceph retired from EPEL 7

* Thu Nov 6 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-12
- rebuild after libnfsidmap symbol version revert

* Wed Oct 29 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-11
- PyQt -> PyQt4 typo

* Mon Oct 27 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-10
- use upstream init.d script

* Thu Oct 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-9
- restore exclusion of gluster gfapi on rhel

* Thu Oct 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-8
- install /etc/dbus-1/system.d/org.ganesha.nfsd.conf
- build and install admin tools

* Mon Sep 29 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-7
- install /etc/sysconfig/nfs-ganesha file

* Fri Aug 29 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- Ceph FSAL typo, #1135437

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Jul 24 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-5
- use upstream nfs-ganesha.service

* Fri Jul 11 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-4
- keep fsal .so files, implementation now uses them

* Tue Jul 1 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-3
- static libuid2grp

* Tue Jul 1 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-2
- add libuid2grp.so

* Mon Jun 30 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.1.0-1
- nfs-ganesha-2.1.0 GA

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Jun 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-9
- Ceph FSAL enabled with ceph-0.80

* Wed May 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-8
- getdents()->getdents64(), struct dirent -> struct dirent64

* Sat May 10 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- and exclude libfsalceph

* Sat May 10 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- exclude libfsalgluster correctly

* Fri May 9 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-7
- Ceph FSAL, in a subpackage, (but requires ceph >= 0.78)

* Mon Mar 31 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- GlusterFS FSAL in a subpackage
- EPEL7 has jemalloc as of 2014-02-25

* Tue Jan 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- sussed out github archive so as to allow correct Source0

* Fri Jan 17 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-6
- EPEL7 and xfsprogs

* Fri Jan 17 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-5
- EPEL7

* Mon Jan 6 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-4
- with glusterfs-api(-devel) >= 3.4.2

* Sat Jan 4 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-3
- with glusterfs-api

* Thu Jan 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-2
- Build on RHEL6. Add sample init.d script

* Wed Dec 11 2013 Jim Lieb <lieb@sea-troll.net> - 2.0.0-1
- Update to V2.0.0 release

* Mon Nov 25 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.2.rcfinal
- update to RC-final

* Fri Nov 22 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.1.rc5
- Initial commit