Add redis-trib based on patch from Sebastian Saletnik.

Merge the redis-trib sub-package patch originally from
Sebastian Saletnik with added conditionals for building
on platforms with no ruby redis gem (EPEL6 and Fedoras
before f19).

This resolves Redis RHBZ #1215654.
This commit is contained in:
Nathan Scott 2017-08-14 18:07:25 +10:00
parent 16aeff4dbc
commit 64e67eb9fe

View File

@ -1,6 +1,12 @@
%global _hardened_build 1 %global _hardened_build 1
%global with_perftools 0 %global with_perftools 0
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
%global with_redistrib 1
%else
%global with_redistrib 0
%endif
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
%global with_systemd 1 %global with_systemd 1
%else %else
@ -12,7 +18,7 @@
Name: redis Name: redis
Version: 3.2.10 Version: 3.2.10
Release: 1%{?dist} Release: 2%{?dist}
Summary: A persistent key-value database Summary: A persistent key-value database
License: BSD License: BSD
URL: http://redis.io URL: http://redis.io
@ -96,6 +102,18 @@ a cache.
You can use Redis from most programming languages also. You can use Redis from most programming languages also.
%if 0%{?with_redistrib}
%package trib
Summary: Cluster management script for Redis
BuildArch: noarch
Requires: ruby
Requires: rubygem-redis
%description trib
Redis cluster management utility providing cluster creation, node addition
and removal, status checks, resharding, rebalancing, and other operations.
%endif
%prep %prep
%setup -q %setup -q
rm -frv deps/jemalloc rm -frv deps/jemalloc
@ -168,6 +186,11 @@ chmod 755 %{buildroot}%{_bindir}/%{name}-*
# Install redis-shutdown # Install redis-shutdown
install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown
%if 0%{?with_redistrib}
# Install redis-trib
install -pDm755 src/%{name}-trib.rb %{buildroot}%{_bindir}/%{name}-trib
%endif
# Install man pages # Install man pages
man=$(dirname %{buildroot}%{_mandir}) man=$(dirname %{buildroot}%{_mandir})
for page in man/man?/*; do for page in man/man?/*; do
@ -233,6 +256,9 @@ fi
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name} %dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name} %dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
%dir %attr(0750, redis, redis) %ghost %{_localstatedir}/run/%{name} %dir %attr(0750, redis, redis) %ghost %{_localstatedir}/run/%{name}
%if 0%{?with_redistrib}
%exclude %{_bindir}/%{name}-trib
%endif
%{_bindir}/%{name}-* %{_bindir}/%{name}-*
%{_libexecdir}/%{name}-* %{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}* %{_mandir}/man1/%{name}*
@ -250,16 +276,25 @@ fi
%config(noreplace) %{_sysconfdir}/security/limits.d/95-%{name}.conf %config(noreplace) %{_sysconfdir}/security/limits.d/95-%{name}.conf
%endif %endif
%if 0%{?with_redistrib}
%files trib
%license COPYING
%{_bindir}/%{name}-trib
%endif
%changelog %changelog
* Mon Aug 14 2017 Nathan Scott <nathans@redhat.com> - 3.2.10-2
- Add redis-trib based on patch from Sebastian Saletnik. (RHBZ #1215654)
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Mon Jul 31 2017 Nathan Scott <nathans@redhat.com> - 3.2.10-1 * Mon Jul 31 2017 Nathan Scott <nathans@redhat.com> - 3.2.10-1
- Upstream 3.2.10 release - Upstream 3.2.10 release
- Ensure both the redis and redis-sentinel service files set correct perms - Ensure both the redis and redis-sentinel service files set correct perms
- Dropped systemd tmpfiles source, handled directly in systemd service files - Dropped systemd tmpfiles source, handled directly in systemd service files
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.9-2 * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild