summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorTomas Mozes <hydrapolic@gmail.com>2017-12-08 09:26:50 +0100
committerPatrice Clement <monsieurp@gentoo.org>2017-12-19 11:13:29 +0100
commit8f4e968d986f3d551178ca19d78a42c579afceb0 (patch)
treeb610362a0f759a1a54c3cec343ae3042858d8db8 /dev-db
parentmedia-sound/clementine: Drop old (diff)
downloadgentoo-8f4e968d986f3d551178ca19d78a42c579afceb0.tar.gz
gentoo-8f4e968d986f3d551178ca19d78a42c579afceb0.tar.bz2
gentoo-8f4e968d986f3d551178ca19d78a42c579afceb0.zip
dev-db/redis: version bump to 4.0.6.
Closes: https://bugs.gentoo.org/574856 Closes: https://bugs.gentoo.org/599974 Closes: https://bugs.gentoo.org/639924 Closes: https://github.com/gentoo/gentoo/pull/6480 Package-Manager: Portage-2.3.16, Repoman-2.3.6
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/redis/Manifest1
-rw-r--r--dev-db/redis/files/redis-sentinel-4.0.6-config.patch9
-rw-r--r--dev-db/redis/files/redis-sentinel.confd16
-rw-r--r--dev-db/redis/files/redis-sentinel.initd22
-rw-r--r--dev-db/redis/files/redis.logrotate6
-rw-r--r--dev-db/redis/redis-4.0.6.ebuild141
6 files changed, 195 insertions, 0 deletions
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
index eeb83e7ebb00..46426aee5f11 100644
--- a/dev-db/redis/Manifest
+++ b/dev-db/redis/Manifest
@@ -3,3 +3,4 @@ DIST redis-3.2.5.tar.gz 1544040 BLAKE2B a67b46feacddcc7e4cafd91fb5d295a972f3a09d
DIST redis-3.2.8.tar.gz 1547237 BLAKE2B fb03e263ad7b135dff38e018d9b830c4992cf331efc7c23c10b087c47e597abedb52f259d4dd9a9ee1d661685157fc29a2022d74bc21d406bb10c9b7dfab8b7e SHA512 7334faf73af3644f7f9dcaddd322955d5df1e88a1640b509ae623f322615a20f6dc143eb57dd89ff3a278557df309ac4215c3fb458235682ce28e16c817068ba
DIST redis-4.0.1.tar.gz 1711660 BLAKE2B 0b8881baa78908df4adcc1aabfa0ea9554900f8b54d204ffa054752ba4355da2b56408501ede81a69cc1f34ebbb9fc984335738ea9f343ddcd4e9fb9a0d64c8e SHA512 62dec537aebd12340b9642f5f8b07fd98757c9e648dcd539a0411f207db3495923c5a6a9941036c56b2d574ee38b46d08558668111e322345ef549f93fada26f
DIST redis-4.0.2.tar.gz 1713990 BLAKE2B 307ab76b336f7520e14a23a1577c46e1b63cc5a5a5b6afb725cb87934fbcb62107085671fd1072d1142ce8e92f069e6b6064c9f4468335bc6997897c8f494471 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4
+DIST redis-4.0.6.tar.gz 1723533 BLAKE2B 94c2a9b7eeaa676efaac75cd5c143b0f4b02440b5a21ecc9b2a68cc27ad4abc1fc4d7dbc903dea5d956ce737ca434ea5b5bdde4a35df3a3689da60c5fb0bddf1 SHA512 784aad612664df666c36f969cb6a9ab794f004abcf9aa761bd1f5f0f8fdb248d5b38f48a59b68c2de7d2a344755f1537efc9d5847de0d662302699ed94d40813
diff --git a/dev-db/redis/files/redis-sentinel-4.0.6-config.patch b/dev-db/redis/files/redis-sentinel-4.0.6-config.patch
new file mode 100644
index 000000000000..f2a75814951c
--- /dev/null
+++ b/dev-db/redis/files/redis-sentinel-4.0.6-config.patch
@@ -0,0 +1,9 @@
+diff --git a/sentinel.conf b/sentinel.conf
+index 0e1b266..869a4b9 100644
+--- a/sentinel.conf
++++ b/sentinel.conf
+@@ -194,3 +194,4 @@ sentinel failover-timeout mymaster 180000
+ #
+ # sentinel client-reconfig-script mymaster /var/redis/reconfig.sh
+
++logfile "/var/log/redis/sentinel.log"
diff --git a/dev-db/redis/files/redis-sentinel.confd b/dev-db/redis/files/redis-sentinel.confd
new file mode 100644
index 000000000000..f465a5c3e91f
--- /dev/null
+++ b/dev-db/redis/files/redis-sentinel.confd
@@ -0,0 +1,16 @@
+# Redis-sentinel user.
+REDIS_SENTINEL_USER="redis"
+
+# Redis-sentinel group.
+REDIS_SENTINEL_GROUP="redis"
+
+# Redis-sentinel configuration file.
+REDIS_SENTINEL_CONF="/etc/sentinel.conf"
+
+# Redis-sentinel working directory.
+REDIS_SENTINEL_DIR="/tmp"
+
+# Specify the network service that corresponds to the "bind" setting
+# in your sentinel.conf. For example, if you bind to 127.0.0.1, this should
+# be set to "net.lo" which provides the loopback interface.
+rc_need="net.lo"
diff --git a/dev-db/redis/files/redis-sentinel.initd b/dev-db/redis/files/redis-sentinel.initd
new file mode 100644
index 000000000000..6a22d08db697
--- /dev/null
+++ b/dev-db/redis/files/redis-sentinel.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${REDIS_SENTINEL_DIR:=/tmp}
+: ${REDIS_SENTINEL_CONF:=/etc/sentinel.conf}
+: ${REDIS_SENTINEL_USER:=redis}
+: ${REDIS_SENTINEL_GROUP:=redis}
+: ${REDIS_SENTINEL_TIMEOUT:=30}
+
+command="/usr/sbin/redis-sentinel"
+command_args="${REDIS_SENTINEL_CONF}"
+command_background="true"
+command_user="${REDIS_SENTINEL_USER}:${REDIS_SENTINEL_GROUP}"
+pidfile="/run/${RC_SVCNAME}.pid"
+retry="${REDIS_SENTINEL_TIMEOUT}"
+start_stop_daemon_args="--chdir \"${REDIS_SENTINEL_DIR}\""
+
+depend() {
+ use localmount logger
+ after keepalived redis
+}
diff --git a/dev-db/redis/files/redis.logrotate b/dev-db/redis/files/redis.logrotate
new file mode 100644
index 000000000000..2df390c2d1b4
--- /dev/null
+++ b/dev-db/redis/files/redis.logrotate
@@ -0,0 +1,6 @@
+/var/log/redis/redis.log /var/log/redis/sentinel.log {
+ compress
+ delaycompress
+ notifempty
+ missingok
+}
diff --git a/dev-db/redis/redis-4.0.6.ebuild b/dev-db/redis/redis-4.0.6.ebuild
new file mode 100644
index 000000000000..92f1b4d63f31
--- /dev/null
+++ b/dev-db/redis/redis-4.0.6.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2017 Gentoo Foundation
+# 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="http://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
+}