nfs-ganesha/nfs-ganesha.spec

216 lines
6.4 KiB
RPMSpec
Raw Normal View History

# %%global prereltag rcfinal
%global ntirpcname ntirpc
%global ntirpcvers 1.0.0
2013-12-02 18:19:07 +00:00
%global _hardened_build 1
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
%global _with_systemd true
%endif
2014-01-04 16:21:56 +00:00
# GlusterFS is not available in EPEL
%if ( ! 0%{?rhel} )
%global with_glusterfs true
%endif
Name: nfs-ganesha
Version: 2.0.0
2014-01-17 19:06:53 +00:00
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: 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
%{!?_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
2014-01-17 14:38:29 +00:00
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} < 7 )
# jemalloc not in rhel7 yet
BuildRequires: jemalloc-devel
2014-01-17 14:38:29 +00:00
%endif
2014-01-17 19:06:53 +00:00
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
BuildRequires: xfsprogs-devel
BuildRequires: libnfsidmap-devel
BuildRequires: libwbclient-devel
%endif
BuildRequires: libcap-devel
2014-01-04 16:21:56 +00:00
%if ( 0%{?with_glusterfs:1} )
BuildRequires: glusterfs-api-devel >= 3.4.2
2014-01-04 16:21:56 +00:00
%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
2014-01-17 14:38:29 +00:00
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} < 7 )
# jemalloc not in rhel7 yet
Requires: jemalloc
2014-01-17 14:38:29 +00:00
%endif
2014-01-04 16:21:56 +00:00
%if ( 0%{?with_glusterfs:1} )
Requires: glusterfs-api >= 3.4.2
2014-01-04 16:21:56 +00:00
%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
* Tue Jan 21 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com>
- sussed out github archive so as to allow correct Source0
2014-01-17 19:06:53 +00:00
* Fri Jan 17 2014 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-6
- EPEL7 and xfsprogs
2014-01-17 14:38:29 +00:00
* 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
2014-01-04 16:21:56 +00:00
* 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
2013-12-11 01:18:46 +00:00
* Wed Dec 11 2013 Jim Lieb <lieb@sea-troll.net> - 2.0.0-1
- Update to V2.0.0 release
2013-11-25 17:58:01 +00:00
* Mon Nov 25 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.2.rcfinal
- update to RC-final
2013-11-25 18:01:01 +00:00
* Fri Nov 22 2013 Kaleb S. KEITHLEY <kkeithle at redhat.com> 2.0.0-0.1.rc5
- Initial commit