Merge branch 'private-nathans-redis4'

This commit is contained in:
Nathan Scott 2017-11-06 18:09:22 +11:00
commit 91318c4827
5 changed files with 115 additions and 15 deletions

2
.gitignore vendored
View File

@ -35,3 +35,5 @@ clog
/redis-3.2.9.tar.gz
/redis-3.2.10.tar.gz
/redis-3.2.11.tar.gz
/redis-4.0.2.tar.gz
/redis-doc-69a5512.tar.gz

View File

@ -1,25 +1,26 @@
From 992c773e70462a6fbe1536e18e673c9ab55d5901 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 9 Sep 2016 17:23:27 +0200
Subject: [PATCH 2/2] install redis-check-rdb as a symlink instead of
duplicating the binary
Subject: [PATCH 2/2] install redis-check-rdb as a symlink instead of duplicating
the binary
---
src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
src/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index fdbe36a..c3083f8 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -267,6 +267,6 @@ install: all
@@ -287,6 +287,6 @@ install: all
$(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_BIN)
$(REDIS_INSTALL) $(REDIS_BENCHMARK_NAME) $(INSTALL_BIN)
$(REDIS_INSTALL) $(REDIS_CLI_NAME) $(INSTALL_BIN)
- $(REDIS_INSTALL) $(REDIS_CHECK_RDB_NAME) $(INSTALL_BIN)
$(REDIS_INSTALL) $(REDIS_CHECK_AOF_NAME) $(INSTALL_BIN)
- $(REDIS_INSTALL) $(REDIS_CHECK_AOF_NAME) $(INSTALL_BIN)
@ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
+ @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_CHECK_RDB_NAME)
+ @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_CHECK_AOF_NAME)
--
2.13.5

2
macros.redis Normal file
View File

@ -0,0 +1,2 @@
%redis_modules_abi 1
%redis_modules_dir %{_libdir}/redis/modules

View File

