Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/
Date: Thu, 18 Apr 2019 05:12:04
Message-Id: 1555564233.8d13801c896378a125269f8d996082abcedae448.robbat2@gentoo
1 commit: 8d13801c896378a125269f8d996082abcedae448
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Mar 22 06:02:03 2019 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 18 05:10:33 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d13801c
7
8 dev-db/redis: bump to 5.0.4
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/11456
13 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
14
15 dev-db/redis/Manifest | 1 +
16 dev-db/redis/redis-5.0.4.ebuild | 140 ++++++++++++++++++++++++++++++++++++++++
17 2 files changed, 141 insertions(+)
18
19 diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
20 index d3fcf0e33fc..3c5420a9b64 100644
21 --- a/dev-db/redis/Manifest
22 +++ b/dev-db/redis/Manifest
23 @@ -5,3 +5,4 @@ DIST redis-4.0.13.tar.gz 1740715 BLAKE2B 73d129906b2a2ceb91d1144f8c8aeb970221f7e
24 DIST redis-4.0.14.tar.gz 1740967 BLAKE2B d9122565ba890416d8936db936bc1410af840cc7617b485b94428891806d5889f5f02c2e722a7e68fe6c0b2690c1ef3479cc8837c55fb154f2b43af9986647a4 SHA512 7730a4083962046f8fee674a8ce95e1d3e8c8dcc2d64a65491dc3b851413b2d745942be7a94ee77074aa530da5f3d458c4e7388d7950a8495d8ee9f4862b7e06
25 DIST redis-4.0.2.tar.gz 1713990 BLAKE2B 307ab76b336f7520e14a23a1577c46e1b63cc5a5a5b6afb725cb87934fbcb62107085671fd1072d1142ce8e92f069e6b6064c9f4468335bc6997897c8f494471 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4
26 DIST redis-5.0.3.tar.gz 1959445 BLAKE2B d1c3247d77aa3b1076d0e1a0dcce74dcfb14a0ad3776603ef8154d7868f9f3efcf2138cb08581eee1974e9d76658d07456d6e9795391321b1f1f8bca7f9d40f5 SHA512 5915b14502438bf7c3f56e38640dda54b095bd87501aefa6e386c9cef48e8d1e625e980643d128d91b8cab26dd51d5d99ca66fa638dc04e5ba315fe43f11f58b
27 +DIST redis-5.0.4.tar.gz 1966337 BLAKE2B 9195e970d7c987c2540da3a89f4fc33620f6a45ed243fa24715fe20f174d5e569e5ff940834176b3f26b13d9cca95f1d2914d65ad71f295787553c6bb8552089 SHA512 336929c81a476e2a23a64f867823d70c3aab66fb0098eef2e61630be6522ff2f6af680169ffcae35d559758b2c6b56f88c5a953a538291fea886449cba33b8ad
28
29 diff --git a/dev-db/redis/redis-5.0.4.ebuild b/dev-db/redis/redis-5.0.4.ebuild
30 new file mode 100644
31 index 00000000000..ec8944b4940
32 --- /dev/null
33 +++ b/dev-db/redis/redis-5.0.4.ebuild
34 @@ -0,0 +1,140 @@
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +inherit autotools flag-o-matic systemd toolchain-funcs user
41 +
42 +DESCRIPTION="A persistent caching system, key-value and data structures database"
43 +HOMEPAGE="https://redis.io"
44 +SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
45 +
46 +LICENSE="BSD"
47 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
48 +IUSE="+jemalloc tcmalloc luajit test"
49 +SLOT="0"
50 +
51 +# Redis does NOT build with Lua 5.2 or newer at this time.
52 +# This should link correctly with both unslotted & slotted Lua, without
53 +# changes.
54 +RDEPEND="
55 + luajit? ( dev-lang/luajit:2 )
56 + !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
57 + tcmalloc? ( dev-util/google-perftools )
58 + jemalloc? ( >=dev-libs/jemalloc-5.1:= )"
59 +
60 +DEPEND="
61 + ${RDEPEND}
62 + test? ( dev-lang/tcl:0= )"
63 +
64 +BDEPEND="
65 + virtual/pkgconfig"
66 +
67 +REQUIRED_USE="?? ( tcmalloc jemalloc )"
68 +
69 +pkg_setup() {
70 + enewgroup redis 75
71 + enewuser redis 75 -1 /var/lib/redis redis
72 +}
73 +
74 +src_prepare() {
75 + eapply \
76 + "${FILESDIR}"/${PN}-3.2.3-config.patch \
77 + "${FILESDIR}"/${PN}-5.0-shared.patch \
78 + "${FILESDIR}"/${PN}-5.0-sharedlua.patch \
79 + "${FILESDIR}"/${PN}-sentinel-5.0-config.patch
80 + eapply_user
81 +
82 + # Copy lua modules into build dir
83 + cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
84 + cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
85 + # Append cflag for lua_cjson
86 + # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
87 + append-cflags "-DENABLE_CJSON_GLOBAL"
88 +
89 + # now we will rewrite present Makefiles
90 + local makefiles="" MKF
91 + for MKF in $(find -name 'Makefile' | cut -b 3-); do
92 + mv "${MKF}" "${MKF}.in"
93 + sed -i -e 's:$(CC):@CC@:g' \
94 + -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
95 + -e 's: $(DEBUG)::g' \
96 + -e 's:$(OBJARCH)::g' \
97 + -e 's:ARCH:TARCH:g' \
98 + -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
99 + "${MKF}.in" \
100 + || die "Sed failed for ${MKF}"
101 + makefiles+=" ${MKF}"
102 + done
103 + # autodetection of compiler and settings; generates the modified Makefiles
104 + cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die
105 +
106 + # Use the correct pkgconfig name for Lua
107 + has_version 'dev-lang/lua:5.1' \
108 + && LUAPKGCONFIG=lua5.1 \
109 + || LUAPKGCONFIG=lua
110 + sed -i \
111 + -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
112 + -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
113 + -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
114 + configure.ac || die "Sed failed for configure.ac"
115 + eautoreconf
116 +}
117 +
118 +src_configure() {
119 + econf \
120 + $(use_with luajit)
121 +
122 + # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
123 + # also, don't define ANSI/c99 for lua twice
124 + sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
125 +}
126 +
127 +src_compile() {
128 + tc-export CC AR RANLIB
129 +
130 + local myconf=""
131 +
132 + if use tcmalloc; then
133 + myconf="${myconf} USE_TCMALLOC=yes"
134 + elif use jemalloc; then
135 + myconf="${myconf} JEMALLOC_SHARED=yes"
136 + else
137 + myconf="${myconf} MALLOC=yes"
138 + fi
139 +
140 + emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
141 +}
142 +
143 +src_install() {
144 + insinto /etc/
145 + doins redis.conf sentinel.conf
146 + use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
147 + fperms 0644 /etc/{redis,sentinel}.conf
148 +
149 + newconfd "${FILESDIR}/redis.confd-r1" redis
150 + newinitd "${FILESDIR}/redis.initd-5" redis
151 +
152 + systemd_newunit "${FILESDIR}/redis.service-3" redis.service
153 + systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles-2" redis.conf
154 +
155 + newconfd "${FILESDIR}/redis-sentinel.confd" redis-sentinel
156 + newinitd "${FILESDIR}/redis-sentinel.initd" redis-sentinel
157 +
158 + insinto /etc/logrotate.d/
159 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
160 +
161 + dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
162 +
163 + dobin src/redis-cli
164 + dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
165 + fperms 0750 /usr/sbin/redis-benchmark
166 + dosym redis-server /usr/sbin/redis-sentinel
167 +
168 + if use prefix; then
169 + diropts -m0750
170 + else
171 + diropts -m0750 -o redis -g redis
172 + fi
173 + keepdir /var/{log,lib}/redis
174 +}