# %%global prereltag rcfinal %global ntirpcname ntirpc %global ntirpcvers 1.0.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 currently 3.4.0 client, but nfs-ganesha needs 3.4.2. %if ( ! 0%{?rhel} ) %global with_glusterfs true %endif %global with_cephfs true Name: nfs-ganesha Version: 2.0.0 Release: 9%{?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 Source3: nfs-ganesha.init Source4: nfs_ganesha.sh Patch1: nfs-ganesha-2.0.0rc5.patch Patch2: nfs-ganesha-2.0.0-lustre-strict.patch Patch3: nfs-ganesha-2.0.0-no-strict-aliasing.patch Patch4: nfs-ganesha-2.0.0-dirent.patch Patch5: nfs-ganesha-2.0.0-fsal_ceph.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_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 %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.4.2 BuildRequires: glusterfs-api-devel >= 3.4.2 %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 GlusterFS 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/ %patch1 -p1 %patch2 -p1 %if ( 0%{?rhel} && 0%{?rhel} < 7 ) %patch3 -p1 %endif %patch4 -p1 %patch5 -p1 %build %if ( 0%{?rhel} && 0%{?rhel} < 7 ) %global cmake %cmake28 %endif %cmake -DCMAKE_BUILD_TYPE=Maintainer -DBUILD_CONFIG=everything -DCMAKE_INSTALL_PREFIX=%{buildroot}/usr ./src # _smp_mflags elided due to random build errors (cmake related?) make VERBOSE=1 %install make install rm %{buildroot}%{_bindir}/libntirpc.* chmod ugo+x %{buildroot}%{_bindir}/ganestat.pl rm %{buildroot}%{_libdir}/ganesha/*.so mkdir -p %{buildroot}%{_pkgdocdir} cp -p src/Docs/*.pdf %{buildroot}%{_pkgdocdir}/ %if ( 0%{?_with_systemd:1} ) install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/nfs-ganesha.service %else install -D -p -m 0744 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/nfs-ganesha install -D -p -m 0744 %{SOURCE4} %{buildroot}%{_sbindir}/nfs_ganesha.sh %endif %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/TODO 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/* %{_sbindir}/* %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 * Mon Jun 2 2014 Kaleb S. KEITHLEY 2.0.0-9 - Ceph FSAL enabled with ceph-0.80 * Wed May 21 2014 Kaleb S. KEITHLEY 2.0.0-8 - getdents()->getdents64(), struct dirent -> struct dirent64 * Sat May 10 2014 Kaleb S. KEITHLEY - and exclude libfsalceph * Sat May 10 2014 Kaleb S. KEITHLEY - exclude libfsalgluster correctly * Fri May 9 2014 Kaleb S. KEITHLEY 2.0.0-7 - Ceph FSAL, in a subpackage, (but requires ceph >= 0.78) * Mon Mar 31 2014 Kaleb S. KEITHLEY - GlusterFS FSAL in a subpackage - EPEL7 has jemalloc as of 2014-02-25 * Tue Jan 21 2014 Kaleb S. KEITHLEY - sussed out github archive so as to allow correct Source0 * Fri Jan 17 2014 Kaleb S. KEITHLEY 2.0.0-6 - EPEL7 and xfsprogs * Fri Jan 17 2014 Kaleb S. KEITHLEY 2.0.0-5 - EPEL7 * Mon Jan 6 2014 Kaleb S. KEITHLEY 2.0.0-4 - with glusterfs-api(-devel) >= 3.4.2 * Sat Jan 4 2014 Kaleb S. KEITHLEY 2.0.0-3 - with glusterfs-api * Thu Jan 2 2014 Kaleb S. KEITHLEY 2.0.0-2 - Build on RHEL6. Add sample init.d script * Wed Dec 11 2013 Jim Lieb - 2.0.0-1 - Update to V2.0.0 release * Mon Nov 25 2013 Kaleb S. KEITHLEY 2.0.0-0.2.rcfinal - update to RC-final * Fri Nov 22 2013 Kaleb S. KEITHLEY 2.0.0-0.1.rc5 - Initial commit