forked from pool/redis
- update to 3.0.0 >> What's new in Redis 3.0 compared to Redis 2.8? * Redis Cluster: a distributed implementation of a subset of Redis. * New "embedded string" object encoding resulting in less cache misses. Big speed gain under certain work loads. * AOF child -> parent final data transmission to minimize latency due to "last write" during AOF rewrites. * Much improved LRU approximation algorithm for keys eviction. * WAIT command to block waiting for a write to be transmitted to the specified number of slaves. * MIGRATE connection caching. Much faster keys migraitons. * MIGARTE new options COPY and REPLACE. * CLIENT PAUSE command: stop processing client requests for a specified amount of time. * BITCOUNT performance improvements. * CONFIG SET accepts memory values in different units (for example you can use "CONFIG SET maxmemory 1gb"). * Redis log format slightly changed reporting in each line the role of the instance (master/slave) or if it's a saving child log. * INCR performance improvements. >> Refactoring changes (no new features nor bug fixes) * Blocking operations full refactoring (blocked.c) * Client output buffer memory tracking refactored. for all the details see /usr/share/doc/packages/redis/00-RELEASENOTES - refreshed redis-enable-bactrace-on-x86-and-ia64-only.patch to apply cleanly OBS-URL: https://build.opensuse.org/request/show/294142 OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=62
180 lines
5.5 KiB
RPMSpec
180 lines
5.5 KiB
RPMSpec
#
|
|
# spec file for package redis
|
|
#
|
|
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
%if 0%{?suse_version} > 1230
|
|
%bcond_without systemd
|
|
%else
|
|
%bcond_with systemd
|
|
%endif
|
|
|
|
%define _data_dir %{_localstatedir}/lib/%{name}
|
|
%define _log_dir %{_localstatedir}/log/%{name}
|
|
%define _conf_dir %{_sysconfdir}/%{name}
|
|
|
|
Name: redis
|
|
Version: 3.0.0
|
|
Release: 0
|
|
Summary: Persistent key-value database
|
|
License: BSD-3-Clause
|
|
Group: Productivity/Databases/Servers
|
|
Url: http://redis.io/
|
|
Source: http://download.redis.io/releases/redis-%{version}.tar.gz
|
|
Source1: %{name}.logrotate
|
|
Source2: redis.target
|
|
Source3: redis@.service
|
|
Source4: redis.tmpfiles.d
|
|
Source5: README.SUSE
|
|
# PATCH-FIX-OPENSUSE -- openSUSE-style init script
|
|
Patch0: %{name}-initscript.patch
|
|
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
|
Patch1: %{name}-conf.patch
|
|
Patch2: redis-enable-bactrace-on-x86-and-ia64-only.patch
|
|
BuildRequires: procps
|
|
BuildRequires: tcl
|
|
%if %{with systemd}
|
|
BuildRequires: pkgconfig(systemd)
|
|
%{?systemd_requires}
|
|
%else
|
|
PreReq: %{insserv_prereq} %{fillup_prereq}
|
|
%endif
|
|
Requires: logrotate
|
|
Requires: sudo
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%description
|
|
Redis is an advanced key-value store. It is similar to memcached but the dataset
|
|
is not volatile, and values can be strings, exactly like in memcached,
|
|
but also lists, sets, and ordered sets. All this data types can be manipulated
|
|
with atomic operations to push/pop elements, add/remove elements, perform server
|
|
side union, intersection, difference between sets, and so forth. Redis supports
|
|
different kind of sorting abilities.
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch0
|
|
%patch1
|
|
%patch2
|
|
|
|
%build
|
|
make %{?_smp_mflags} CFLAGS="%{optflags}" V=1
|
|
|
|
%install
|
|
install -m 0750 -d \
|
|
%{buildroot}%{_log_dir} \
|
|
%{buildroot}%{_data_dir} \
|
|
%{buildroot}%{_conf_dir} \
|
|
%{buildroot}%{_log_dir}/default \
|
|
%{buildroot}%{_data_dir}/default
|
|
|
|
install -D -m 0755 src/redis-benchmark %{buildroot}%{_bindir}/redis-benchmark
|
|
install -m 0755 src/redis-cli %{buildroot}%{_bindir}/redis-cli
|
|
install -m 0755 src/redis-check-dump %{buildroot}%{_bindir}/redis-check-dump
|
|
install -m 0755 src/redis-check-aof %{buildroot}%{_bindir}/redis-check-aof
|
|
install -D -m 0755 src/redis-server %{buildroot}%{_sbindir}/redis-server
|
|
|
|
%if %{with systemd}
|
|
perl -p -i -e 's|daemonize yes|daemonize no|g' redis.conf
|
|
%endif
|
|
install -D -m 0640 redis.conf %{buildroot}%{_conf_dir}/default.conf.example
|
|
|
|
#
|
|
# init
|
|
#
|
|
%if %{with systemd}
|
|
install -D -m 0644 %{S:2} %{buildroot}%{_unitdir}/redis.target
|
|
install -D -m 0644 %{S:3} %{buildroot}%{_unitdir}/redis@.service
|
|
install -D -m 0644 %{S:4} %{buildroot}/usr/lib/tmpfiles.d/%{name}.conf
|
|
%{__ln_s} -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
|
cp %{S:5} README.SUSE
|
|
%else
|
|
install -D -m 0755 utils/redis_init_script %{buildroot}%{_sysconfdir}/init.d/redis
|
|
ln -s %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
|
|
%endif
|
|
|
|
#
|
|
# logrotate
|
|
#
|
|
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
|
|
%check
|
|
%ifnarch ppc ppc64
|
|
cat <<EOF
|
|
---------------------------------------------------
|
|
The test suite often fails to start a server, with
|
|
'child process exited abnormally' -- sometimes it works.
|
|
---------------------------------------------------
|
|
EOF
|
|
make test && true
|
|
%endif
|
|
|
|
%pre
|
|
/usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || :
|
|
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Redis key-value store" -d %{_data_dir} %{name} >/dev/null 2>&1 || :
|
|
%if %{with systemd}
|
|
%service_add_pre %{name}.target
|
|
%endif
|
|
|
|
%post
|
|
%if %{with systemd}
|
|
systemd-tmpfiles --create /usr/lib/tmpfiles.d/%{name}.conf || true
|
|
%service_add_post %{name}.target
|
|
echo "See /usr/share/doc/packages/redis/README.SUSE to continue"
|
|
%else
|
|
echo "To start the database server, create your configuration"
|
|
echo "starting from /etc/redis/default.conf.example, place it"
|
|
echo "in /etc/redis and do: "
|
|
echo " sudo rcredis start; sudo chkconfig redis on"
|
|
%endif
|
|
|
|
%preun
|
|
%if %{with systemd}
|
|
%service_del_preun %{name}.target
|
|
%else
|
|
%stop_on_removal %{name}
|
|
%endif
|
|
|
|
%postun
|
|
%if %{with systemd}
|
|
%service_del_postun %{name}.target
|
|
%else
|
|
%restart_on_update %{name}
|
|
%insserv_cleanup
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING README
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
%{_bindir}/redis-*
|
|
%{_sbindir}/redis-*
|
|
%{_sbindir}/rc%{name}
|
|
%if %{with systemd}
|
|
/usr/lib/tmpfiles.d/%{name}.conf
|
|
%{_unitdir}/%{name}@.service
|
|
%{_unitdir}/%{name}.target
|
|
%doc README.SUSE
|
|
%else
|
|
%config(noreplace) %{_sysconfdir}/init.d/%{name}
|
|
%endif
|
|
%config(noreplace) %attr(-, root, %{name}) %{_conf_dir}/
|
|
#
|
|
%dir %attr(0750, %{name}, %{name}) %{_data_dir}
|
|
%dir %attr(0750, %{name}, %{name}) %{_data_dir}/default
|
|
%dir %attr(0750, %{name}, %{name}) %{_log_dir}
|
|
|
|
%changelog
|