@ -1,4 +1,3 @@
%global _hardened_build 1
%global with_perftools 0
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
@ -7,6 +6,12 @@
%global with_redistrib 0
%endif
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
%global with_pandoc 1
%else
%global with_pandoc 0
%endif
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
%global with_systemd 1
%else
@ -14,10 +19,15 @@
%endif
# Tests fail in mock, not in local build.
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
# Commit IDs for the (unversioned) redis-doc repository
# https://fedoraproject.org/wiki/Packaging:SourceURL "Commit Revision"
%global doc_commit 69a5512ae6a4ec77d7b1d0af6aac2224e8e83f95
%global short_doc_commit %(c=%{doc_commit}; echo ${c:0:7})
Name: redis
Version: 3.2.11
Version: 4.0.2
Release: 1%{?dist}
Summary: A persistent key-value database
License: BSD
@ -31,6 +41,9 @@ Source5: %{name}.init
Source6: %{name}-shutdown
Source7: %{name}-limit-systemd
Source8: %{name}-limit-init
Source9: macros.%{name}
Source10: https://github.com/antirez/%{name}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz
# To refresh patches:
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline"
# git am %%{patches}
@ -48,13 +61,14 @@ BuildRequires: jemalloc-devel
%endif
%if 0%{?with_tests}
BuildRequires: procps-ng
BuildRequires: tcl
%endif
%if 0%{?with_pandoc}
BuildRequires: pandoc
%endif
%if 0%{?with_systemd}
BuildRequires: systemd
%endif
%if 0%{?with_tests}
BuildRequires: tcl
%endif
# Required for redis-shutdown
Requires: /bin/awk
Requires: logrotate
@ -73,6 +87,10 @@ Provides: bundled(hiredis)
Provides: bundled(lua-libs)
Provides: bundled(linenoise)
%global redis_modules_abi 1
%global redis_modules_dir %{_libdir}/%{name}/modules
Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi}
%description
Redis is an advanced key-value store. It is often referred to as a data
structure server since keys can contain strings, hashes, lists, sets and
@ -98,6 +116,27 @@ a cache.
You can use Redis from most programming languages also.
%package devel
Summary: Development header for Redis module development
# Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines)
Provides: %{name}-static = %{version}-%{release}
%description devel
Header file required for building loadable Redis modules. Detailed
API documentation is available in the redis-doc package.
%package doc
Summary: Documentation for Redis including man pages
License: CC-BY-SA
BuildArch: noarch
# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
Conflicts: redis < 4.0
%description doc
Manual pages and detailed documentation for many aspects of Redis use,
administration and development.
%if 0%{?with_redistrib}
%package trib
Summary: Cluster management script for Redis
@ -111,7 +150,9 @@ and removal, status checks, resharding, rebalancing, and other operations.
%endif
%prep
%setup -q -b 10
%setup -q
mv ../%{name}-doc-%{doc_commit} doc
rm -frv deps/jemalloc
%patch0001 -p1
%patch0002 -p1
@ -120,11 +161,27 @@ rm -frv deps/jemalloc
sed -i -e '/cd jemalloc && /d' deps/Makefile
sed -i -e 's|../deps/jemalloc/lib/libjemalloc.a|-ljemalloc -ldl|g' src/Makefile
sed -i -e 's|-I../deps/jemalloc.*|-DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc|g' src/Makefile
# Configuration file changes and additions
sed -i -e 's|^logfile .*$|logfile /var/log/redis/redis.log|g' redis.conf
sed -i -e '$ alogfile /var/log/redis/sentinel.log' sentinel.conf
sed -i -e 's|^dir .*$|dir /var/lib/redis|g' redis.conf
# Module API version safety check
api=`sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h`
if test "$api" != "%{redis_modules_abi}"; then
: Error: Upstream API version is now ${api}, expecting %%{redis_modules_abi}.
: Update the redis_modules_abi macro, the rpmmacros file, and rebuild.
exit 1
fi
%if 0%{?with_pandoc}
docs=`find doc -name \*.md | sed -e 's|.md$||g'`
for doc in $docs; do
pandoc --standalone --from markdown --to html --output $doc.html $doc.md
done
%endif
%if 0%{?with_perftools}
%global malloc_flags MALLOC=tcmalloc
%else
@ -142,6 +199,7 @@ make %{make_flags} install
install -d %{buildroot}%{_sharedstatedir}/%{name}
install -d %{buildroot}%{_localstatedir}/log/%{name}
install -d %{buildroot}%{_localstatedir}/run/%{name}
install -d %{buildroot}%{redis_modules_dir}
# Install logrotate file.
install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
@ -171,6 +229,9 @@ chmod 755 %{buildroot}%{_bindir}/%{name}-*
# Install redis-shutdown
install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown
# Install redis module header
install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h
%if 0%{?with_redistrib}
# Install redis-trib
install -pDm755 src/%{name}-trib.rb %{buildroot}%{_bindir}/%{name}-trib
@ -184,6 +245,20 @@ done
ln -s redis-server.1 %{buildroot}%{_mandir}/man1/redis-sentinel.1
ln -s redis.conf.5 %{buildroot}%{_mandir}/man5/redis-sentinel.conf.5
# Install markdown and html pages
doc=$(echo %{buildroot}/%{_docdir}/%{name})
for page in $(find doc -name \*.md | sed -e 's|.md$||g'); do
base=$(echo $page | sed -e 's|doc/||g')
install -Dpm644 $page.md $doc/$base.md
%if 0%{?with_pandoc}
install -Dpm644 $page.html $doc/$base.html
%endif
done
# Install rpm macros for redis modules
mkdir -p %{buildroot}%{rpmmacrodir}
install -pDm644 %{S:9} %{buildroot}%{rpmmacrodir}/macros.%{name}
%check
%if 0%{?with_tests}
# https://github.com/antirez/redis/issues/1417 (for "taskset -c 1")
@ -245,10 +320,12 @@ fi
%if 0%{?with_redistrib}
%exclude %{_bindir}/%{name}-trib
%endif
%exclude %{rpmmacrodir}
%exclude %{_includedir}
%exclude %{_mandir}
%exclude %{_docdir}
%{_bindir}/%{name}-*
%{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}*
%{_mandir}/man5/%{name}*
%if 0%{?with_systemd}
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}-sentinel.service
@ -262,6 +339,17 @@ fi
%config(noreplace) %{_sysconfdir}/security/limits.d/95-%{name}.conf
%endif
%files devel
%license COPYING
%{_includedir}/%{name}module.h
%{rpmmacrodir}/*
%files doc
%{_mandir}/man1/%{name}*
%{_mandir}/man5/%{name}*
%docdir %{_docdir}/%{name}
%{_docdir}/%{name}/*
%if 0%{?with_redistrib}
%files trib
%license COPYING
@ -270,6 +358,12 @@ fi
%changelog
* Tue Oct 31 2017 Nathan Scott <nathans@redhat.com> - 4.0.2-1
- Upstream 4.0.2 release. (RHBZ #1389592)
- Add redis-devel for loadable module development.
- Add redis-doc for man pages and detailed documentation.
- Provide redis-check-aof as a symlink to redis-server also now.
* Tue Sep 26 2017 Nathan Scott <nathans@redhat.com> - 3.2.11-1
- Upstream 3.2.11 bug-fix-only release
- Switch to using Type=notify for Redis systemd services (RHBZ #1172841)

View File

@ -1 +1,2 @@
SHA512 (redis-3.2.11.tar.gz) = 3eab216350828ef78e7e9e28ac2fff3ea89d9eb7f86a66c4788667cde7c966bce7dda03470c2baacf2dce63496685e11ca2ef0a82b5fbbd20fb8e449146a20ee
SHA512 (redis-4.0.2.tar.gz) = 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4
SHA512 (redis-doc-69a5512.tar.gz) = 0b5a8f48dbddafcc0322f7740180d760ad470bbfb2e1653195f4cb7af786795bf40bd43f39691a2905929addb8a4efa498963d70974a0f0b9ea6e84ccf039760