Gentoo Archives: gentoo-commits

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