Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > fbbc639d012ba09ebec52078a82524c8 > files > 17

redis-5.0.9-1.mga7.src.rpm

%global _hardened_build 1
%global with_perftools 0

%global with_systemd 1

# Tests fail in mock, not in local build.
%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}

Name:              redis
Version:           5.0.9
Release:           %mkrel 1
Summary:           A persistent key-value database
Group:             Databases
License:           BSD
URL:               http://redis.io
Source0:           http://download.redis.io/releases/%{name}-%{version}.tar.gz
Source1:           %{name}.logrotate
Source2:           %{name}-sentinel.service
Source3:           %{name}.service
Source4:           %{name}.tmpfiles
Source5:           %{name}-sentinel.init
Source6:           %{name}.init
Source7:           %{name}-shutdown
Source8:           %{name}-limit-systemd
Source9:           %{name}-limit-init
Source10:          %{name}.tmpfiles.d
# To refresh patches:
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%{version} baseline"
# git am %{patches}
# Then refresh your patches
# git format-patch HEAD~<number of expected patches>
# Update configuration for Mageia
Patch0001:         0001-redis-3.2.3-redis-conf.patch
Patch0002:         0002-redis-3.2.3-deps-library-fPIC-performance-tuning.patch
Patch0003:         0003-redis-5.0.1-use-system-jemalloc.patch
# tests/integration/replication-psync.tcl failed on slow machines(GITHUB #1417)
Patch0004:         0004-redis-2.8.18-disable-test-failed-on-slow-machine.patch
# Fix sentinel configuration to use a different log file than redis
Patch0005:         0005-redis-2.8.18-sentinel-configuration-file-fix.patch
# https://github.com/antirez/redis/pull/3491 - man pages
Patch0006:         0006-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
# https://github.com/antirez/redis/pull/5745 - symlink
Patch0007:         0007-install-redis-check-rdb-and-redis-check-aof-as-symlinks-to-redis-server.patch
%if 0%{?with_perftools}
BuildRequires:     gperftools-devel
%else
BuildRequires:     pkgconfig(jemalloc)
%endif
%if 0%{?with_tests}
BuildRequires:     procps-ng
%endif
%if 0%{?with_systemd}
BuildRequires:     systemd
%endif
%if 0%{?with_tests}
BuildRequires:     tcl
%endif
BuildRequires:     libatomic-devel
# Required for redis-shutdown
Requires:          logrotate
Requires(pre):     shadow-utils
%if 0%{?with_systemd}
Requires(post):    systemd
Requires(preun):   systemd
Requires(postun):  systemd
%else
Requires(post):    chkconfig
Requires(preun):   chkconfig
Requires(preun):   initscripts
Requires(postun):  initscripts
%endif

%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.

%prep
%autosetup -p1
rm -rfv deps/jemalloc

# 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)|%{ldflags}|g' deps/hiredis/Makefile
sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/linenoise/Makefile
sed -i -e 's|$(LDFLAGS)|%{ldflags}|g' deps/linenoise/Makefile

%build
%make_build \
    DEBUG="" \
    LDFLAGS="%{ldflags}" \
    CFLAGS+="%{optflags}" \
    LUA_LDFLAGS+="%{ldflags}" \
%if 0%{?with_perftools}
    MALLOC=tcmalloc \
%else
    USE_JEMALLOC=yes \
    MALLOC=jemalloc \
%endif
    all

%install
%make_install PREFIX=%{buildroot}%{_prefix}

# Filesystem.
install -d %{buildroot}%{_sharedstatedir}/%{name}
install -d %{buildroot}%{_localstatedir}/log/%{name}

# Install logrotate file.
install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

# Install configuration files.
install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf

# Install Systemd unit files.
%if 0%{?with_systemd}
mkdir -p %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir}
install -pm644 %{S:2} %{buildroot}%{_unitdir}

# Install tmpfiles for legacy configurations.
install -pDm644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
# Install systemd limit files (requires systemd >= 204)
install -p -D -m 644 %{S:8} %{buildroot}%{_unitdir}/%{name}.service.d/limit.conf
install -p -D -m 644 %{S:8} %{buildroot}%{_unitdir}/%{name}-sentinel.service.d/limit.conf
%else # install SysV service files
install -pDm755 %{S:5} %{buildroot}%{_initrddir}/%{name}-sentinel
install -pDm755 %{S:6} %{buildroot}%{_initrddir}/%{name}
install -p -D -m 644 %{S:9} %{buildroot}%{_sysconfdir}/security/limits.d/95-%{name}.conf
%endif

# Fix non-standard-executable-perm error.
chmod 755 %{buildroot}%{_bindir}/%{name}-*

# Install redis-shutdown
install -pDm755 %{S:7} %{buildroot}%{_libexecdir}/%{name}-shutdown

