aboutsummaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2017-09-04 07:38:54 +0100
committerStuart Shelton <stuart@shelton.me>2017-09-04 07:38:54 +0100
commite04f7b3de534e05e421f17f048ee3149753d41b6 (patch)
tree77fcf8c35b6a4427cf81446b666baf359bac89bb /dev-db
parentUpdate sys-power/acpid-2.0.23 (diff)
downloadsrcshelton-e04f7b3de534e05e421f17f048ee3149753d41b6.tar.gz
srcshelton-e04f7b3de534e05e421f17f048ee3149753d41b6.tar.bz2
srcshelton-e04f7b3de534e05e421f17f048ee3149753d41b6.zip
Add dev-db/redis-3.2.8-r2, update README.md
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/redis/Manifest10
-rw-r--r--dev-db/redis/files/configure.ac-3.266
-rw-r--r--dev-db/redis/files/redis-3.2.3-config.patch40
-rw-r--r--dev-db/redis/files/redis-3.2.3-sharedlua.patch60
-rw-r--r--dev-db/redis/files/redis-3.2.5-shared.patch30
-rw-r--r--dev-db/redis/files/redis.confd20
-rw-r--r--dev-db/redis/files/redis.initd-431
-rw-r--r--dev-db/redis/files/redis.service-214
-rw-r--r--dev-db/redis/files/redis.tmpfiles2
-rw-r--r--dev-db/redis/redis-3.2.8-r2.ebuild125
10 files changed, 398 insertions, 0 deletions
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
new file mode 100644
index 00000000..b874f838
--- /dev/null
+++ b/dev-db/redis/Manifest
@@ -0,0 +1,10 @@
+AUX configure.ac-3.2 1882 SHA256 abc988876ec5e00afec596ff27430403a248805fe5872db4566d2d523b9446b6 SHA512 13d9f16cde8a95c96bcd726056d670d390dea6e2752ac607bc68eefb6214f0ab18b0e27d3283f2b219febd2da82e6489bd434215c9380c3c85c711aa00cb2be5 WHIRLPOOL 8fcdc27c607cc9dc1e5b7277ec8438bd72a5f5f862ef79eb2b30218d2eb1c62e3764a62b286bf180b0ada2414d47db597f589f18005b638e7f61d196bfb12919
+AUX redis-3.2.3-config.patch 1499 SHA256 ec9cbb6dd9dff44748a3e7c3bfdd6ac301e743c1159c7dc80680645aafba797d SHA512 85df4b8a22810d466204f5c076a97a45badc4cc7f7bf13a0e6478f00d46366abd732fdd782da4b657b8d7ddfc08034c4aba9b6a893d2002820e9f74989896808 WHIRLPOOL 28f3da38ff6314a545bcfc991c643bcedf0bcf9b1f19c9310b5d32f8b11b8ba351a61a90174855a4bdad1ce411b6b409ec92c5dc0af12952ced4cb41b054d564
+AUX redis-3.2.3-sharedlua.patch 2535 SHA256 0056ddcb8552da5ce424d0f016fabafbff552734e632377403521f611f667bcf SHA512 4b60271a24a27f69292450575f9316dd009e154980db2b70d7035794bc1f332fe54957558037c75de625d1eaf98cc0f1ec02fcd0ef510c86a3c605c474c1117e WHIRLPOOL 672185942783ccd8d5c635a8d8d2aec839ff68770b42d7acd8cd059aa046b2b5550164564a6b63696cfb4e4bcb31fc04de2b427ca7dcd85f3dfe2806207a457d
+AUX redis-3.2.5-shared.patch 754 SHA256 008cd244b40d6a3bef804a6aa30c4592a7ad8480ea1358112071f079ed284d47 SHA512 dcb0755a0cc24b4dc21c7a20891df5fa0c643beb8f411779548893ac9681c41510ecba79b0ba031d7eeeccbf5b15ae32be04241b197524de4f8f9aafa02ccaab WHIRLPOOL be653deb553aa59102ea6af2c7870b90f0b9d2f989aee677bb6e9e81b89ce818e49484fba83d813cf0902c714da42ec6dd86a8daa20c32e50bdb65c8b8b8eaec
+AUX redis.confd 450 SHA256 8c68e29dc88c8ad99b9212a448d313d1406ef02c7638398b2e48ea1ca8aa937b SHA512 c6347cc6e17e9ce93fd081608b19c4977c3e1ffd58d2a417804ca3e647967800ac11859bd05d5437c36310dcd7552c11f35965e4521c5266c3414387d4796a6b WHIRLPOOL 72fb07431293f0e382af98c5a0b7eeca146cab84153befdd808328aa27404cd74d55d524b5442ad10de5989917351299bc7610e0be75d11d2e31fb5353beb45a
+AUX redis.initd-4 784 SHA256 0f08a89833ec63278efd20b71d3cde80d4b9de9f51b97584309a206d131aa018 SHA512 025981d95bb28e3838aab5d86ae75524d5901515543c1640aa0e2d7a48d3583f433e103f2389fa05329da697d2d9779212946a8fa2d7c413178cd0ccbd57b23a WHIRLPOOL a76acd65375f45626cc86a68621b468c10bebadbc89078fb07df3dc276bc9c5ab249da21480dbff98d34ab2bb97507cf4cedb0e87e55d8678a56b70bf71088c6
+AUX redis.service-2 253 SHA256 e65ec7fdac98f30fb72ab73656e4467e74c8900d2664cba64d9baf9e16eaee1b SHA512 b42b73bb54ccc0d16adafb91aabe010092f548ec7979d8a0ed1c4563d9fca378eeb74c0c556f7565a32199ed30ca8a13d6b610d9cda39fd23da1428a410f62cc WHIRLPOOL e2b041b37bf95cbe4ed6684238034497c971352db602a86adbb5ef0626967b4ab20dd9ae412c0cae009a8470e502426b0135e4c676858c11d6e10c97a677baee
+AUX redis.tmpfiles 61 SHA256 68e4c7e3159068400cbc7d07e84b5618f9d829dc7a4f18253783c6256a53031a SHA512 741ff5a4df5b04e7af4e81357812bf5b6cf992bc18b6052074aef134401d0a92703a2e41f52966012c05ea80fac5636435c8d3e6ed55e62a5711526ba67ee738 WHIRLPOOL 2c6f4d9e5382c43e935db16bf120b24cd8de517bc067dcab91b3230a8ddced7ecc5ed37626464d3f1a7880d2d41efdf3cecfd1029a38aaa2edf3d20de74489b4
+DIST redis-3.2.8.tar.gz 1547237 SHA256 61b373c23d18e6cc752a69d5ab7f676c6216dc2853e46750a8c4ed791d68482c SHA512 7334faf73af3644f7f9dcaddd322955d5df1e88a1640b509ae623f322615a20f6dc143eb57dd89ff3a278557df309ac4215c3fb458235682ce28e16c817068ba WHIRLPOOL 50ffecd1891051a3e28028065bfaf090b2eec42a757cdf61c6d22b051c8ba4fc78809b3198182d2333bedb4715d9a8d70bf04f605030abe6e33cc6b9b7161cf7
+EBUILD redis-3.2.8-r2.ebuild 3615 SHA256 547a6435292356ed3471c1fed786b2e3da2d53821b1fdf6f2a173b2522948f7b SHA512 6951254129a0a8aa66c8ac7c19abc28b1e0ce9947fac1b765f6fcab29e95b48b41139fd60134eee4675a754a22ceb25c21a3216b559bfdc44a66899182c6cde2 WHIRLPOOL 030a40a1181127dc5be12fdb998e69d1d90528b068192e38d9ae51fb06640a687f09e3f72d2f78acf727713f22a4ae9f762b851c384350b14df50ca755ba37da
diff --git a/dev-db/redis/files/configure.ac-3.2 b/dev-db/redis/files/configure.ac-3.2
new file mode 100644
index 00000000..3e2cf926
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-3.2
@@ -0,0 +1,66 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 3.2.3, antirez@gmail.com)
+AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
+if test x"$CFLAGS" = x""; then
+ AM_CFLAGS="$AM_CFLAGS -O2"
+else
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
+fi
+
+# options
+AC_MSG_CHECKING([whether to build with debug information])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debug data generation (def=no)])],
+ [debugit="$enableval"],
+ [debugit=no])
+AC_MSG_RESULT([$debugit])
+
+if test x"$debugit" = x"yes"; then
+ AC_DEFINE([DEBUG],[],[Debug Mode])
+ AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
+else
+ AC_DEFINE([NDEBUG],[],[No-debug Mode])
+fi
+AC_SUBST([AM_CFLAGS])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])
+
+# Check for lua-5.1 or luajit
+AC_ARG_WITH([luajit],
+ AS_HELP_STRING([--with-luajit], [Use luajit instead of lua]))
+
+AS_IF([test "x$with_luajit" = "xyes"],
+ [PKG_CHECK_MODULES([LUA], [luajit >= 2], [], [AC_MSG_ERROR([luajit requested but not found])])],
+ [PKG_CHECK_MODULES([LUA], [lua5.1], [], [AC_MSG_ERROR([lua-5.1 required but not found])])])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/redis-3.2.3-config.patch b/dev-db/redis/files/redis-3.2.3-config.patch
new file mode 100644
index 00000000..541e2549
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-config.patch
@@ -0,0 +1,40 @@
+diff --git a/redis.conf b/redis.conf
+index 22e00bc..b09de57 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -147,7 +147,7 @@ supervised no
+ #
+ # Creating a pid file is best effort: if Redis is not able to create it
+ # nothing bad happens, the server will start and run normally.
+-pidfile /var/run/redis_6379.pid
++pidfile /run/redis/redis.pid
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -160,7 +160,7 @@ loglevel notice
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -244,7 +244,7 @@ dbfilename dump.rdb
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -534,7 +534,7 @@ slave-priority 100
+ # limit for maxmemory so that there is some free RAM on the system for slave
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+-# maxmemory <bytes>
++maxmemory 67108864
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-3.2.3-sharedlua.patch b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
new file mode 100644
index 00000000..52de9048
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
@@ -0,0 +1,60 @@
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7..fa50c41 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -46,7 +46,7 @@
+ #include "strbuf.h"
+ #include "fpconv.h"
+
+-#include "../../../src/solarisfixes.h"
++#include "solarisfixes.h"
+
+ #ifndef CJSON_MODNAME
+ #define CJSON_MODNAME "cjson"
+diff --git a/src/Makefile b/src/Makefile
+index 648127a..1f96d98 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
++DEPENDENCY_TARGETS=hiredis linenoise geohash-int
+
+ # Default settings
+ STD=-std=c99 -pedantic -DREDIS_STATIC=''
+@@ -56,6 +56,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=@LUA_LIBS@
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -80,7 +81,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@
+
+ ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -118,6 +119,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+@@ -172,7 +174,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.5-shared.patch b/dev-db/redis/files/redis-3.2.5-shared.patch
new file mode 100644
index 00000000..7ebff12b
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.5-shared.patch
@@ -0,0 +1,30 @@
+diff --git a/src/Makefile b/src/Makefile
+index fdbe36a..df224ae 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -26,12 +26,7 @@ PREFIX?=/usr/local
+ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -103,9 +98,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis.confd b/dev-db/redis/files/redis.confd
new file mode 100644
index 00000000..07585fa7
--- /dev/null
+++ b/dev-db/redis/files/redis.confd
@@ -0,0 +1,20 @@
+# Redis user.
+REDIS_USER="redis"
+
+# Redis group.
+REDIS_GROUP="redis"
+
+# Redis configuration file.
+REDIS_CONF="/etc/redis.conf"
+
+# Redis dump directory.
+REDIS_DIR="/var/lib/redis"
+
+# Redis pid file.
+# (Be sure to change the main redis configuration file as well if you change
+# this from the default.)
+REDIS_PID="/var/run/redis/redis.pid"
+
+# Redis options.
+# (Redis expects the first argument to be the configuration file.)
+REDIS_OPTS="${REDIS_CONF}"
diff --git a/dev-db/redis/files/redis.initd-4 b/dev-db/redis/files/redis.initd-4
new file mode 100644
index 00000000..58a1a4b2
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-4
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+
+REDIS_DIR=${REDIS_DIR:-/var/lib/redis}
+REDIS_CONF=${REDIS_CONF:-/etc/redis.conf}
+REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"}
+REDIS_USER=${REDIS_USER:-redis}
+REDIS_GROUP=${REDIS_GROUP:-redis}
+REDIS_TIMEOUT=${REDIS_TIMEOUT:-30}
+
+command=/usr/sbin/redis-server
+pidfile=${REDIS_PID:-/var/run/redis/redis.pid}
+start_stop_daemon_args="--background --pidfile ${pidfile} --chdir \"${REDIS_DIR}\" --user ${REDIS_USER} --group ${REDIS_GROUP}"
+command_args="${REDIS_OPTS}"
+
+depend() {
+ use net localmount logger
+ after keepalived
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID})
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --exec ${command} \
+ --retry ${REDIS_TIMEOUT} \
+ --pidfile ${pidfile}
+ eend
+}
diff --git a/dev-db/redis/files/redis.service-2 b/dev-db/redis/files/redis.service-2
new file mode 100644
index 00000000..c36d7960
--- /dev/null
+++ b/dev-db/redis/files/redis.service-2
@@ -0,0 +1,14 @@
+[Unit]
+Description=A persistent key-value database
+After=syslog.target network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/redis/redis.pid
+ExecStart=/usr/sbin/redis-server /etc/redis.conf
+User=redis
+Group=redis
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-db/redis/files/redis.tmpfiles b/dev-db/redis/files/redis.tmpfiles
new file mode 100644
index 00000000..657d8a55
--- /dev/null
+++ b/dev-db/redis/files/redis.tmpfiles
@@ -0,0 +1,2 @@
+# redis runtime directory
+d /var/run/redis 0755 redis root -
diff --git a/dev-db/redis/redis-3.2.8-r2.ebuild b/dev-db/redis/redis-3.2.8-r2.ebuild
new file mode 100644
index 00000000..2812db88
--- /dev/null
+++ b/dev-db/redis/redis-3.2.8-r2.ebuild
@@ -0,0 +1,125 @@
+# 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 systemd test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.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=""
+ 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
+ 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,lua,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
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/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" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ if use systemd; then
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+ fi
+
+ 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
+}