1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
%bcond_with tests
%global doc_commit e0528232fdd0d2efc91d62b798b924d716f88813
%global short_doc_commit %(c=%{doc_commit}; echo ${c:0:7})
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
%global make_flags DEBUG="" V="echo" LDFLAGS="%{?__global_ldflags}" CFLAGS+="%{optflags} -fPIC" INSTALL="install -p" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes
%global Pname redis
Name: redis6
Version: 7.0.0
Release: 3
Summary: A persistent key-value database
License: BSD and MIT
URL: https://redis.io
Source0: https://download.redis.io/releases/%{Pname}-%{version}.tar.gz
Source1: %{Pname}.logrotate
Source2: %{Pname}-sentinel.service
Source3: %{Pname}.service
Source6: %{Pname}-shutdown
Source7: %{Pname}-limit-systemd
Source9: macros.%{Pname}
Source10: https://github.com/%{Pname}/%{Pname}-doc/archive/%{doc_commit}/%{Pname}-doc-%{short_doc_commit}.tar.gz
Patch0001: Modify-aarch64-architecture-jemalloc-page-size-from-from-4k-to-64k.patch
Patch0003: Add-loongarch64-support.patch
Patch0004: Update-config.guess-and-config.sub.patch
Patch0002: fix-help-info.patch
BuildRequires: make gcc
%if %{with tests}
BuildRequires: procps-ng tcl
%endif
BuildRequires: pkgconfig(libsystemd) systemd-devel openssl-devel libatomic
Obsoletes: redis-trib < 5
Requires: /bin/awk logrotate
Provides: bundled(hiredis) = 0.14.0
Provides: bundled(jemalloc) = 5.1.0
Provides: bundled(lua-libs) = 5.1.5
Provides: bundled(linenoise) = 1.0
Provides: bundled(lzf)
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Provides: redis(modules_abi)%{?_isa} = 1
Conflicts: redis redis5
%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
sorted sets.
You can run atomic operations on these types, like appending to a string;
incrementing the value in a hash; pushing to a list; computing set
intersection, union and difference; or getting the member with highest
ranking in a sorted set.
In order to achieve its outstanding performance, Redis works with an
in-memory dataset. Depending on your use case, you can persist it either
by dumping the dataset to disk every once in a while, or by appending
each command to a log.
Redis also supports trivial-to-setup master-slave replication, with very
fast non-blocking first synchronization, auto-reconnection on net split
and so forth.
Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
limited time-to-live, and configuration settings to make Redis behave like
a cache.
You can use Redis from most programming languages also.
%package devel
Summary: Development header for Redis module development
Provides: %{Pname}-static = %{version}-%{release}
Conflicts: redis redis5
%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
License: CC-BY-SA
BuildArch: noarch
Conflicts: redis redis5
%description doc
Detailed documentation for many aspects of Redis use,
administration and development.
%prep
tar -xvf %{SOURCE10}
%setup -n %{Pname}-%{version}
%ifarch aarch64
%patch0001 -p1
%patch0002 -p1
%endif
%ifarch loongarch64
%patch0003 -p1
%patch0004 -p1
%endif
mv ../%{Pname}-doc-%{doc_commit} doc
mv deps/lua/COPYRIGHT COPYRIGHT-lua
mv deps/jemalloc/COPYING COPYING-jemalloc
mv deps/hiredis/COPYING COPYING-hiredis
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
api=`sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h`
if test "$api" != "1"; then
: Error: Upstream API version is now ${api}, expecting %1.
: Update the redis_modules_abi macro, the rpmmacros file, and rebuild.
exit 1
fi
%build
make %{?_smp_mflags} %{make_flags} all
%install
make %{make_flags} install
install -d %{buildroot}%{_sharedstatedir}/%{Pname}
install -d %{buildroot}%{_localstatedir}/log/%{Pname}
install -d %{buildroot}%{_localstatedir}/run/%{Pname}
install -d %{buildroot}%{_libdir}/%{Pname}/modules
install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{Pname}
install -pDm640 %{Pname}.conf %{buildroot}%{_sysconfdir}/%{Pname}/%{Pname}.conf
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{Pname}/sentinel.conf
mkdir -p %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir}
install -pm644 %{S:2} %{buildroot}%{_unitdir}
install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{Pname}.service.d/limit.conf
install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{Pname}-sentinel.service.d/limit.conf
chmod 755 %{buildroot}%{_bindir}/%{Pname}-*
install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{Pname}-shutdown
install -pDm644 src/%{Pname}module.h %{buildroot}%{_includedir}/%{Pname}module.h
doc=$(echo %{buildroot}/%{_docdir}/%{Pname})
for page in 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO; do
install -Dpm644 $page $doc/$page
done
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
done
mkdir -p %{buildroot}%{macrosdir}
install -pDm644 %{S:9} %{buildroot}%{macrosdir}/macros.%{Pname}
%check
%if %{with tests}
taskset -c 1 make %{make_flags} test
make %{make_flags} test-sentinel
%endif
%pre
getent group %{Pname} &> /dev/null || \
groupadd -r %{Pname} &> /dev/null
getent passwd %{Pname} &> /dev/null || \
useradd -r -g %{Pname} -d %{_sharedstatedir}/%{Pname} -s /sbin/nologin \
-c 'Redis Database Server' %{Pname} &> /dev/null
exit 0
%post
if [ -f %{_sysconfdir}/%{Pname}.conf -a ! -L %{_sysconfdir}/%{Pname}.conf ]; then
if [ -f %{_sysconfdir}/%{Pname}/%{Pname}.conf.rpmnew ]; then
rm %{_sysconfdir}/%{Pname}/%{Pname}.conf.rpmnew
fi
if [ -f %{_sysconfdir}/%{Pname}/%{Pname}.conf ]; then
mv %{_sysconfdir}/%{Pname}/%{Pname}.conf %{_sysconfdir}/%{Pname}/%{Pname}.conf.rpmnew
fi
mv %{_sysconfdir}/%{Pname}.conf %{_sysconfdir}/%{Pname}/%{Pname}.conf
echo -e "\nWarning: %{Pname} configuration is now in %{_sysconfdir}/%{Pname} directory\n"
fi
if [ -f %{_sysconfdir}/%{Pname}-sentinel.conf -a ! -L %{_sysconfdir}/%{Pname}-sentinel.conf ]; then
if [ -f %{_sysconfdir}/%{Pname}/sentinel.conf.rpmnew ]; then
rm %{_sysconfdir}/%{Pname}/sentinel.conf.rpmnew
fi
if [ -f %{_sysconfdir}/%{Pname}/sentinel.conf ]; then
mv %{_sysconfdir}/%{Pname}/sentinel.conf %{_sysconfdir}/%{Pname}/sentinel.conf.rpmnew
fi
mv %{_sysconfdir}/%{Pname}-sentinel.conf %{_sysconfdir}/%{Pname}/sentinel.conf
fi
%systemd_post %{Pname}.service
%systemd_post %{Pname}-sentinel.service
%preun
%systemd_preun %{Pname}.service
%systemd_preun %{Pname}-sentinel.service
%postun
%systemd_postun_with_restart %{Pname}.service
%systemd_postun_with_restart %{Pname}-sentinel.service
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%license COPYRIGHT-lua
%license COPYING-jemalloc
%license COPYING-hiredis
%config(noreplace) %{_sysconfdir}/logrotate.d/%{Pname}
%attr(0750, redis, root) %dir %{_sysconfdir}/%{Pname}
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{Pname}/%{Pname}.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{Pname}/sentinel.conf
%dir %attr(0750, redis, redis) %{_libdir}/%{Pname}
%dir %attr(0750, redis, redis) %{_libdir}/%{Pname}/modules
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{Pname}
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{Pname}
%exclude %{macrosdir}
%exclude %{_includedir}
%exclude %{_docdir}/%{Pname}/*
%{_bindir}/%{Pname}-*
%{_libexecdir}/%{Pname}-*
%{_unitdir}/%{Pname}.service
%{_unitdir}/%{Pname}-sentinel.service
%dir %{_sysconfdir}/systemd/system/%{Pname}.service.d
%config(noreplace) %{_sysconfdir}/systemd/system/%{Pname}.service.d/limit.conf
%dir %{_sysconfdir}/systemd/system/%{Pname}-sentinel.service.d
%config(noreplace) %{_sysconfdir}/systemd/system/%{Pname}-sentinel.service.d/limit.conf
%dir %attr(0755, redis, redis) %ghost %{_localstatedir}/run/%{Pname}
%files devel
%license COPYING
%{_includedir}/%{Pname}module.h
%{macrosdir}/*
%files doc
%license COPYING
%docdir %{_docdir}/%{Pname}
%{_docdir}/%{Pname}
%changelog
* Wed Apr 10 2024 jiangxinyu <jiangxinyu@kylinos.cn> - 6.2.7-3
- add Conflicts with redis and redis5
* Tue Nov 15 2022 huajingyun <huajingyun@loongson.cn> - 6.2.7-2
- Update config.guess and config.sub for loongarch
* Tue Jun 14 2022 yangweidong <yangweidong9@huawei.com> - 6.2.7-1
- Fix CVE-2022-24735 CVE-2022-24736 CVE-2021-29477 CVE-2021-32672
* Mon Dec 06 2021 caodongxia <caodongxia@huawei.com> - 6.0.11-6
- Fix help info
* Mon Nov 29 2021 liwu <liwu13@huawei.com> - 6.0.11-5
- Fix CVE-2021-32687 CVE-2021-32628 CVE-2021-32627
CVE-2021-41099 CVE-2021-32675 CVE-2021-32762
* Thu Nov 04 2021 liwu <liwu13@huawei.com> - 6.0.11-4
- Fix CVE-2021-32626
* Thu Sep 02 2021 lingsheng <lingsheng@huawei.com> - 6.0.11-3
- Fix missing patch in source package
* Mon Mar 29 2021 lingsheng <lingsheng@huawei.com> - 6.0.11-2
- Modify aarch64 architecture jemalloc page size from 4k to 64k
* Sat Mar 20 2021 huanghaitao <huanghaitao8@huawei.com> - 6.0.11-1
- package init
|