redis/redis.spec

126 lines
4.2 KiB
RPMSpec
Raw Permalink Normal View History

2015-12-18 18:13:18 +03:00
Name: redis
2024-10-04 21:44:55 +00:00
Version: 7.2.6
2021-10-05 21:27:22 +03:00
Release: 1
2020-04-08 21:32:55 +00:00
Summary: A persistent key-value database
2016-12-02 08:00:57 +04:00
Group: Databases
2024-05-19 11:58:18 +00:00
License: RSALv2 and SSPLv1
2023-08-26 08:27:31 +00:00
URL: http://redis.io
2020-06-09 18:57:38 +00:00
Patch0: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
Patch1: 0001-redis-4.0.8-workaround-make-deadlock.patch
2024-05-19 11:58:18 +00:00
#Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
Source0: https://github.com/redis/redis/archive/%{version}/%{name}-%{version}.tar.gz
2020-06-09 18:57:38 +00:00
Source1: redis-limit-systemd
Source2: redis-sentinel.service
Source3: redis-shutdown
Source4: redis.logrotate
2020-04-08 21:32:55 +00:00
# Based on, but not identical to, Fedora's file
2021-05-27 20:24:31 +03:00
Source5: redis.service
BuildRequires: pkgconfig(lua)
BuildRequires: procps-ng
BuildRequires: systemd
BuildRequires: tcl
BuildRequires: pkgconfig(libsystemd)
2023-08-26 08:27:31 +00:00
Requires: awk
2021-05-27 20:24:31 +03:00
Requires: logrotate
BuildRequires: rpm-helper
Requires(pre): rpm-helper >= 0.24.8-1
Requires(postun): rpm-helper >= 0.24.8-1
2012-02-01 20:01:41 +04:00
%description
2012-06-01 05:30:33 +04:00
Redis is an advanced key-value store.
2020-04-08 21:32:55 +00:00
It is similar to memcached but the data set is not volatile,
and values can be strings, exactly like in memcached,
but also lists, sets, and ordered sets.
2012-10-05 06:59:54 +04:00
All this data types can be manipulated with atomic operations
to push/pop elements, add/remove elements, perform server side
2020-04-08 21:32:55 +00:00
union, intersection, difference between sets, and so
forth. Redis supports different kind of sorting abilities.
2012-02-01 20:01:41 +04:00
%prep
2023-08-26 08:27:31 +00:00
#autosetup -p1 -n %{name}-%{version}%{?beta:-%{beta}}
%setup -q
2012-02-01 20:01:41 +04:00
2020-04-08 21:32:55 +00:00
rm -rf deps/jemalloc
2012-02-01 20:01:41 +04:00
2020-04-08 21:32:55 +00:00
# No hidden build.
sed -i -e 's|\t@|\t|g' deps/lua/src/Makefile
sed -i -e 's|$(QUIET_CC)||g' src/Makefile
sed -i -e 's|$(QUIET_LINK)||g' src/Makefile
sed -i -e 's|$(QUIET_INSTALL)||g' src/Makefile
# Ensure deps are built with proper flags
sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/Makefile
sed -i -e 's|OPTIMIZATION?=-O3|OPTIMIZATION=%{optflags}|g' deps/hiredis/Makefile
sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/hiredis/Makefile
sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/linenoise/Makefile
sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/linenoise/Makefile
# Configuration file changes
sed -i -e 's|^logfile .*$|logfile /var/log/redis/redis.log|g' redis.conf
sed -i -e 's|^logfile .*$|logfile /var/log/redis/sentinel.log|g' sentinel.conf
sed -i -e 's|^dir .*$|dir /var/lib/redis|g' redis.conf
%build
%make \
DEBUG="" \
LDFLAGS="%{ldflags}" \
CFLAGS+="%{optflags}" \
LUA_LDFLAGS+="%{ldflags}" \
MALLOC=libc \
BUILD_WITH_SYSTEMD=yes \
2020-04-08 21:32:55 +00:00
all
2012-02-01 20:01:41 +04:00
2012-06-01 05:30:33 +04:00
%install
2020-04-08 21:32:55 +00:00
%make install INSTALL="install -p" PREFIX=%{buildroot}%{_prefix}
2012-06-01 05:30:33 +04:00
2020-04-08 21:32:55 +00:00
# Filesystem
mkdir -p %{buildroot}%{_sharedstatedir}/%{name} \
%{buildroot}%{_localstatedir}/log/%{name} \
2023-08-26 08:27:31 +00:00
%{buildroot}%{_localstatedir}/run/%{name} \
%{buildroot}%{_localstatedir}/lib/%{name}
2020-04-08 21:32:55 +00:00
# Extras
install -pDm 755 %{S:3} %{buildroot}%{_bindir}/%{name}-shutdown
# Logrotate file
install -pDm 644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# Configuration files
2021-05-27 20:24:31 +03:00
mkdir -p %{buildroot}%{_sysconfdir}/redis/
2020-04-08 21:32:55 +00:00
install -pDm 644 redis.conf %{buildroot}%{_sysconfdir}/redis.conf
install -pDm 644 sentinel.conf %{buildroot}%{_sysconfdir}/redis-sentinel.conf
# Systemd unit files
install -pDm 644 %{S:2} %{buildroot}%{_unitdir}/redis-sentinel.service
install -pDm 644 %{S:5} %{buildroot}%{_unitdir}/redis.service
2012-02-01 20:01:41 +04:00
2020-04-08 21:32:55 +00:00
# Systemd limits
install -pDm 644 %{S:1} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
install -pDm 644 %{S:1} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
2023-08-26 08:27:31 +00:00
2020-04-08 21:32:55 +00:00
%check
# Currently says all tests passed and then segfaults
#make test
%pre
%_pre_useradd %{name} %{_sharedstatedir}/%{name} /sbin/nologin
2012-10-05 06:59:54 +04:00
2020-07-30 13:46:47 +00:00
%postun
2020-04-08 21:32:55 +00:00
%_postun_userdel %{name}
2012-02-01 20:01:41 +04:00
%files
2023-08-26 08:27:31 +00:00
%doc 00-RELEASENOTES BUGS COPYING README.md
2012-02-01 20:01:41 +04:00
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
2012-06-01 05:30:33 +04:00
%config(noreplace) %{_sysconfdir}/%{name}.conf
2020-04-08 21:32:55 +00:00
%config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf
2012-06-01 05:30:33 +04:00
%dir %attr(0755, redis, root) %{_localstatedir}/lib/%{name}
%dir %attr(0755, redis, root) %{_localstatedir}/log/%{name}
%{_bindir}/%{name}-*
%{_unitdir}/%{name}.service
2020-04-08 21:32:55 +00:00
%{_unitdir}/%{name}-sentinel.service
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
%dir %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d
%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf