Skip to content

Commit

Permalink
dev-db/redis: bump to 4.0.12
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Tomáš Mózes <[email protected]>
(cherry picked from commit d3b89cd)
Signed-off-by: Robin H. Johnson <[email protected]>
Closes: gentoo#10482
  • Loading branch information
hydrapolic authored and robbat2 committed Dec 15, 2018
1 parent 365e450 commit b2a56b6
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-db/redis/Manifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DIST redis-4.0.10.tar.gz 1738465 BLAKE2B 572cbb3d2d5d7209f81ebd53ee68f40b404d0e4623bd1864845bf1f47135d4e097a6974d346ffd845d848c39ace6d3fb9f1a347e0c9d16d06d22aed7a8b3ae7b SHA512 0978dabaf637e61889d492fd3629acd58ca8fb0c0088cdd7036ffd1a7ed3f018c107039d4c96bd61d0b7d35757df2366d051f57d77ffb5642aca0e5651b30603
DIST redis-4.0.11.tar.gz 1739656 BLAKE2B d94f380ad1600e58942cc5b27b512984396cdbb06ea6e947c7d7ce5b8ecdb8a2a56c6356af2caa82a96887a610716c9575b78eb2f46da89efb940febc1c30f22 SHA512 f0054af9ca2143731a397b2b21285387707b7f40d9326ba15225feb1a2ff470fab5194308342f63bbe1081f84c7e9ef19543c5a8e3eae49e17bfc515c64201f0
DIST redis-4.0.12.tar.gz 1740544 BLAKE2B 620dba8b81fc76a46880c3a4a7ee9d9835e7b19e6d321598a717892f6f03fa805db79847442744a2af8f77ae403b6e1df02299da9a0835f6092a74e3804dde48 SHA512 d19020f7ebed9ad5d04c6e1cb7e2a49dd1e226fe17d86e860df11bcb798c61c09f6f9fc3572a7ee32232ac34ec5eb1d6189f8139b5991bd87297c5243c3b54d2
DIST redis-4.0.2.tar.gz 1713990 BLAKE2B 307ab76b336f7520e14a23a1577c46e1b63cc5a5a5b6afb725cb87934fbcb62107085671fd1072d1142ce8e92f069e6b6064c9f4468335bc6997897c8f494471 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4
DIST redis-5.0.1.tar.gz 1951542 BLAKE2B 6081acf2ed6af5a5790ad3164fa0008f934360c8b2b88794a60593dd954a0104b38b826f3de92add609b803c87c80266d1494c47e879c797525bb4a6f1a095fc SHA512 eb0f10903a8e87c0ca33597060b611a11c42576c64dd6d648b59cd9007d4ee6fe7c3762daf428c2d19ab05576a4b44dc3663fe1267c60acca58eeb2bba709e58
141 changes: 141 additions & 0 deletions dev-db/redis/redis-4.0.12.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit autotools eutils flag-o-matic systemd toolchain-funcs user

DESCRIPTION="A persistent caching system, key-value and data structures database"
HOMEPAGE="https://redis.io"
SRC_URI="http://download.redis.io/releases/${P}.tar.gz"

LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
IUSE="+jemalloc tcmalloc luajit test"
SLOT="0"

# Redis does NOT build with Lua 5.2 or newer at this time.
# This should link correctly with both unslotted & slotted Lua, without
# changes.
RDEPEND="
luajit? ( dev-lang/luajit:2 )
!luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
tcmalloc? ( dev-util/google-perftools )
jemalloc? ( >=dev-libs/jemalloc-3.2 )"

DEPEND="
${RDEPEND}
virtual/pkgconfig
>=sys-devel/autoconf-2.63
test? ( dev-lang/tcl:0= )"

REQUIRED_USE="?? ( tcmalloc jemalloc )"

S="${WORKDIR}/${PN}-${PV/_/-}"

pkg_setup() {
enewgroup redis 75
enewuser redis 75 -1 /var/lib/redis redis
}

src_prepare() {
eapply \
"${FILESDIR}"/${PN}-3.2.3-config.patch \
"${FILESDIR}"/${PN}-4.0.1-shared.patch \
"${FILESDIR}"/${PN}-4.0.1-sharedlua.patch \
"${FILESDIR}"/${PN}-sentinel-4.0.6-config.patch
eapply_user

# Copy lua modules into build dir
cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
# Append cflag for lua_cjson
# https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
append-cflags "-DENABLE_CJSON_GLOBAL"

# now we will rewrite present Makefiles
local makefiles="" MKF
for MKF in $(find -name 'Makefile' | cut -b 3-); do
mv "${MKF}" "${MKF}.in"
sed -i -e 's:$(CC):@CC@:g' \
-e 's:$(CFLAGS):@AM_CFLAGS@:g' \
-e 's: $(DEBUG)::g' \
-e 's:$(OBJARCH)::g' \
-e 's:ARCH:TARCH:g' \
-e '/^CCOPT=/s:$: $(LDFLAGS):g' \
"${MKF}.in" \
|| die "Sed failed for ${MKF}"
makefiles+=" ${MKF}"
done
# autodetection of compiler and settings; generates the modified Makefiles
cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die

# Use the correct pkgconfig name for Lua
has_version 'dev-lang/lua:5.1' \
&& LUAPKGCONFIG=lua5.1 \
|| LUAPKGCONFIG=lua
sed -i \
-e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
-e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
-e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
configure.ac || die "Sed failed for configure.ac"
eautoreconf
}

src_configure() {
econf \
$(use_with luajit)

# Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
# also, don't define ANSI/c99 for lua twice
sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
}

src_compile() {
tc-export CC AR RANLIB

local myconf=""

if use tcmalloc; then
myconf="${myconf} USE_TCMALLOC=yes"
elif use jemalloc; then
myconf="${myconf} JEMALLOC_SHARED=yes"
else
myconf="${myconf} MALLOC=yes"
fi

emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
}

src_install() {
insinto /etc/
doins redis.conf sentinel.conf
use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
fperms 0644 /etc/{redis,sentinel}.conf

newconfd "${FILESDIR}/redis.confd-r1" redis
newinitd "${FILESDIR}/redis.initd-5" redis

systemd_newunit "${FILESDIR}/redis.service-2" redis.service
systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf

newconfd "${FILESDIR}/redis-sentinel.confd" redis-sentinel
newinitd "${FILESDIR}/redis-sentinel.initd" redis-sentinel

insinto /etc/logrotate.d/
newins "${FILESDIR}/${PN}.logrotate" ${PN}

dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md

dobin src/redis-cli
dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
fperms 0750 /usr/sbin/redis-benchmark
dosym redis-server /usr/sbin/redis-sentinel

if use prefix; then
diropts -m0750
else
diropts -m0750 -o redis -g redis
fi
keepdir /var/{log,lib}/redis
}

0 comments on commit b2a56b6

Please sign in to comment.