summaryrefslogtreecommitdiff
path: root/dev-db/redis
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/redis')
-rw-r--r--dev-db/redis/files/configure.ac-2.258
-rw-r--r--dev-db/redis/files/redis-2.4.17-shared.patch22
-rw-r--r--dev-db/redis/files/redis-2.4.3-shared.patch22
-rw-r--r--dev-db/redis/files/redis-2.4.4-tcmalloc.patch21
-rw-r--r--dev-db/redis/files/redis-2.6.7-config.patch69
-rw-r--r--dev-db/redis/files/redis-2.6.7-shared.patch36
-rw-r--r--dev-db/redis/files/redis-2.6.9-tclsh86.patch57
-rw-r--r--dev-db/redis/files/redis-2.8.3-config.patch59
-rw-r--r--dev-db/redis/files/redis-2.8.3-shared.patch36
-rw-r--r--dev-db/redis/files/redis.confd20
-rw-r--r--dev-db/redis/files/redis.initd41
-rw-r--r--dev-db/redis/files/redis.initd-223
-rw-r--r--dev-db/redis/files/redis.initd-332
-rw-r--r--dev-db/redis/files/redis.service14
-rw-r--r--dev-db/redis/files/redis.tmpfiles2
-rw-r--r--dev-db/redis/redis-scm.ebuild110
16 files changed, 622 insertions, 0 deletions
diff --git a/dev-db/redis/files/configure.ac-2.2 b/dev-db/redis/files/configure.ac-2.2
new file mode 100644
index 0000000..3ff6650
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-2.2
@@ -0,0 +1,58 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 2.0.0, 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])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/redis-2.4.17-shared.patch b/dev-db/redis/files/redis-2.4.17-shared.patch
new file mode 100644
index 0000000..9c60714
--- /dev/null
+++ b/dev-db/redis/files/redis-2.4.17-shared.patch
@@ -0,0 +1,22 @@
+See https://github.com/antirez/redis/pull/137
+
+--- src/Makefile 2011-10-17 10:46:00.000000000 +0200
++++ src/Makefile.2 2011-10-17 13:47:53.000000000 +0200
+@@ -49,7 +49,16 @@
+ ifeq ($(USE_JEMALLOC),yes)
+ ALLOC_DEP=../deps/jemalloc/lib/libjemalloc.a
+ ALLOC_LINK=$(ALLOC_DEP) -ldl
+- ALLOC_FLAGS=-DUSE_JEMALLOC -I../deps/jemalloc/include
++ ALLOC_FLAGS=-DUSE_JEMALLOC
++ ifdef JEMALLOC_SHARED
++ ALLOC_DEP=
++ ALLOC_LINK=-ljemalloc
++ ALLOC_FLAGS=-DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -I/usr/include
++ else
++ ALLOC_DEP=../deps/jemalloc/lib/libjemalloc.a
++ ALLOC_LINK=$(ALLOC_DEP) -ldl
++ ALLOC_FLAGS=-DUSE_JEMALLOC -I../deps/jemalloc/include
++ endif
+ endif
+
+ CCOPT= $(CFLAGS) $(ARCH) $(PROF) \ No newline at end of file
diff --git a/dev-db/redis/files/redis-2.4.3-shared.patch b/dev-db/redis/files/redis-2.4.3-shared.patch
new file mode 100644
index 0000000..20cdebe
--- /dev/null
+++ b/dev-db/redis/files/redis-2.4.3-shared.patch
@@ -0,0 +1,22 @@
+See https://github.com/antirez/redis/pull/137
+
+--- src/Makefile 2011-10-17 10:46:00.000000000 +0200
++++ src/Makefile.2 2011-10-17 13:47:53.000000000 +0200
+@@ -49,7 +49,16 @@
+ ifeq ($(USE_JEMALLOC),yes)
+ ALLOC_DEP=../deps/jemalloc/lib/libjemalloc.a
+ ALLOC_LINK=$(ALLOC_DEP) -ldl
+- ALLOC_FLAGS=-DUSE_JEMALLOC -I../deps/jemalloc/include
++ ALLOC_FLAGS=-DUSE_JEMALLOC
++ ifdef JEMALLOC_SHARED
++ ALLOC_DEP=
++ ALLOC_LINK=-ljemalloc
++ ALLOC_FLAGS=-DUSE_JEMALLOC -I/usr/include
++ else
++ ALLOC_DEP=../deps/jemalloc/lib/libjemalloc.a
++ ALLOC_LINK=$(ALLOC_DEP) -ldl
++ ALLOC_FLAGS=-DUSE_JEMALLOC -I../deps/jemalloc/include
++ endif
+ endif
+
+ CCOPT= $(CFLAGS) $(ARCH) $(PROF)
diff --git a/dev-db/redis/files/redis-2.4.4-tcmalloc.patch b/dev-db/redis/files/redis-2.4.4-tcmalloc.patch
new file mode 100644
index 0000000..964ce71
--- /dev/null
+++ b/dev-db/redis/files/redis-2.4.4-tcmalloc.patch
@@ -0,0 +1,21 @@
+https://github.com/antirez/redis/pull/218
+
+diff --git a/src/Makefile b/src/Makefile
+index 72edcad..3e43990 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -35,12 +35,14 @@ else
+ endif
+
+ ifeq ($(USE_TCMALLOC),yes)
++ USE_JEMALLOC=no
+ ALLOC_DEP=
+ ALLOC_LINK=-ltcmalloc
+ ALLOC_FLAGS=-DUSE_TCMALLOC
+ endif
+
+ ifeq ($(USE_TCMALLOC_MINIMAL),yes)
++ USE_JEMALLOC=no
+ ALLOC_DEP=
+ ALLOC_LINK=-ltcmalloc_minimal
+ ALLOC_FLAGS=-DUSE_TCMALLOC \ No newline at end of file
diff --git a/dev-db/redis/files/redis-2.6.7-config.patch b/dev-db/redis/files/redis-2.6.7-config.patch
new file mode 100644
index 0000000..0aea1c7
--- /dev/null
+++ b/dev-db/redis/files/redis-2.6.7-config.patch
@@ -0,0 +1,69 @@
+commit 7f05e59a052941fd070be1825d0623a054c66e2d
+Author: jbergstroem <bugs@bergstroem.nu>
+Date: Tue Oct 30 13:11:23 2012 +1100
+
+ Adapt config based on Gentoo defaults
+
+diff --git a/redis.conf b/redis.conf
+index 751a3eb..1a36b12 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -14,11 +14,11 @@
+
+ # By default Redis does not run as a daemon. Use 'yes' if you need it.
+ # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
+-daemonize no
++daemonize yes
+
+ # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
+ # default. You can specify a custom pid file location here.
+-pidfile /var/run/redis.pid
++pidfile /var/run/redis/redis.pid
+
+ # Accept connections on the specified port, default is 6379.
+ # If port 0 is specified Redis will not listen on a TCP socket.
+@@ -27,7 +27,7 @@ port 6379
+ # If you want you can bind a single interface, if the bind option is not
+ # specified all the interfaces will listen for incoming connections.
+ #
+-# bind 127.0.0.1
++bind 127.0.0.1
+
+ # Specify the path for the unix socket that will be used to listen for
+ # incoming connections. There is no default, so Redis will not listen
+@@ -50,7 +50,7 @@ loglevel notice
+ # Specify the log file name. Also 'stdout' 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 stdout
++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.
+@@ -124,7 +124,7 @@ rdbcompression yes
+ rdbchecksum yes
+
+ # The filename where to dump the DB
+-dbfilename dump.rdb
++dbfilename /var/lib/redis/dump.rdb
+
+ # The working directory.
+ #
+@@ -134,7 +134,7 @@ dbfilename dump.rdb
+ # Also the Append Only File will be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -278,7 +278,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 behavior: \ No newline at end of file
diff --git a/dev-db/redis/files/redis-2.6.7-shared.patch b/dev-db/redis/files/redis-2.6.7-shared.patch
new file mode 100644
index 0000000..992af6c
--- /dev/null
+++ b/dev-db/redis/files/redis-2.6.7-shared.patch
@@ -0,0 +1,36 @@
+commit 6931bf1d81de597b3abc2a36adf081a24c114567
+Author: jbergstroem <bugs@bergstroem.nu>
+Date: Tue Oct 23 12:26:04 2012 +1100
+
+ Build against shared jemalloc
+
+diff --git a/src/Makefile b/src/Makefile
+index 358b4cb..41390f4 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -22,12 +22,7 @@ STD= -std=c99 -pedantic
+ WARN= -Wall
+ OPT= $(OPTIMIZATION)
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -71,9 +66,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 -ldl
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) \ No newline at end of file
diff --git a/dev-db/redis/files/redis-2.6.9-tclsh86.patch b/dev-db/redis/files/redis-2.6.9-tclsh86.patch
new file mode 100644
index 0000000..00d81df
--- /dev/null
+++ b/dev-db/redis/files/redis-2.6.9-tclsh86.patch
@@ -0,0 +1,57 @@
+diff --git a/runtest b/runtest
+index 0eb384c..fadc283 100755
+--- a/runtest
++++ b/runtest
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+-TCL=tclsh8.5
++TCL=tclsh
+ which $TCL
+ if [ "$?" != "0" ]
+ then
+diff --git a/tests/integration/replication-4.tcl b/tests/integration/replication-4.tcl
+index 69fcab3..58a70fa 100644
+--- a/tests/integration/replication-4.tcl
++++ b/tests/integration/replication-4.tcl
+@@ -1,5 +1,5 @@
+ proc start_bg_complex_data {host port db ops} {
+- exec tclsh8.5 tests/helpers/bg_complex_data.tcl $host $port $db $ops &
++ exec tclsh tests/helpers/bg_complex_data.tcl $host $port $db $ops &
+ }
+
+ proc stop_bg_complex_data {handle} {
+diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl
+index da94b08..30baf6a 100644
+--- a/tests/integration/replication.tcl
++++ b/tests/integration/replication.tcl
+@@ -78,7 +78,7 @@ start_server {tags {"repl"}} {
+ }
+
+ proc start_write_load {host port seconds} {
+- exec tclsh8.5 tests/helpers/gen_write_load.tcl $host $port $seconds &
++ exec tclsh tests/helpers/gen_write_load.tcl $host $port $seconds &
+ }
+
+ proc stop_write_load {handle} {
+diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
+index b2e58b4..253e955 100644
+--- a/tests/test_helper.tcl
++++ b/tests/test_helper.tcl
+@@ -2,6 +2,8 @@
+ # This softare is released under the BSD License. See the COPYING file for
+ # more information.
+
++package require Tcl 8.5
++
+ set tcl_precision 17
+ source tests/support/redis.tcl
+ source tests/support/server.tcl
+@@ -189,7 +191,7 @@ proc test_server_main {} {
+ set start_port [expr {$::port+100}]
+ for {set j 0} {$j < $::numclients} {incr j} {
+ set start_port [find_available_port $start_port]
+- set p [exec tclsh8.5 [info script] {*}$::argv \
++ set p [exec tclsh [info script] {*}$::argv \
+ --client $port --port $start_port &]
+ lappend ::clients_pids $p
+ incr start_port 10 \ No newline at end of file
diff --git a/dev-db/redis/files/redis-2.8.3-config.patch b/dev-db/redis/files/redis-2.8.3-config.patch
new file mode 100644
index 0000000..3f5d95b
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.3-config.patch
@@ -0,0 +1,59 @@
+commit 66f26c12faaeb8ed85a715d2dfd6a41c978a4bd1
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Mon Nov 25 09:23:10 2013 +1100
+
+ Modify config to gentoo defaults
+
+diff --git redis.conf redis.conf
+index 2e3239c..6c7ef4a 100644
+--- redis.conf
++++ redis.conf
+@@ -14,11 +14,11 @@
+
+ # By default Redis does not run as a daemon. Use 'yes' if you need it.
+ # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
+-daemonize no
++daemonize yes
+
+ # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
+ # default. You can specify a custom pid file location here.
+-pidfile /var/run/redis.pid
++pidfile /run/redis/redis.pid
+
+ # Accept connections on the specified port, default is 6379.
+ # If port 0 is specified Redis will not listen on a TCP socket.
+@@ -32,7 +32,7 @@ port 6379
+ # Examples:
+ #
+ # bind 192.168.1.100 10.0.0.1
+-# bind 127.0.0.1
++bind 127.0.0.1
+
+ # Specify the path for the unix socket that will be used to listen for
+ # incoming connections. There is no default, so Redis will not listen
+@@ -71,7 +71,7 @@ loglevel notice
+ # Specify the log file name. Also the emptry 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.
+@@ -155,7 +155,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 #################################
+
+@@ -365,6 +365,7 @@ slave-priority 100
+ # 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-2.8.3-shared.patch b/dev-db/redis/files/redis-2.8.3-shared.patch
new file mode 100644
index 0000000..d32484f
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.3-shared.patch
@@ -0,0 +1,36 @@
+commit 388a76f24c96767c831ee7682234fd9f2bc5b9ac
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Mon Nov 25 09:17:14 2013 +1100
+
+ Use shared jemalloc
+
+diff --git src/Makefile src/Makefile
+index c37549d..77e6255 100644
+--- src/Makefile
++++ 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)
+@@ -79,9 +74,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 -ldl
++ 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 0000000..07585fa
--- /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 b/dev-db/redis/files/redis.initd
new file mode 100644
index 0000000..337ca6e
--- /dev/null
+++ b/dev-db/redis/files/redis.initd
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/files/redis.initd,v 1.4 2012/02/04 21:17:55 swegener Exp $
+
+REDIS_EXEC=/usr/sbin/redis-server
+REDIS_PID=${REDIS_PID:-/var/run/redis/redis.pid}
+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}
+
+depend() {
+ use net localmount logger
+ after keepalived
+}
+
+start() {
+
+ local PID_DIR=$(dirname ${REDIS_PID})
+ mkdir -p ${PID_DIR}
+ chown ${REDIS_USER}:${REDIS_GROUP} ${PID_DIR}
+
+ ebegin "Starting Redis server"
+ start-stop-daemon --start \
+ --chdir "${REDIS_DIR}" \
+ --user ${REDIS_USER}:${REDIS_GROUP} \
+ --pidfile "${REDIS_PID}" \
+ --exec "${REDIS_EXEC}" \
+ -- ${REDIS_OPTS}
+ ret=$?
+ eend ${ret}
+
+}
+
+stop() {
+ ebegin "Stopping Redis server"
+ start-stop-daemon --stop --quiet --pidfile "${REDIS_PID}"
+ ret=$?
+ rm -f "${REDIS_PID}"
+ eend ${ret}
+}
diff --git a/dev-db/redis/files/redis.initd-2 b/dev-db/redis/files/redis.initd-2
new file mode 100644
index 0000000..3dd3d78
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-2
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/files/redis.initd-2,v 1.1 2013/05/06 08:45:00 djc Exp $
+
+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}
+
+command=/usr/sbin/redis-server
+start_stop_daemon_args="--chdir \"${REDIS_DIR}\"
+ --user ${REDIS_USER} --group ${REDIS_GROUP}"
+command_args="${REDIS_OPTS}"
+pidfile=${REDIS_PID:-/var/run/redis/redis.pid}
+
+depend() {
+ use net localmount logger
+ after keepalived
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID})
+}
diff --git a/dev-db/redis/files/redis.initd-3 b/dev-db/redis/files/redis.initd-3
new file mode 100644
index 0000000..a7a7713
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-3
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/files/redis.initd-3,v 1.1 2013/08/26 11:47:13 djc Exp $
+
+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}
+
+command=/usr/sbin/redis-server
+start_stop_daemon_args="--chdir \"${REDIS_DIR}\"
+ --user ${REDIS_USER} --group ${REDIS_GROUP}"
+command_args="${REDIS_OPTS}"
+pidfile=${REDIS_PID:-/run/redis/redis.pid}
+
+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 ${retries} \
+ --retry 30 \
+ --pidfile ${pidfile}
+ eend
+}
diff --git a/dev-db/redis/files/redis.service b/dev-db/redis/files/redis.service
new file mode 100644
index 0000000..f1322f6
--- /dev/null
+++ b/dev-db/redis/files/redis.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=A persistent key-value database
+After=syslog.target network.target
+
+[Service]
+Type=forking
+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 0000000..657d8a5
--- /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-scm.ebuild b/dev-db/redis/redis-scm.ebuild
new file mode 100644
index 0000000..555ce8b
--- /dev/null
+++ b/dev-db/redis/redis-scm.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/redis-2.8.11.ebuild,v 1.2 2014/07/03 15:56:52 bicatali Exp $
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user git-2
+
+DESCRIPTION="A persistent caching system, key-value and data structures database."
+HOMEPAGE="http://redis.io/"
+EGIT_REPO_URI="https://github.com/antirez/redis.git"
+EGIT_BRANCH="3.0"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~hppa ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc test"
+SLOT="0"
+
+RDEPEND="tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND=">=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl )
+ ${RDEPEND}"
+REQUIRED_USE="tcmalloc? ( !jemalloc )
+ jemalloc? ( !tcmalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.3-{shared,config}.patch
+
+ # bug 467172, 467174
+ sed -i -e 's:AR=:AR?=:g' -e 's:RANLIB=:RANLIB?=:g' "${S}/deps/lua/src/Makefile" || die
+
+ # 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-2.2 configure.ac
+ sed -i -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoconf
+}
+
+src_configure() {
+ econf
+
+ # 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" redis
+ newinitd "${FILESDIR}/redis.initd-3" redis
+
+ systemd_dounit "${FILESDIR}/redis.service"
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ nonfatal dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-dump
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym /usr/sbin/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
+}