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: Mon, 05 Feb 2018 22:19:35
Message-Id: 1517868899.5aecce3e865d586a217132b6d55a6f76b2ef0b9e.robbat2@gentoo
1 commit: 5aecce3e865d586a217132b6d55a6f76b2ef0b9e
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Mon Feb 5 09:18:41 2018 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 5 22:14:59 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5aecce3e
7
8 dev-db/redis: bump to 4.0.8
9
10 Package-Manager: Portage-2.3.22, Repoman-2.3.6
11 (cherry picked from commit 22c376a8936493e27c49ba1260e02c6c203217b8)
12 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
13 Closes: https://github.com/gentoo/gentoo/pull/7081
14
15 dev-db/redis/Manifest | 1 +
16 dev-db/redis/redis-4.0.8.ebuild | 141 ++++++++++++++++++++++++++++++++++++++++
17 2 files changed, 142 insertions(+)
18
19 diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
20 index c7d324f6f3e..59e56aa09ea 100644
21 --- a/dev-db/redis/Manifest
22 +++ b/dev-db/redis/Manifest
23 @@ -5,3 +5,4 @@ DIST redis-4.0.1.tar.gz 1711660 BLAKE2B 0b8881baa78908df4adcc1aabfa0ea9554900f8b
24 DIST redis-4.0.2.tar.gz 1713990 BLAKE2B 307ab76b336f7520e14a23a1577c46e1b63cc5a5a5b6afb725cb87934fbcb62107085671fd1072d1142ce8e92f069e6b6064c9f4468335bc6997897c8f494471 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4
25 DIST redis-4.0.6.tar.gz 1723533 BLAKE2B 94c2a9b7eeaa676efaac75cd5c143b0f4b02440b5a21ecc9b2a68cc27ad4abc1fc4d7dbc903dea5d956ce737ca434ea5b5bdde4a35df3a3689da60c5fb0bddf1 SHA512 784aad612664df666c36f969cb6a9ab794f004abcf9aa761bd1f5f0f8fdb248d5b38f48a59b68c2de7d2a344755f1537efc9d5847de0d662302699ed94d40813
26 DIST redis-4.0.7.tar.gz 1729488 BLAKE2B 7a5337b868e4da4a7387b31bc9d6bd4c86abd701b9ba999f64296ed5188cbba7208ced466973a500730ca03e70a9a85fbab2fb4700fdc977e58defc0126487d1 SHA512 6f317d9e76224b2a2b047dc8f56b126ea85ee5c6112c4c6238cb5cdfa3a83756bff3a82b106b00d1124a93d210a900d836587b8d9563916f19274de0e84c4c6b
27 +DIST redis-4.0.8.tar.gz 1729973 BLAKE2B 32d82a07beba9ea8f0b08a8fc69da548a1974e5839f052a9803ffb0f52ef920df9b128092e061b5e693581a50efef4a1212c1f6310dc8492eff5ca841ff3b03a SHA512 11c126ddef3bedbceb02ee7a80a61374e081da8087055d77970b0097066a6f1c5e0c4f0d246c9851f8c3beca22f185c184669a9dc4f1c7c229f8cd2c34196ab6
28
29 diff --git a/dev-db/redis/redis-4.0.8.ebuild b/dev-db/redis/redis-4.0.8.ebuild
30 new file mode 100644
31 index 00000000000..c7f8131160d
32 --- /dev/null
33 +++ b/dev-db/redis/redis-4.0.8.ebuild
34 @@ -0,0 +1,141 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit autotools eutils flag-o-matic systemd toolchain-funcs user
41 +
42 +DESCRIPTION="A persistent caching system, key-value and data structures database"
43 +HOMEPAGE="http://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-3.2 )"
59 +
60 +DEPEND="
61 + ${RDEPEND}
62 + virtual/pkgconfig
63 + >=sys-devel/autoconf-2.63
64 + test? ( dev-lang/tcl:0= )"
65 +
66 +REQUIRED_USE="?? ( tcmalloc jemalloc )"
67 +
68 +S="${WORKDIR}/${PN}-${PV/_/-}"
69 +
70 +pkg_setup() {
71 + enewgroup redis 75
72 + enewuser redis 75 -1 /var/lib/redis redis
73 +}
74 +
75 +src_prepare() {
76 + eapply \
77 + "${FILESDIR}"/${PN}-3.2.3-config.patch \
78 + "${FILESDIR}"/${PN}-4.0.1-shared.patch \
79 + "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch \
80 + "${FILESDIR}"/${PN}-sentinel-4.0.6-config.patch
81 + eapply_user
82 +
83 + # Copy lua modules into build dir
84 + cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
85 + cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
86 + # Append cflag for lua_cjson
87 + # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
88 + append-cflags "-DENABLE_CJSON_GLOBAL"
89 +
90 + # now we will rewrite present Makefiles
91 + local makefiles="" MKF
92 + for MKF in $(find -name 'Makefile' | cut -b 3-); do
93 + mv "${MKF}" "${MKF}.in"
94 + sed -i -e 's:$(CC):@CC@:g' \
95 + -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
96 + -e 's: $(DEBUG)::g' \
97 + -e 's:$(OBJARCH)::g' \
98 + -e 's:ARCH:TARCH:g' \
99 + -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
100 + "${MKF}.in" \
101 + || die "Sed failed for ${MKF}"
102 + makefiles+=" ${MKF}"
103 + done
104 + # autodetection of compiler and settings; generates the modified Makefiles
105 + cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die
106 +
107 + # Use the correct pkgconfig name for Lua
108 + has_version 'dev-lang/lua:5.1' \
109 + && LUAPKGCONFIG=lua5.1 \
110 + || LUAPKGCONFIG=lua
111 + sed -i \
112 + -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
113 + -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
114 + -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
115 + configure.ac || die "Sed failed for configure.ac"
116 + eautoreconf
117 +}
118 +
119 +src_configure() {
120 + econf \
121 + $(use_with luajit)
122 +
123 + # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
124 + # also, don't define ANSI/c99 for lua twice
125 + sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
126 +}
127 +
128 +src_compile() {
129 + tc-export CC AR RANLIB
130 +
131 + local myconf=""
132 +
133 + if use tcmalloc; then
134 + myconf="${myconf} USE_TCMALLOC=yes"
135 + elif use jemalloc; then
136 + myconf="${myconf} JEMALLOC_SHARED=yes"
137 + else
138 + myconf="${myconf} MALLOC=yes"
139 + fi
140 +
141 + emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
142 +}
143 +
144 +src_install() {
145 + insinto /etc/
146 + doins redis.conf sentinel.conf
147 + use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
148 + fperms 0644 /etc/{redis,sentinel}.conf
149 +
150 + newconfd "${FILESDIR}/redis.confd-r1" redis
151 + newinitd "${FILESDIR}/redis.initd-5" redis
152 +
153 + systemd_newunit "${FILESDIR}/redis.service-2" redis.service
154 + systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
155 +
156 + newconfd "${FILESDIR}/redis-sentinel.confd" redis-sentinel
157 + newinitd "${FILESDIR}/redis-sentinel.initd" redis-sentinel
158 +
159 + insinto /etc/logrotate.d/
160 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
161 +
162 + dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
163 +
164 + dobin src/redis-cli
165 + dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
166 + fperms 0750 /usr/sbin/redis-benchmark
167 + dosym redis-server /usr/sbin/redis-sentinel
168 +
169 + if use prefix; then
170 + diropts -m0750
171 + else
172 + diropts -m0750 -o redis -g redis
173 + fi
174 + keepdir /var/{log,lib}/redis
175 +}