1 |
commit: cc34d8257d01cf57f9b1f41201a124eab61fefdf |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 4 21:53:25 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 4 21:53:25 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc34d825 |
7 |
|
8 |
dev-db/redis: add 6.2.6 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/816282 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
dev-db/redis/Manifest | 1 + |
14 |
dev-db/redis/redis-6.2.6.ebuild | 189 ++++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 190 insertions(+) |
16 |
|
17 |
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest |
18 |
index cf3958a3d0e..c5282e8ff2d 100644 |
19 |
--- a/dev-db/redis/Manifest |
20 |
+++ b/dev-db/redis/Manifest |
21 |
@@ -3,3 +3,4 @@ DIST redis-5.0.14.tar.gz 2000179 BLAKE2B 77d3ed09a81450dbf806edd017785b82c50bb05 |
22 |
DIST redis-6.0.15.tar.gz 2282471 BLAKE2B b7f37a76d2a16e0f84f51a737e2c23ebc27750ece790cf800a0f70bfd481db01d82dc68511f80e5935dc73d70f02716a4f9005d4d177ecf3f2a0c5290ecd41ff SHA512 e7ba123798a11e1c68dd6d3ebb0586bed4f2bb33755871f1577f7e0229f826b468c2130c31bcc85a64ce7ff54e280df0a7c60e0882f3ed2a11d43e7819fe8b9e |
23 |
DIST redis-6.0.16.tar.gz 2288647 BLAKE2B f3552cc0d27cbc5cf6556792da9a75d01ff70d372484c95d2af8b24ec902a8086b9c3f4e53513df982fe135963432bfb527334926dd494e50d2cc618ab813f39 SHA512 83bb72448f9943e3d015cb4d961eb2eae21602ef1f90ca52ca8ab7c6918b0ab979db9f61f3981df27b2286894f4864f4588c3a52fa988e30e9419b0967998845 |
24 |
DIST redis-6.2.5.tar.gz 2465302 BLAKE2B 51cc672ab432bb87560151521289d04e8fefb8e4df820f58a9b742131a0f1960c0019dec42a601bad827ec2a172375b88b6cf32a19aef42964e18f5a7a911c40 SHA512 8c54451032cbb627ec2827251556cba2010e56544baca7ea117b5afd2c2add484acbedd3baf21bdb8fd10672602cf52294a4e26b135c1406d7a723c048275e3a |
25 |
+DIST redis-6.2.6.tar.gz 2476542 BLAKE2B d139479432171294911d99e7e8c2327dbbc6682ea49de761c4bb4089a2efd814926f2f8823dca1826b4a61dd9ccf79abb22878c9463ac92870481b43d8a7fff7 SHA512 9b947d26fd9e208627ed22d318ab3d0775ab0be46d98db1c1d158feac671b984e75ce33e647d196face9643f80768af47e678be1b4e1ddd3eb56dff467c46022 |
26 |
|
27 |
diff --git a/dev-db/redis/redis-6.2.6.ebuild b/dev-db/redis/redis-6.2.6.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..ebcfae4210f |
30 |
--- /dev/null |
31 |
+++ b/dev-db/redis/redis-6.2.6.ebuild |
32 |
@@ -0,0 +1,189 @@ |
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 ~riscv ~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}-6.2.1-config.patch |
90 |
+ "${FILESDIR}"/${PN}-5.0-shared.patch |
91 |
+ "${FILESDIR}"/${PN}-6.2.1-sharedlua.patch |
92 |
+ "${FILESDIR}"/${PN}-6.2.3-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 |
+ export USE_SYSTEMD=$(usex systemd) |
161 |
+ |
162 |
+ tc-export AR CC RANLIB |
163 |
+ emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}" |
164 |
+} |
165 |
+ |
166 |
+src_test() { |
167 |
+ # Known to fail with FEATURES=usersandbox |
168 |
+ if has usersandbox ${FEATURES}; then |
169 |
+ ewarn "You are emerging ${P} with 'usersandbox' enabled." \ |
170 |
+ "Expect some test failures or emerge with 'FEATURES=-usersandbox'!" |
171 |
+ fi |
172 |
+ |
173 |
+ if use ssl; then |
174 |
+ ./utils/gen-test-certs.sh |
175 |
+ ./runtest --tls |
176 |
+ else |
177 |
+ ./runtest |
178 |
+ fi |
179 |
+} |
180 |
+ |
181 |
+src_install() { |
182 |
+ insinto /etc/redis |
183 |
+ doins redis.conf sentinel.conf |
184 |
+ use prefix || fowners -R redis:redis /etc/redis /etc/redis/{redis,sentinel}.conf |
185 |
+ fperms 0750 /etc/redis |
186 |
+ fperms 0644 /etc/redis/{redis,sentinel}.conf |
187 |
+ |
188 |
+ newconfd "${FILESDIR}/redis.confd-r2" redis |
189 |
+ newinitd "${FILESDIR}/redis.initd-6" redis |
190 |
+ |
191 |
+ systemd_newunit "${FILESDIR}/redis.service-4" redis.service |
192 |
+ newtmpfiles "${FILESDIR}/redis.tmpfiles-2" redis.conf |
193 |
+ |
194 |
+ newconfd "${FILESDIR}/redis-sentinel.confd-r1" redis-sentinel |
195 |
+ newinitd "${FILESDIR}/redis-sentinel.initd-r1" redis-sentinel |
196 |
+ |
197 |
+ insinto /etc/logrotate.d/ |
198 |
+ newins "${FILESDIR}/${PN}.logrotate" ${PN} |
199 |
+ |
200 |
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md |
201 |
+ |
202 |
+ dobin src/redis-cli |
203 |
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb |
204 |
+ fperms 0750 /usr/sbin/redis-benchmark |
205 |
+ dosym redis-server /usr/sbin/redis-sentinel |
206 |
+ |
207 |
+ if use prefix; then |
208 |
+ diropts -m0750 |
209 |
+ else |
210 |
+ diropts -m0750 -o redis -g redis |
211 |
+ fi |
212 |
+ keepdir /var/{log,lib}/redis |
213 |
+} |
214 |
+ |
215 |
+pkg_postinst() { |
216 |
+ tmpfiles_process redis.conf |
217 |
+ |
218 |
+ ewarn "The default redis configuration file location changed to:" |
219 |
+ ewarn " /etc/redis/{redis,sentinel}.conf" |
220 |
+ ewarn "Please apply your changes to the new configuration files." |
221 |
+} |