ff653f3
861e1ad
# %%global prereltag rcfinal
d762928
%global            ntirpcname ntirpc
d762928
%global            ntirpcvers 1.0.0
ff653f3
d762928
%global            _hardened_build 1
f9d3726
6fbb59c
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
d762928
%global            _with_systemd true
6fbb59c
%endif
6fbb59c
6c1f1e7
# GlusterFS is not available in EPEL
ad7af46
# RHEL currently 3.4.0 client, but nfs-ganesha needs 3.4.2.
6c1f1e7
%if ( ! 0%{?rhel} )
d762928
%global            with_glusterfs true
6c1f1e7
%endif
6c1f1e7
d762928
%global            with_cephfs true
d762928
ff653f3
Name:              nfs-ganesha
d06d882
Version:           2.0.0
d762928
Release:           9%{?prereltag:.%{prereltag}}%{?dist}
ff653f3
Summary:           Ganesha NFS Server
ff653f3
Group:             System Environment/Libraries
ff653f3
License:           LGPLv3+
ff653f3
URL:               https://github.com/nfs-ganesha/nfs-ganesha/wiki
ff653f3
ExclusiveArch:     x86_64
ff653f3
ExclusiveArch:     aarch64
ff653f3
d06d882
Source0:           https://github.com/%{name}/%{name}/archive/V%{version}/%{name}-%{version}.tar.gz
d06d882
Source1:           https://github.com/%{name}/%{ntirpcname}/archive/v%{ntirpcvers}/%{ntirpcname}-%{ntirpcvers}.tar.gz
ff653f3
Source2:           nfs-ganesha.service
6fbb59c
Source3:           nfs-ganesha.init
6fbb59c
Source4:           nfs_ganesha.sh
ff653f3
Patch1:            nfs-ganesha-2.0.0rc5.patch
Jim Lieb 2dc956f
Patch2:            nfs-ganesha-2.0.0-lustre-strict.patch
6fbb59c
Patch3:            nfs-ganesha-2.0.0-no-strict-aliasing.patch
fe5a967
Patch4:            nfs-ganesha-2.0.0-dirent.patch
d762928
Patch5:            nfs-ganesha-2.0.0-fsal_ceph.patch
ff653f3
d06d882
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
d06d882
ff653f3
# Bundling exception through Fedora 23
ff653f3
# https://fedorahosted.org/fpc/ticket/363
ff653f3
Provides:          bundled(libntirpc)
ff653f3
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
BuildRequires:     systemd
6fbb59c
%endif
6fbb59c
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
6fbb59c
BuildRequires:     cmake28
6fbb59c
%else
ff653f3
BuildRequires:     cmake >= 2.6.3
6fbb59c
%endif
ff653f3
BuildRequires:     bison
ff653f3
BuildRequires:     flex
ff653f3
BuildRequires:     pkgconfig
ff653f3
BuildRequires:     doxygen
ff653f3
BuildRequires:     krb5-devel
ff653f3
BuildRequires:     dbus-devel
ff653f3
BuildRequires:     jemalloc-devel
f063405
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
6fbb59c
BuildRequires:     xfsprogs-devel
ff653f3
BuildRequires:     libnfsidmap-devel
ff653f3
BuildRequires:     libwbclient-devel
6fbb59c
%endif
ff653f3
BuildRequires:     libcap-devel
ff653f3
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
Requires(post):    systemd
ff653f3
Requires(preun):   systemd
ff653f3
Requires(postun):  systemd
6fbb59c
%else
6fbb59c
Requires(post):   /sbin/chkconfig
6fbb59c
Requires(preun):  /sbin/service
6fbb59c
Requires(preun):  /sbin/chkconfig
6fbb59c
Requires(postun): /sbin/service
6fbb59c
%endif
ff653f3
Requires:          dbus
ff653f3
Requires:          jemalloc
ad7af46
ad7af46
%description
ad7af46
NFS-Ganesha is a user mode file server with support for both the
ad7af46
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
ad7af46
an internal meta data cache and state manager for performance. It
ad7af46
also provides support for pNFS for multiple clustered file systems
ad7af46
both open source and proprietary. Multiple file systems are supported
ad7af46
via loadable back-end drivers. The VFS back-end supports file systems
ad7af46
via the kernel. Other back-ends can support user mode library based
ad7af46
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
ad7af46
which operates as an NFSv4 client.
ad7af46
6c1f1e7
%if ( 0%{?with_glusterfs:1} )
ad7af46
%package fsal-gluster
ad7af46
Summary:           Ganesha NFS Server GlusterFS FSAL
f674675
Requires:          glusterfs-api >= 3.4.2
ad7af46
BuildRequires:     glusterfs-api-devel >= 3.4.2
ad7af46
ad7af46
%description fsal-gluster
ad7af46
GlusterFS FSAL for nfs-ganesha
ff653f3
ff653f3
NFS-Ganesha is a user mode file server with support for both the
ff653f3
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
ff653f3
an internal meta data cache and state manager for performance. It
ff653f3
also provides support for pNFS for multiple clustered file systems
ff653f3
both open source and proprietary. Multiple file systems are supported
ff653f3
via loadable back-end drivers. The VFS back-end supports file systems
ff653f3
via the kernel. Other back-ends can support user mode library based
ff653f3
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
ff653f3
which operates as an NFSv4 client.
ad7af46
%endif
ff653f3
d762928
%if ( 0%{?with_cephfs:1} )
830a96e
%package fsal-ceph
830a96e
Summary:           Ganesha NFS Server GlusterFS FSAL
830a96e
Requires:          ceph >= 0.78
830a96e
BuildRequires:     ceph-devel >= 0.78
830a96e
830a96e
%description fsal-ceph
830a96e
Ceph FSAL for nfs-ganesha
830a96e
830a96e
NFS-Ganesha is a user mode file server with support for both the
830a96e
NFS suite and 9P, the Plan 9 remote file access protocol. It uses
830a96e
an internal meta data cache and state manager for performance. It
830a96e
also provides support for pNFS for multiple clustered file systems
830a96e
both open source and proprietary. Multiple file systems are supported
830a96e
via loadable back-end drivers. The VFS back-end supports file systems
830a96e
via the kernel. Other back-ends can support user mode library based
830a96e
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end
830a96e
which operates as an NFSv4 client.
830a96e
%endif
830a96e
ff653f3
%package docs
ff653f3
Summary:           Ganesha NFS Server Documentation
ff653f3
BuildArch:         noarch
ff653f3
ff653f3
%description docs
ff653f3
Documentation for nfs-ganesha
ff653f3
ff653f3
NFS-Ganesha is a user mode file server with support for both the 
ff653f3
NFS suite and 9P, the Plan 9 remote file access protocol. It uses 
ff653f3
an internal meta data cache and state manager for performance. It 
ff653f3
also provides support for pNFS for multiple clustered file systems 
ff653f3
both open source and proprietary. Multiple file systems are supported 
ff653f3
via loadable back-end drivers. The VFS back-end supports file systems 
ff653f3
via the kernel. Other back-ends can support user mode library based 
ff653f3
clusters such as CEPH and GLUSTERFS. There is also a PROXY back-end 
ff653f3
which operates as an NFSv4 client.
ff653f3
ff653f3
%prep
Jim Lieb 2dc956f
%setup -q -n %{name}-%{version} -a 1
ff653f3
rm -rf contrib/libzfswrapper
ff653f3
mv %{ntirpcname}-%{ntirpcvers}/* src/libntirpc/
ff653f3
%patch1 -p1
Jim Lieb 2dc956f
%patch2 -p1
6fbb59c
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
6fbb59c
%patch3 -p1
6fbb59c
%endif
fe5a967
%patch4 -p1
d762928
%patch5 -p1
ff653f3
ff653f3
%build
6fbb59c
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
6fbb59c
%global cmake %cmake28
6fbb59c
%endif
ff653f3
%cmake -DCMAKE_BUILD_TYPE=Maintainer -DBUILD_CONFIG=everything -DCMAKE_INSTALL_PREFIX=%{buildroot}/usr ./src
ff653f3
# _smp_mflags elided due to random build errors (cmake related?)
ff653f3
make VERBOSE=1
ff653f3
ff653f3
%install
ff653f3
make install
ff653f3
rm  %{buildroot}%{_bindir}/libntirpc.*
ff653f3
chmod ugo+x  %{buildroot}%{_bindir}/ganestat.pl
ff653f3
rm %{buildroot}%{_libdir}/ganesha/*.so
6fbb59c
mkdir -p %{buildroot}%{_pkgdocdir}
6fbb59c
cp -p src/Docs/*.pdf %{buildroot}%{_pkgdocdir}/
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/nfs-ganesha.service
6fbb59c
%else
6fbb59c
install -D -p -m 0744 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/nfs-ganesha
6fbb59c
install -D -p -m 0744 %{SOURCE4} %{buildroot}%{_sbindir}/nfs_ganesha.sh
6fbb59c
%endif
ff653f3
ff653f3
%post
ff653f3
/sbin/ldconfig
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
%systemd_post nfs-ganesha.service
6fbb59c
%else
6fbb59c
/sbin/chkconfig --add nfs-ganesha
6fbb59c
%endif
ff653f3
ff653f3
%preun
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
%systemd_preun nfs-ganesha.service
6fbb59c
%else
6fbb59c
/sbin/service nfs-ganesha stop &>/dev/null
6fbb59c
/sbin/chkconfig --del nfs-ganesha
6fbb59c
/sbin/service nfs-ganesha condrestart &>/dev/null
6fbb59c
%endif
ff653f3
ff653f3
%postun
ff653f3
/sbin/ldconfig
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
%systemd_postun_with_restart nfs-ganesha.service
6fbb59c
%endif
ff653f3
ff653f3
%files
6fbb59c
%doc src/ChangeLog src/LICENSE.txt src/TODO src/Docs/*.pdf
6fbb59c
%exclude %{_pkgdocdir}/*.pdf
1519577
%if ( 0%{?with_glusterfs:1} )
1519577
%exclude %{_libdir}/ganesha/libfsalgluster.*
1519577
%endif
d762928
%if ( 0%{?with_cephfs:1} )
3fdc8c0
%exclude %{_libdir}/ganesha/libfsalceph.*
3fdc8c0
%endif
ff653f3
%{_libdir}/*
ff653f3
%{_bindir}/*
6fbb59c
%if ( 0%{?_with_systemd:1} )
ff653f3
%{_unitdir}/*
6fbb59c
%else
6fbb59c
%{_sysconfdir}/init.d/*
6fbb59c
%{_sbindir}/*
6fbb59c
%endif
ff653f3
ad7af46
%if ( 0%{?with_glusterfs:1} )
ad7af46
%files fsal-gluster
ad7af46
%{_libdir}/ganesha/libfsalgluster.*
ad7af46
%endif
ad7af46
d762928
%if ( 0%{?with_cephfs:1} )
830a96e
%files fsal-ceph
830a96e
%{_libdir}/ganesha/libfsalceph.*
830a96e
%endif
830a96e
ff653f3
%files docs
6fbb59c
%{_pkgdocdir}/LICENSE.txt
6fbb59c
%{_pkgdocdir}/*
6fbb59c
%dir %{_pkgdocdir}
ff653f3
ff653f3
%changelog
d762928
* Mon Jun 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-9
d762928
- Ceph FSAL enabled with ceph-0.80
d762928
fe5a967
* Wed May 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-8
fe5a967
- getdents()->getdents64(), struct dirent -> struct dirent64
fe5a967
1519577
* Sat May 10 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
3fdc8c0
- and exclude libfsalceph
3fdc8c0
3fdc8c0
* Sat May 10 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
1519577
- exclude libfsalgluster correctly
1519577
830a96e
* Fri May 9 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-7
830a96e
- Ceph FSAL, in a subpackage, (but requires ceph >= 0.78)
830a96e
ad7af46
* Mon Mar 31 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
ad7af46
- GlusterFS FSAL in a subpackage
ad7af46
- EPEL7 has jemalloc as of 2014-02-25
ad7af46
d06d882
* Tue Jan 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
d06d882
- sussed out github archive so as to allow correct Source0
d06d882
f063405
* Fri Jan 17 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-6
f063405
- EPEL7 and xfsprogs
f063405
ff5c1c3
* Fri Jan 17 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-5
ff5c1c3
- EPEL7
ff5c1c3
f674675
* Mon Jan 6 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-4
f674675
- with glusterfs-api(-devel) >= 3.4.2
f674675
6c1f1e7
* Sat Jan 4 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-3
6c1f1e7
- with glusterfs-api
6c1f1e7
6fbb59c
* Thu Jan 2 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-2
6fbb59c
- Build on RHEL6. Add sample init.d script
6fbb59c
Jim Lieb 37c738d
* Wed Dec 11 2013 Jim Lieb <lieb@sea-troll.net> - 2.0.0-1
Jim Lieb 37c738d
- Update to V2.0.0 release
Jim Lieb 37c738d
49cc5b0
* Mon Nov 25 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.2.rcfinal
49cc5b0
- update to RC-final
6d8c908
6d8c908
* Fri Nov 22 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.1.rc5
6d8c908
- Initial commit