# Install man pages
man=$(dirname %{buildroot}%{_mandir})
for page in man/man?/*; do
    install -Dpm644 $page $man/$page
done
ln -s redis-server.1 %{buildroot}%{_mandir}/man1/redis-sentinel.1
ln -s redis.conf.5   %{buildroot}%{_mandir}/man5/redis-sentinel.conf.5

mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 -D %{SOURCE10} %{buildroot}%{_tmpfilesdir}/redis.conf

%check
%if 0%{?with_tests}
make test ||:
make test-sentinel ||:
%endif

%pre
getent group %{name} &> /dev/null || \
groupadd -r %{name} &> /dev/null
getent passwd %{name} &> /dev/null || \
useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
-c 'Redis Database Server' %{name} &> /dev/null
exit 0

%post
%if 0%{?with_systemd}
%_tmpfilescreate %{name}
%_post_service %{name}
%_post_service %{name}-sentinel
%else
chkconfig --add %{name}
chkconfig --add %{name}-sentinel
%endif

%preun
%if 0%{?with_systemd}
%_preun_service %{name}
%_preun_service %{name}-sentinel
%else
if [ $1 -eq 0 ] ; then
    service %{name} stop &> /dev/null
    chkconfig --del %{name} &> /dev/null
    service %{name}-sentinel stop &> /dev/null
    chkconfig --del %{name}-sentinel &> /dev/null
fi
%endif

%postun
%if 0%{?with_systemd}
%_postun_service %{name}
%_postun_service %{name}-sentinel
%else
if [ "$1" -ge "1" ] ; then
    service %{name} condrestart >/dev/null 2>&1 || :
    service %{name}-sentinel condrestart >/dev/null 2>&1 || :
fi
%endif

%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_tmpfilesdir}/%{name}.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
%{_bindir}/%{name}-*
%{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}*
%{_mandir}/man5/%{name}*
%if 0%{?with_systemd}
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}-sentinel.service
%dir %{_unitdir}/%{name}.service.d
%config(noreplace) %{_unitdir}/%{name}.service.d/limit.conf
%dir %{_unitdir}/%{name}-sentinel.service.d
%config(noreplace) %{_unitdir}/%{name}-sentinel.service.d/limit.conf
%else
%{_initrddir}/%{name}
%{_initrddir}/%{name}-sentinel
%config(noreplace) %{_sysconfdir}/security/limits.d/95-%{name}.conf
%endif




%changelog
* Tue Jul 21 2020 kekepower <kekepower> 5.0.9-1.mga7
+ Revision: 1607737
- Update to version 5.0.9 to fix CVE-2020-14147 (mga#26978)

* Fri May 17 2019 kekepower <kekepower> 5.0.5-1.mga7
+ Revision: 1398141
- Update to version 5.0.5

* Tue Mar 19 2019 kekepower <kekepower> 5.0.4-1.mga7
+ Revision: 1378795
- Update to version 5.0.4
- Updated patch 0007

* Thu Dec 13 2018 kekepower <kekepower> 5.0.3-1.mga7
+ Revision: 1340982
- Update to version 5.0.3

* Fri Nov 23 2018 daviddavid <daviddavid> 5.0.2-1.mga7
+ Revision: 1333496
- new version: 5.0.2

* Mon Nov 19 2018 kekepower <kekepower> 5.0.1-1.mga7
+ Revision: 1332040
- Update to version 5.0.1
- Rediffed and renamed Patch0003

* Sun Sep 23 2018 umeabot <umeabot> 4.0.11-2.mga7
+ Revision: 1300803
- Mageia 7 Mass Rebuild

* Wed Aug 15 2018 daviddavid <daviddavid> 4.0.11-1.mga7
+ Revision: 1251733
- new version: 4.0.11

* Tue Jun 19 2018 daviddavid <daviddavid> 4.0.10-2.mga7
+ Revision: 1238125
- compile with our ldflags (s/%%{?__global_ldflags}/%%{ldflags}/)

* Thu Jun 14 2018 daviddavid <daviddavid> 4.0.10-1.mga7
+ Revision: 1236839
- new version: 4.0.10, fixes CVE-2018-11218 and CVE-2018-11219 (mga#23200)

* Thu Apr 19 2018 daviddavid <daviddavid> 4.0.9-1.mga7
+ Revision: 1220093
- new version: 4.0.9

* Sat Jan 27 2018 kekepower <kekepower> 4.0.7-1.mga7
+ Revision: 1197341
- Update to version 4.0.7 to fix CVE-2017-15047 (mga#22465)

* Sun Oct 08 2017 joequant <joequant> 4.0.2-1.mga7
+ Revision: 1170327
- upgrade to 4.0.2

* Sat May 06 2017 luigiwalser <luigiwalser> 3.2.8-2.mga6
+ Revision: 1099302
- remove hardcoded /bin/awk requires

* Wed May 03 2017 neoclust <neoclust> 3.2.8-1.mga6
+ Revision: 1098956
- Create %%{_tmpfilesdir}/%%name.conf
- New version 3.2.8 - Fixes CVE-2016-8339 (mga#20270)

* Fri Aug 12 2016 luigiwalser <luigiwalser> 3.0.7-7.mga6
+ Revision: 1045984
- add patch from debian to fix CVE-2013-7458

* Wed May 04 2016 daviddavid <daviddavid> 3.0.7-6.mga6
+ Revision: 1009348
- add back systemd mageia's macros

* Wed Apr 27 2016 tv <tv> 3.0.7-5.mga6
+ Revision: 1006997
- fix deps (no file deps!)

* Mon Apr 25 2016 joequant <joequant> 3.0.7-4.mga6
+ Revision: 1006252
- rebuild without systemd limit files
- fix arm build and copy over fedora configs

* Mon Apr 25 2016 joequant <joequant> 3.0.7-2.mga6
+ Revision: 1006194
- rebuild for arm

* Mon Apr 25 2016 joequant <joequant> 3.0.7-1.mga6
+ Revision: 1006139
- update to 3.0.7

* Sat Dec 19 2015 joequant <joequant> 3.0.6-1.mga6
+ Revision: 911864
- remove psync test
- upgrade to 3.0.6

* Fri Dec 11 2015 colin <colin> 3.0.5-2.mga6
+ Revision: 909436
- Add patch for CVE-2015-8080 (integer wraparound DoS mga#17291)

* Fri Dec 11 2015 colin <colin> 3.0.5-1.mga6
+ Revision: 909431
- New version: 3.0.5

* Sun Jun 14 2015 luigiwalser <luigiwalser> 2.8.13-4.mga5
+ Revision: 823147
- add upstream patch to fix CVE-2015-4335

* Wed Oct 15 2014 umeabot <umeabot> 2.8.13-3.mga5
+ Revision: 748467
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 2.8.13-2.mga5
+ Revision: 688640
- Mageia 5 Mass Rebuild

* Sat Aug 30 2014 colin <colin> 2.8.13-1.mga5
+ Revision: 669582
- New version: 2.8.13

* Tue Mar 25 2014 kharec <kharec> 2.8.8-1.mga5
+ Revision: 608689
- New version 2.8.8
- Update patch0 for this version

* Sat Oct 19 2013 umeabot <umeabot> 2.6.5-4.mga4
+ Revision: 522678
- Mageia 4 Mass Rebuild

* Sun Mar 24 2013 colin <colin> 2.6.5-3.mga3
+ Revision: 404859
- Add systemd requires and general post/pre fixes (mga#9302)

* Mon Jan 14 2013 umeabot <umeabot> 2.6.5-2.mga3
+ Revision: 380271
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Wed Nov 28 2012 colin <colin> 2.6.5-1.mga3
+ Revision: 322479
- New version: 2.6.5
- Drop upstream patch
- Drop non-matching test tweaks.
- Drop no-longer working make arguments.
- Tidy install rules
- Tidy tmpfile handling.

* Sun Oct 21 2012 colin <colin> 2.4.17-1.mga3
+ Revision: 308879
- New version: 2.4.17

* Thu Jul 05 2012 colin <colin> 2.4.15-2.mga3
+ Revision: 268267
- Drop sysvinit script
- Use systemd-tmpfiles to create transient directories
- Fix systemd unit to set Type=forking

* Wed Jun 27 2012 colin <colin> 2.4.15-1.mga3
+ Revision: 264398
- Update to 2.4.15
- Do not create the group for redis, it is done automatically when adding the user

* Thu May 10 2012 colin <colin> 2.4.8-4.mga2
+ Revision: 235025
- Revert previous version bump. It was never submitted.
- New version: 2.4.11
- Add LSB headers to initscripts (mga#5262)

* Sat Apr 28 2012 tmb <tmb> 2.4.8-3.mga2
+ Revision: 234125
- extend timeout on replication test (upstream, P1)
- Require rpm-helper >= 0.24.8-1 for systemd support

* Thu Apr 12 2012 guillomovitch <guillomovitch> 2.4.8-2.mga2
+ Revision: 230441
- native systemd service
- fix dependencies

* Fri Feb 24 2012 obgr_seneca <obgr_seneca> 2.4.8-1.mga2
+ Revision: 214180
- new version 2.4.8

* Wed Sep 14 2011 tv <tv> 2.2.8-1.mga2
+ Revision: 143235
- new release

* Sun Apr 17 2011 misc <misc> 2.2.4-1.mga1
+ Revision: 87097
- update to 2.2.4, update patch  for configuration
- use parallel make
- use macros for post scripts

* Sun Apr 10 2011 dmorgan <dmorgan> 2.0.4-3.mga1
+ Revision: 82997
- Fix groups (#682)

* Sat Mar 26 2011 dmorgan <dmorgan> 2.0.4-2.mga1
+ Revision: 77616
- imported package redis