From 216d19ccf7e12a967f032dee2b294b1ef9fbc032 Mon Sep 17 00:00:00 2001 From: mspo Date: Thu, 13 Jun 2013 17:41:34 +0000 Subject: Import redis from wip! Redis is a persistent key-value database with built-in net interface --- databases/redis/DESCR | 6 ++++ databases/redis/Makefile | 68 +++++++++++++++++++++++++++++++++++++++ databases/redis/PLIST | 69 ++++++++++++++++++++++++++++++++++++++++ databases/redis/TODO | 4 +++ databases/redis/distinfo | 7 ++++ databases/redis/files/redis.sh | 25 +++++++++++++++ databases/redis/patches/patch-ab | 17 ++++++++++ databases/redis/patches/patch-ac | 38 ++++++++++++++++++++++ 8 files changed, 234 insertions(+) create mode 100644 databases/redis/DESCR create mode 100644 databases/redis/Makefile create mode 100644 databases/redis/PLIST create mode 100644 databases/redis/TODO create mode 100644 databases/redis/distinfo create mode 100644 databases/redis/files/redis.sh create mode 100644 databases/redis/patches/patch-ab create mode 100644 databases/redis/patches/patch-ac (limited to 'databases/redis') diff --git a/databases/redis/DESCR b/databases/redis/DESCR new file mode 100644 index 00000000000..591452f6cca --- /dev/null +++ b/databases/redis/DESCR @@ -0,0 +1,6 @@ +Redis is an advanced key-value store. It is similar to memcached but the +dataset is not volatile, and values can be strings, exactly like in memcached, +but also lists, sets, and ordered sets. All this data types can be manipulated +with atomic operations to push/pop elements, add/remove elements, perform +server side union, intersection, difference between sets, and so forth. Redis +supports different kind of sorting abilities. diff --git a/databases/redis/Makefile b/databases/redis/Makefile new file mode 100644 index 00000000000..18ccd7b1fbd --- /dev/null +++ b/databases/redis/Makefile @@ -0,0 +1,68 @@ +# $NetBSD: Makefile,v 1.1 2013/06/13 17:41:34 mspo Exp $ +# + +DISTNAME= redis-2.6.13 +CATEGORIES= databases +MASTER_SITES= http://redis.googlecode.com/files/ + +MAINTAINER= filip@joyent.com +HOMEPAGE= http://redis.io/ +COMMENT= Persistent key-value database with built-in net interface +LICENSE= modified-bsd + +USE_TOOLS+= gmake pax +USE_LANGUAGES= c99 + +.include "../../mk/bsd.prefs.mk" + +RCD_SCRIPTS+= redis +RCD_SCRIPT_SRC.redis= ${FILESDIR}/redis.sh + +DOCDIR= share/doc/redis +DOCFILES+= 00-RELEASENOTES BUGS COPYING \ + README +EGDIR= ${PREFIX}/share/examples/${PKGBASE} +INSTALLATION_DIRS+= bin ${DOCDIR} ${EGDIR} ${EGDIR}/utils ${EGDIR}/tests +CONF_FILES= ${EGDIR}/redis.conf.example ${PKG_SYSCONFDIR}/redis.conf + +BUILD_DEFS+= VARBASE REDIS_USER REDIS_GROUP REDIS_DATADIR +BUILD_DEFS+= REDIS_LOGDIR REDIS_PIDDIR + +REDIS_USER?= redis +REDIS_GROUP?= redis +REDIS_DATADIR?= ${VARBASE}/db/redis +REDIS_LOGDIR?= ${VARBASE}/log/redis +REDIS_PIDDIR?= ${VARBASE}/run + +OWN_DIRS+= ${REDIS_DATADIR} ${REDIS_LOGDIR} +OWN_DIRS_PERMS+= ${REDIS_DATADIR} ${REDIS_USER} ${REDIS_GROUP} 0770 +OWN_DIRS_PERMS+= ${REDIS_LOGDIR} ${REDIS_USER} ${REDIS_GROUP} 0770 + +PKG_GROUPS+= ${REDIS_GROUP} +PKG_USERS+= ${REDIS_USER}:${REDIS_GROUP} +PKG_GECOS.${REDIS_USER}= Redis daemon user +PKG_HOME.${REDIS_USER}= ${REDIS_DBDIR} + +FILES_SUBST+= REDIS_USER=${REDIS_USER} + +SUBST_CLASSES+= fix-paths +SUBST_STAGE.fix-paths= post-patch +SUBST_MESSAGE.fix-paths= Fixing paths. +SUBST_FILES.fix-paths= redis.conf +SUBST_VARS.fix-paths= REDIS_DATADIR REDIS_LOGDIR REDIS_PIDDIR + +post-extract: + ${CHMOD} -R g-w ${WRKSRC} + +post-install: + ${INSTALL_DATA} ${WRKSRC}/redis.conf ${DESTDIR}${EGDIR}/redis.conf.example +.for file in ${DOCFILES} + ${INSTALL_DATA} ${WRKSRC}/${file} ${DESTDIR}${PREFIX}/${DOCDIR}/${file} +.endfor + cd ${WRKSRC}/utils && pax -rwpp . ${DESTDIR}${EGDIR}/utils/ + cd ${WRKSRC}/tests && pax -rwpp . ${DESTDIR}${EGDIR}/tests/ + +do-test: + cd ${WRKSRC} && ${SH} runtest + +.include "../../mk/bsd.pkg.mk" diff --git a/databases/redis/PLIST b/databases/redis/PLIST new file mode 100644 index 00000000000..22d24505f1d --- /dev/null +++ b/databases/redis/PLIST @@ -0,0 +1,69 @@ +@comment $NetBSD: PLIST,v 1.1 2013/06/13 17:41:34 mspo Exp $ +bin/redis-benchmark +bin/redis-check-aof +bin/redis-check-dump +bin/redis-cli +bin/redis-server +share/doc/redis/00-RELEASENOTES +share/doc/redis/BUGS +share/doc/redis/COPYING +share/doc/redis/README +share/examples/rc.d/redis +share/examples/redis/redis.conf.example +share/examples/redis/tests/assets/default.conf +share/examples/redis/tests/assets/encodings.rdb +share/examples/redis/tests/assets/hash-zipmap.rdb +share/examples/redis/tests/helpers/bg_complex_data.tcl +share/examples/redis/tests/helpers/gen_write_load.tcl +share/examples/redis/tests/integration/aof-race.tcl +share/examples/redis/tests/integration/aof.tcl +share/examples/redis/tests/integration/convert-zipmap-hash-on-load.tcl +share/examples/redis/tests/integration/rdb.tcl +share/examples/redis/tests/integration/redis-cli.tcl +share/examples/redis/tests/integration/replication-2.tcl +share/examples/redis/tests/integration/replication-3.tcl +share/examples/redis/tests/integration/replication-4.tcl +share/examples/redis/tests/integration/replication.tcl +share/examples/redis/tests/support/redis.tcl +share/examples/redis/tests/support/server.tcl +share/examples/redis/tests/support/test.tcl +share/examples/redis/tests/support/tmpfile.tcl +share/examples/redis/tests/support/util.tcl +share/examples/redis/tests/test_helper.tcl +share/examples/redis/tests/tmp/.gitignore +share/examples/redis/tests/unit/aofrw.tcl +share/examples/redis/tests/unit/auth.tcl +share/examples/redis/tests/unit/basic.tcl +share/examples/redis/tests/unit/bitops.tcl +share/examples/redis/tests/unit/dump.tcl +share/examples/redis/tests/unit/expire.tcl +share/examples/redis/tests/unit/introspection.tcl +share/examples/redis/tests/unit/limits.tcl +share/examples/redis/tests/unit/maxmemory.tcl +share/examples/redis/tests/unit/multi.tcl +share/examples/redis/tests/unit/obuf-limits.tcl +share/examples/redis/tests/unit/other.tcl +share/examples/redis/tests/unit/printver.tcl +share/examples/redis/tests/unit/protocol.tcl +share/examples/redis/tests/unit/pubsub.tcl +share/examples/redis/tests/unit/quit.tcl +share/examples/redis/tests/unit/scripting.tcl +share/examples/redis/tests/unit/slowlog.tcl +share/examples/redis/tests/unit/sort.tcl +share/examples/redis/tests/unit/type/hash.tcl +share/examples/redis/tests/unit/type/list-2.tcl +share/examples/redis/tests/unit/type/list-3.tcl +share/examples/redis/tests/unit/type/list-common.tcl +share/examples/redis/tests/unit/type/list.tcl +share/examples/redis/tests/unit/type/set.tcl +share/examples/redis/tests/unit/type/zset.tcl +share/examples/redis/utils/build-static-symbols.tcl +share/examples/redis/utils/generate-command-help.rb +share/examples/redis/utils/install_server.sh +share/examples/redis/utils/mkrelease.sh +share/examples/redis/utils/redis-copy.rb +share/examples/redis/utils/redis-sha1.rb +share/examples/redis/utils/redis_init_script +share/examples/redis/utils/redis_init_script.tpl +share/examples/redis/utils/speed-regression.tcl +share/examples/redis/utils/whatisdoing.sh diff --git a/databases/redis/TODO b/databases/redis/TODO new file mode 100644 index 00000000000..3df6127bb80 --- /dev/null +++ b/databases/redis/TODO @@ -0,0 +1,4 @@ +CVE-2013-0178 +CVE-2013-0180 + +On a pkgsrc default install, redis listens to more than localhost. diff --git a/databases/redis/distinfo b/databases/redis/distinfo new file mode 100644 index 00000000000..e9537779233 --- /dev/null +++ b/databases/redis/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2013/06/13 17:41:34 mspo Exp $ + +SHA1 (redis-2.6.13.tar.gz) = 2ef8ea6a67465b6c5a5ea49241313d3dbc0de11b +RMD160 (redis-2.6.13.tar.gz) = 1ec794536cb0d920b1fdabebf4c372a1320ab0e9 +Size (redis-2.6.13.tar.gz) = 994331 bytes +SHA1 (patch-ab) = 1faa0907ec5a47fb1f4f325a3002725006477466 +SHA1 (patch-ac) = 51f06c5a0724cadd19acca5f8319d652d70bb251 diff --git a/databases/redis/files/redis.sh b/databases/redis/files/redis.sh new file mode 100644 index 00000000000..74cfa247a6d --- /dev/null +++ b/databases/redis/files/redis.sh @@ -0,0 +1,25 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: redis.sh,v 1.1 2013/06/13 17:41:34 mspo Exp $ +# +# PROVIDE: redis +# REQUIRE: DAEMON network +# KEYWORD: shutdown + +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="redis" +rcvar=$name +command="@PREFIX@/bin/redis-server" +redis_user="@REDIS_USER@" +command_args="@PKG_SYSCONFDIR@/${name}.conf" + +if [ -f /etc/rc.subr ]; then + load_rc_config $name + run_rc_command "$1" +else + echo -n "${name}" + @SU@ -m ${redis_user} -c "${command} ${command_args}" +fi diff --git a/databases/redis/patches/patch-ab b/databases/redis/patches/patch-ab new file mode 100644 index 00000000000..e59b7f0a6f3 --- /dev/null +++ b/databases/redis/patches/patch-ab @@ -0,0 +1,17 @@ +$NetBSD: patch-ab,v 1.1 2013/06/13 17:41:34 mspo Exp $ + +* Add DESTDIR support. + +--- src/Makefile.orig 2012-12-03 11:53:09.000000000 +0000 ++++ src/Makefile +@@ -81,8 +81,8 @@ REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFL + REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL) + + PREFIX?=/usr/local +-INSTALL_BIN= $(PREFIX)/bin +-INSTALL= cp -pf ++INSTALL_BIN= $(DESTDIR)$(PREFIX)/bin ++INSTALL= $(BSD_INSTALL_PROGRAM) + + CCCOLOR="\033[34m" + LINKCOLOR="\033[34;1m" diff --git a/databases/redis/patches/patch-ac b/databases/redis/patches/patch-ac new file mode 100644 index 00000000000..db30386b933 --- /dev/null +++ b/databases/redis/patches/patch-ac @@ -0,0 +1,38 @@ +$NetBSD: patch-ac,v 1.1 2013/06/13 17:41:34 mspo Exp $ + +Sane defaults for the config file. + +--- redis.conf.orig 2013-04-30 13:15:56.000000000 +0000 ++++ 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 @REDIS_PIDDIR@/redis.pid + + # Accept connections on the specified port, default is 6379. + # If port 0 is specified Redis will not listen on a TCP socket. +@@ -66,7 +66,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 @REDIS_LOGDIR@/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. +@@ -150,7 +150,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 @REDIS_DATADIR@ + + ################################# REPLICATION ################################# + -- cgit v1.2.3