Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/
Date: Tue, 04 May 2021 21:41:48
Message-Id: 1620164494.ef7b16d19bf872152a85bd352741c6816298901a.sam@gentoo
1 commit: ef7b16d19bf872152a85bd352741c6816298901a
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 4 21:34:13 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 21:41:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef7b16d1
7
8 dev-db/redis: add 6.0.13
9
10 Bug: https://bugs.gentoo.org/788211
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-db/redis/Manifest | 1 +
14 dev-db/redis/redis-6.0.13.ebuild | 185 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 186 insertions(+)
16
17 diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
18 index 5a55bebdeb6..ce702a566d2 100644
19 --- a/dev-db/redis/Manifest
20 +++ b/dev-db/redis/Manifest
21 @@ -1,3 +1,4 @@
22 DIST redis-5.0.12.tar.gz 1995069 BLAKE2B 03bb5956fb1206ecfa7f621b22b3101d1ebad62c40ce52157fb802ecfa5c32ca493ff03a1cf909a1b0f1acdac83b3a939ab2042fbf092fea983cabe35d00f4c3 SHA512 f0ab161762006926064ba2176ea63bb2fa416fa386b44ca55a8edad9169627fcd1c4bd9c699fec585aefc68506deb0796f6a89844c21e74d2bdb19ca1638bbe7
23 DIST redis-6.0.12.tar.gz 2276349 BLAKE2B ab49b0278420c65fc995a90e850130971ccaf3df34a08a5cc10a8c211239eba8449b87fe67684189c71816cf259a70a23a77935ec61e8baa787daa61cb994201 SHA512 9dd8e3bed51e1356470e1bf08892f771744c0c9418ff874c16ea932ad1f471a908ffd8479efe1f32531d7f63cd7af5224273ce50f2fe7aa26c47716e0e78330b
24 +DIST redis-6.0.13.tar.gz 2276777 BLAKE2B 735ebc7068b26e7e424e5ce701bb80cfbdf09f65734cbdd5760b75d78141ff542d1a91f2f58f7ef97ea4a1e9e225e96189736384e1dd0c8195e4ca651da75492 SHA512 5053cd60df354c8a00e5864179c6354db6b0243d56717d5dc44954405908ad8b3b09ba9f069312825705dd8abc83d533dd7a5a60485a30e8f4adf166fa058549
25 DIST redis-6.2.1.tar.gz 2438367 BLAKE2B 8717630771eafaf8a15dd371d46475f81f15bbcdc9a4fabd8f270ab6e09fbfb3ee2a1cddddb6c7778922d3552bcf5ee475eec7ba0623147ec36a5c5422cb0de0 SHA512 7c339cc360fc3125bb67c5748bb4fe940977faa937e3a86294829bde472479a811df8ea0ce4961d8128ec8d4ffba5d5a943c2957589c8da0cfc3f109f82e4af6
26
27 diff --git a/dev-db/redis/redis-6.0.13.ebuild b/dev-db/redis/redis-6.0.13.ebuild
28 new file mode 100644
29 index 00000000000..58e7cc8306e
30 --- /dev/null
31 +++ b/dev-db/redis/redis-6.0.13.ebuild
32 @@ -0,0 +1,185 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +# Redis does NOT build with Lua 5.2 or newer at this time:
39 +# - 5.3 and 5.4 give:
40 +# lua_bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in luaconf.h"
41 +# - 5.2 fails with:
42 +# scripting.c:(.text+0x1f9b): undefined reference to `lua_open'
43 +# because lua_open became lua_newstate in 5.2
44 +LUA_COMPAT=( lua5-1 luajit )
45 +
46 +inherit autotools flag-o-matic lua-single systemd toolchain-funcs tmpfiles
47 +
48 +DESCRIPTION="A persistent caching system, key-value and data structures database"
49 +HOMEPAGE="https://redis.io"
50 +SRC_URI="https://download.redis.io/releases/${P}.tar.gz"
51 +
52 +LICENSE="BSD"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
54 +IUSE="+jemalloc ssl systemd tcmalloc test"
55 +RESTRICT="!test? ( test )"
56 +SLOT="0"
57 +
58 +COMMON_DEPEND="
59 + ${LUA_DEPS}
60 + jemalloc? ( >=dev-libs/jemalloc-5.1:= )
61 + ssl? ( dev-libs/openssl:0= )
62 + systemd? ( sys-apps/systemd:= )
63 + tcmalloc? ( dev-util/google-perftools )
64 +"
65 +
66 +RDEPEND="
67 + ${COMMON_DEPEND}
68 + acct-group/redis
69 + acct-user/redis
70 +"
71 +
72 +BDEPEND="
73 + ${COMMON_DEPEND}
74 + virtual/pkgconfig
75 +"
76 +
77 +# Tcl is only needed in the CHOST test env
78 +DEPEND="
79 + ${COMMON_DEPEND}
80 + test? (
81 + dev-lang/tcl:0=
82 + ssl? ( dev-tcltk/tls )
83 + )"
84 +
85 +REQUIRED_USE="?? ( jemalloc tcmalloc )
86 + ${LUA_REQUIRED_USE}"
87 +
88 +PATCHES=(
89 + "${FILESDIR}"/${PN}-3.2.3-config.patch
90 + "${FILESDIR}"/${PN}-5.0-shared.patch
91 + "${FILESDIR}"/${PN}-6.0.12-sharedlua.patch
92 + "${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch
93 + "${FILESDIR}"/${PN}-sentinel-5.0-config.patch
94 +)
95 +
96 +src_prepare() {
97 + default
98 +
99 + # unstable on jemalloc
100 + > tests/unit/memefficiency.tcl || die
101 +
102 + # Copy lua modules into build dir
103 + cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
104 + cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
105 + # Append cflag for lua_cjson
106 + # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
107 + append-cflags "-DENABLE_CJSON_GLOBAL"
108 +
109 + # now we will rewrite present Makefiles
110 + local makefiles="" MKF
111 + for MKF in $(find -name 'Makefile' | cut -b 3-); do
112 + mv "${MKF}" "${MKF}.in"
113 + sed -i -e 's:$(CC):@CC@:g' \
114 + -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
115 + -e 's: $(DEBUG)::g' \
116 + -e 's:$(OBJARCH)::g' \
117 + -e 's:ARCH:TARCH:g' \
118 + -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
119 + "${MKF}.in" \
120 + || die "Sed failed for ${MKF}"
121 + makefiles+=" ${MKF}"
122 + done
123 + # autodetection of compiler and settings; generates the modified Makefiles
124 + cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die
125 +
126 + # Use the correct pkgconfig name for Lua.
127 + # The upstream configure script handles luajit specially, and is not
128 + # effected by these changes.
129 + sed -i \
130 + -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
131 + -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
132 + -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${ELUA},g" \
133 + configure.ac || die "Sed failed for configure.ac"
134 + eautoreconf
135 +}
136 +
137 +src_configure() {
138 + econf $(use_with lua_single_target_luajit luajit)
139 +
140 + # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
141 + # also, don't define ANSI/c99 for lua twice
142 + sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
143 +}
144 +
145 +src_compile() {
146 + local myconf=""
147 +
148 + if use jemalloc; then
149 + myconf+="MALLOC=jemalloc"
150 + elif use tcmalloc; then
151 + myconf+="MALLOC=tcmalloc"
152 + else
153 + myconf+="MALLOC=libc"
154 + fi
155 +
156 + if use ssl; then
157 + myconf+=" BUILD_TLS=yes"
158 + fi
159 +
160 + tc-export AR CC RANLIB
161 + emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
162 +}
163 +
164 +src_test() {
165 + # Known to fail with FEATURES=usersandbox
166 + if has usersandbox ${FEATURES}; then
167 + ewarn "You are emerging ${P} with 'usersandbox' enabled." \
168 + "Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
169 + fi
170 +
171 + if use ssl; then
172 + ./utils/gen-test-certs.sh
173 + ./runtest --tls
174 + else
175 + ./runtest
176 + fi
177 +}
178 +
179 +src_install() {
180 + insinto /etc/redis
181 + doins redis.conf sentinel.conf
182 + use prefix || fowners -R redis:redis /etc/redis /etc/redis/{redis,sentinel}.conf
183 + fperms 0750 /etc/redis
184 + fperms 0644 /etc/redis/{redis,sentinel}.conf
185 +
186 + newconfd "${FILESDIR}/redis.confd-r2" redis
187 + newinitd "${FILESDIR}/redis.initd-6" redis
188 +
189 + systemd_newunit "${FILESDIR}/redis.service-4" redis.service
190 + newtmpfiles "${FILESDIR}/redis.tmpfiles-2" redis.conf
191 +
192 + newconfd "${FILESDIR}/redis-sentinel.confd-r1" redis-sentinel
193 + newinitd "${FILESDIR}/redis-sentinel.initd-r1" redis-sentinel
194 +
195 + insinto /etc/logrotate.d/
196 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
197 +
198 + dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
199 +
200 + dobin src/redis-cli
201 + dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
202 + fperms 0750 /usr/sbin/redis-benchmark
203 + dosym redis-server /usr/sbin/redis-sentinel
204 +
205 + if use prefix; then
206 + diropts -m0750
207 + else
208 + diropts -m0750 -o redis -g redis
209 + fi
210 + keepdir /var/{log,lib}/redis
211 +}
212 +
213 +pkg_postinst() {
214 + ewarn "The default redis configuration file location changed to:"
215 + ewarn " /etc/redis/{redis,sentinel}.conf"
216 + ewarn "Please apply your changes to the new configuration files."
217 +}