123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- %bcond_with systemd
- # Check for status of man pages
- # http://code.google.com/p/redis/issues/detail?id=202
- # Commit IDs for the (unversioned) redis-doc repository
- # https://fedoraproject.org/wiki/Packaging:SourceURL "Commit Revision"
- #global doc_commit 4f1da37c03daa943f2cf3cd5fda8dbd1bf1f22d7
- %global doc_commit dd4aa508d3fbdf065c48258e86a73ed559987f38
- %global short_doc_commit %(c=%{doc_commit}; echo ${c:0:7})
- # %%{rpmmacrodir} not usable on EL-6
- %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
- %ifarch %{ix86} x86_64 ppc
- # available only on selected architectures
- %global with_perftools 1
- %endif
- Name: redis
- Version: 7.0.4
- Release: 1%{?_dist_release}%{?with_systemd:.systemd}
- Summary: A persistent in-memory key-value database
- Summary(ja): 永続化可能なキー・バリュー型インメモリデータベース
- Group: servers
- Vendor: Project Vine
- Distribution: Vine Linux
- Packager: daisuke
- License: BSD
- URL: https://redis.io
- Source0: https://github.com/redis-io/redis/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
- Source1: %{name}.logrotate
- Source2: %{name}-sentinel.service
- Source3: %{name}.service
- Source4: %{name}-sentinel.init
- Source5: %{name}.init
- Source6: %{name}-shutdown
- Source7: %{name}-limit-systemd
- Source8: %{name}-limit-init
- Source9: macros.%{name}
- Source10: https://github.com/redis/%{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}
- # Then refresh your patches
- # git format-patch HEAD~<number of expected patches>
- # Update configuration for Fedora
- # https://github.com/antirez/redis/pull/3491 - man pages
- Patch0001: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
- BuildRoot: %{_tmppath}/%{name}-%{version}-root
- BuildRequires: jemalloc-devel
- BuildRequires: openssl-devel
- %if %{?with_perftools}
- BuildRequires: gperftools-devel
- %endif
- %if %{with systemd}
- BuildRequires: systemd-devel
- %endif
- Requires: logrotate
- %if %{with systemd}
- BuildRequires: systemd
- Requires(post): systemd
- Requires(preun): systemd
- Requires(postun): systemd
- %else
- Requires(post): chkconfig
- Requires(postun): initscripts
- Requires(preun): chkconfig
- Requires(preun): initscripts
- %endif
- Requires(pre): shadow-utils
- %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 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. 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.
- %package devel
- Summary: Development header for Redis module development
- Group: programming
- # 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
- Group: documentation
- 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.
- %debug_package
- %prep
- %setup -q -b 10
- %setup -q
- mv ../%{name}-doc-%{doc_commit} doc
- %patch0001 -p1
- mv deps/lua/COPYRIGHT COPYRIGHT-lua
- mv deps/hiredis/COPYING COPYING-hiredis
- # 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
- sed -i -e 's|^daemonize no$|daemonize yes|g' redis.conf
- sed -i -e 's|^protected-mode no$|protected-mode yes|g' redis.conf
- sed -i -e 's|^# bind 127\.0\.0\.1$|bind 127.0.0.1|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
- %global make_flags DEBUG="" V="echo" LDFLAGS="%{?__global_ldflags}" CFLAGS+="%{optflags} -fPIC" INSTALL="install -p" PREFIX=%{buildroot}%{_prefix} BUILD_TLS=yes %{?with_systemd:BUILD_WITH_SYSTEMD=yes}
- %build
- make %{?_smp_mflags} %{make_flags} all
- %install
- make %{make_flags} install
- # Filesystem.
- 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}
- # Install configuration files.
- mkdir -p %{buildroot}%{_sysconfdir}/%{name}
- install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
- install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}-sentinel.conf
- %if %{with systemd}
- # Install systemd unit files.
- mkdir -p %{buildroot}%{_unitdir}
- install -pm644 %{S:3} %{buildroot}%{_unitdir}
- install -pm644 %{S:2} %{buildroot}%{_unitdir}
- # Install systemd limit files (requires systemd >= 204)
- install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
- install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
- %else
- mkdir -p %{buildroot}%{_initdir}
- install -pm755 %{S:4} %{buildroot}%{_initdir}/%{name}-sentinel
- install -pm755 %{S:5} %{buildroot}%{_initdir}/%{name}
- install -pm755 %{S:8} %{buildroot}%{_initdir}/%{name}-limit
- %endif
- # Fix non-standard-executable-perm error.
- 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
- # 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
- # Install documentation and html pages
- doc=$(echo %{buildroot}/%{_docdir}/%{name})
- for page in 00-RELEASENOTES BUGS CONTRIBUTING.md 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
- # Install rpm macros for redis modules
- mkdir -p %{buildroot}%{macrosdir}
- install -pDm644 %{S:9} %{buildroot}%{macrosdir}/macros.%{name}
- %check
- # make test
- %post
- %if %{with systemd}
- %systemd_post %{name}.service
- %systemd_post %{name}-sentinel.service
- %else
- if [ $1 -eq 1 ]; then
- /sbin/chkconfig --add %{name}
- /sbin/chkconfig --add %{name}-sentinel
- fi
- %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
- %preun
- %if %{with systemd}
- %systemd_preun %{name}.service
- %systemd_preun %{name}-sentinel.service
- %else
- if [ $1 -eq 0 -o -x /sbin/systemctl ]; then
- /sbin/service %{name} stop ||:
- /sbin/service %{name}-sentinel stop ||:
- /sbin/chkconfig --del %{name}
- /sbin/chkconfig --del %{name}-sentinel
- fi
- %endif
- %postun
- %if %{with systemd}
- %systemd_postun_with_restart %{name}.service
- %systemd_postun_with_restart %{name}-sentinel.service
- %else
- if [ $1 -gt 0 ]; then
- if [ -x /sbin/systemctl ]; then
- /sbin/service %{name} stop ||:
- else
- /sbin/service %{name} condrestart ||:
- fi
- fi
- %endif
- %files
- %{!?_licensedir:%global license %%doc}
- %license COPYING
- %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
- %dir %{_sysconfdir}/%{name}
- %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
- %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}-sentinel.conf
- %dir %attr(0750, redis, redis) %{_libdir}/%{name}
- %dir %attr(0750, redis, redis) %{redis_modules_dir}
- %dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
- %dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
- %exclude %{macrosdir}
- %exclude %{_includedir}
- %exclude %{_docdir}/%{name}/*
- %{_bindir}/%{name}-*
- %{_libexecdir}/%{name}-*
- %{_mandir}/man1/%{name}*
- %{_mandir}/man5/%{name}*
- %if %{with systemd}
- %{_unitdir}/%{name}.service
- %{_unitdir}/%{name}-sentinel.service
- %dir %{_sysconfdir}/systemd/system/%{name}.service.d
- %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
- %dir %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d
- %config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
- %else
- %{_initdir}/*
- %endif
- %dir %attr(0755, redis, redis) %{_localstatedir}/run/%{name}
- %files devel
- %license COPYING
- %license COPYRIGHT-lua
- %license COPYING-hiredis
- %{_includedir}/%{name}module.h
- %{macrosdir}/*
- %files doc
- %docdir %{_docdir}/%{name}
- %{_docdir}/%{name}
- %changelog
- * Tue Jul 19 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.4-1
- - new upstream release.
- * Tue Jul 12 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.3-1
- - new upstream release.
- * Sun Jun 12 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.2-1
- - new upstream release.
- * Thu Jun 09 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
- - new upstream release.
- * Thu Apr 28 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
- - new upstream release.
- * Mon Oct 04 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.6-1
- - new upstream release.
- - enabled OpenSSL.
- - fixed systemd build.
- * Sat Jul 31 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.5-1
- - new upstream release.
- * Tue Jun 15 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.4-1
- - new upstream release.
- * Tue May 18 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.3-1
- - new upstream release.
- * Tue Mar 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.1-1
- - new upstream release.
- - dropped Patch0002: fixed in upstream.
- * Sat Dec 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.0.9-1
- - new upstream release.
- * Thu Jul 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.0.5-1
- - new upstream release.
- * Fri Apr 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.8-1
- - new upstream release.
- * Sun Sep 08 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.5-1
- - new upstream release.
- * Mon Mar 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.10-1
- - update to 2.6.10
- * Sat Oct 27 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.15-1
- - initial build for Vine Linux
- * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.15-3
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
- * Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-2
- - Remove TODO from docs
- * Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-1
- - Update to redis 2.4.15
- * Sat May 19 2012 Silas Sewell <silas@sewell.org> - 2.4.13-1
- - Update to redis 2.4.13
- * Sat Mar 31 2012 Silas Sewell <silas@sewell.org> - 2.4.10-1
- - Update to redis 2.4.10
- * Fri Feb 24 2012 Silas Sewell <silas@sewell.org> - 2.4.8-1
- - Update to redis 2.4.8
- * Sat Feb 04 2012 Silas Sewell <silas@sewell.org> - 2.4.7-1
- - Update to redis 2.4.7
- * Wed Feb 01 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-4
- - Fixed a typo in the spec
- * Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-3
- - Fix .service file, to match config (Type=simple).
- * Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-2
- - Fix .service file, credits go to Timon.
- * Thu Jan 12 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-1
- - Update to 2.4.6
- - systemd unit file added
- - Compiler flags changed to compile 2.4.6
- - Remove doc/ and Changelog
- * Sun Jul 24 2011 Silas Sewell <silas@sewell.org> - 2.2.12-1
- - Update to redis 2.2.12
- * Fri May 06 2011 Dan Horák <dan[at]danny.cz> - 2.2.5-2
- - google-perftools exists only on selected architectures
- * Sat Apr 23 2011 Silas Sewell <silas@sewell.ch> - 2.2.5-1
- - Update to redis 2.2.5
- * Sat Mar 26 2011 Silas Sewell <silas@sewell.ch> - 2.2.2-1
- - Update to redis 2.2.2
- * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-2
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
- * Sun Dec 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.4-1
- - Update to redis 2.0.4
- * Tue Oct 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.3-1
- - Update to redis 2.0.3
- * Fri Oct 08 2010 Silas Sewell <silas@sewell.ch> - 2.0.2-1
- - Update to redis 2.0.2
- - Disable checks section for el5
- * Sat Sep 11 2010 Silas Sewell <silas@sewell.ch> - 2.0.1-1
- - Update to redis 2.0.1
- * Sat Sep 04 2010 Silas Sewell <silas@sewell.ch> - 2.0.0-1
- - Update to redis 2.0.0
- * Thu Sep 02 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-3
- - Add Fedora build flags
- - Send all scriplet output to /dev/null
- - Remove debugging flags
- - Add redis.conf check to init script
- * Mon Aug 16 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-2
- - Don't compress man pages
- - Use patch to fix redis.conf
- * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-1
- - Initial package
|