# %%global prereltag rcfinal %global version 2.0.0 %global reltag V%{version} %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 %if ( ! 0%{?rhel} ) %global with_glusterfs true %endif %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: nfs-ganesha Version: %{version} Release: 6%{?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: %{name}-%{version}.tar.gz Source1: %{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 # 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 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} < 7 ) # jemalloc not in rhel7 yet BuildRequires: jemalloc-devel %endif %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_glusterfs:1} ) BuildRequires: glusterfs-api-devel >= 3.4.2 %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 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} < 7 ) # jemalloc not in rhel7 yet Requires: jemalloc %endif %if ( 0%{?with_glusterfs:1} ) Requires: glusterfs-api >= 3.4.2 %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. %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 %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 %{_libdir}/* %{_bindir}/* %if ( 0%{?_with_systemd:1} ) %{_unitdir}/* %else %{_sysconfdir}/init.d/* %{_sbindir}/* %endif %files docs %{_pkgdocdir}/LICENSE.txt %{_pkgdocdir}/* %dir %{_pkgdocdir} %changelog * 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