aboutsummaryrefslogtreecommitdiffstats
path: root/databases/redis-devel
diff options
context:
space:
mode:
authorosa <osa@FreeBSD.org>2012-07-18 02:23:25 +0800
committerosa <osa@FreeBSD.org>2012-07-18 02:23:25 +0800
commit66c5beaf6d2110a796fc7a6fe3bf69e5fc1a8736 (patch)
treeac0a2d4a91e860ead575e27cf3dfcb4aaf7bba47 /databases/redis-devel
parent991453766de0478f7a911db9199d344cb26bc253 (diff)
downloadfreebsd-ports-gnome-66c5beaf6d2110a796fc7a6fe3bf69e5fc1a8736.tar.gz
freebsd-ports-gnome-66c5beaf6d2110a796fc7a6fe3bf69e5fc1a8736.tar.zst
freebsd-ports-gnome-66c5beaf6d2110a796fc7a6fe3bf69e5fc1a8736.zip
Readding the removed port redis-devel.
Update to the latest development version 2.6.0-rc5.
Diffstat (limited to 'databases/redis-devel')
-rw-r--r--databases/redis-devel/Makefile64
-rw-r--r--databases/redis-devel/distinfo2
-rw-r--r--databases/redis-devel/files/patch-deps::Makefile17
-rw-r--r--databases/redis-devel/files/patch-deps::hiredis::Makefile41
-rw-r--r--databases/redis-devel/files/patch-redis.conf34
-rw-r--r--databases/redis-devel/files/patch-src::Makefile31
-rw-r--r--databases/redis-devel/files/patch-src::config.h11
-rw-r--r--databases/redis-devel/files/patch-src::mkreleasehdr.sh11
-rw-r--r--databases/redis-devel/files/pkg-install.in85
-rw-r--r--databases/redis-devel/files/pkg-message.in8
-rw-r--r--databases/redis-devel/files/redis.in34
-rw-r--r--databases/redis-devel/pkg-descr19
-rw-r--r--databases/redis-devel/pkg-plist17
13 files changed, 374 insertions, 0 deletions
diff --git a/databases/redis-devel/Makefile b/databases/redis-devel/Makefile
new file mode 100644
index 000000000000..38c7f07e785e
--- /dev/null
+++ b/databases/redis-devel/Makefile
@@ -0,0 +1,64 @@
+# New ports collection makefile for: redis
+# Date created: 03 Jul 2009
+# Whom: Sergey Skvortsov <skv@protey.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= redis
+DISTVERSION= 2.6.0-rc5
+CATEGORIES= databases
+MASTER_SITES= GOOGLE_CODE
+PKGNAMESUFFIX= -devel
+
+MAINTAINER= osa@FreeBSD.org
+COMMENT= A persistent key-value database with built-in net interface
+
+LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
+
+CFLAGS+= -I${LOCALBASE}/include
+
+CONFLICTS?= redis-2.4.* redis-scripting-2.*
+
+USE_GMAKE= yes
+MAKE_ENV= "V=yo"
+USE_RC_SUBR= redis
+BIN_FILES= redis-benchmark redis-check-aof redis-check-dump \
+ redis-cli redis-server
+
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
+USERS= redis
+GROUPS= redis
+
+REDIS_DBDIR?= /var/db/redis
+REDIS_RUNDIR?= /var/run/redis
+REDIS_LOGDIR?= /var/log/redis
+
+SUB_FILES= pkg-message
+SUB_LIST+= PORTNAME="${PORTNAME}" \
+ REDIS_USER=${USERS} \
+ REDIS_DBDIR=${REDIS_DBDIR} \
+ REDIS_LOGDIR=${REDIS_LOGDIR} \
+ REDIS_RUNDIR=${REDIS_RUNDIR}
+
+PLIST_SUB+= REDIS_USER=${USERS} \
+ REDIS_GROUP=${GROUPS} \
+ REDIS_LOGDIR=${REDIS_LOGDIR} \
+ REDIS_DBDIR=${REDIS_DBDIR} \
+ REDIS_RUNDIR=${REDIS_RUNDIR}
+
+post-build:
+ ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${WRKSRC}/redis.conf > ${WRKDIR}/redis.conf
+
+do-install:
+ ${INSTALL_PROGRAM} ${BIN_FILES:C!^!${WRKSRC}/src/!} ${PREFIX}/bin/
+ ${INSTALL_DATA} ${WRKDIR}/redis.conf ${PREFIX}/etc/redis.conf.sample
+
+post-install:
+.for d in ${REDIS_LOGDIR} ${REDIS_RUNDIR} ${REDIS_DBDIR}
+ [ -d ${d} ] || ${MKDIR} ${d} && ${CHOWN} ${USERS}:${GROUPS} ${d}
+.endfor
+
+.include <bsd.port.mk>
diff --git a/databases/redis-devel/distinfo b/databases/redis-devel/distinfo
new file mode 100644
index 000000000000..8b866d5ae939
--- /dev/null
+++ b/databases/redis-devel/distinfo
@@ -0,0 +1,2 @@
+SHA256 (redis-2.6.0-rc5.tar.gz) = f6252f13d1e0542a7f3797ff9da517c0dea6855b74490ddc625ca288c8473e9f
+SIZE (redis-2.6.0-rc5.tar.gz) = 965683
diff --git a/databases/redis-devel/files/patch-deps::Makefile b/databases/redis-devel/files/patch-deps::Makefile
new file mode 100644
index 000000000000..793a03c9bc61
--- /dev/null
+++ b/databases/redis-devel/files/patch-deps::Makefile
@@ -0,0 +1,17 @@
+--- deps/Makefile.orig 2012-07-02 04:18:07.000000000 +0400
++++ deps/Makefile 2012-07-02 04:18:56.000000000 +0400
+@@ -58,12 +58,12 @@
+ LUA_CFLAGS= -D__C99FEATURES__=1
+ endif
+
+-LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI $(CFLAGS)
++LUA_CFLAGS+= -Wall -DLUA_ANSI $(CFLAGS)
+ LUA_LDFLAGS+= $(LDFLAGS)
+
+ lua: .make-prerequisites
+ @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+- cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)"
++ cd lua/src && $(MAKE) all CC="$(CC)" CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)"
+
+ .PHONY: lua
+
diff --git a/databases/redis-devel/files/patch-deps::hiredis::Makefile b/databases/redis-devel/files/patch-deps::hiredis::Makefile
new file mode 100644
index 000000000000..b0cfcd406885
--- /dev/null
+++ b/databases/redis-devel/files/patch-deps::hiredis::Makefile
@@ -0,0 +1,41 @@
+--- deps/hiredis/Makefile.orig 2012-02-22 17:23:43.000000000 +0400
++++ deps/hiredis/Makefile 2012-02-24 16:46:44.000000000 +0400
+@@ -12,10 +12,10 @@
+
+ # Fallback to gcc when $CC is not in $PATH.
+ CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
+-OPTIMIZATION?=-O3
++#OPTIMIZATION?=-O3
+ WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings
+-DEBUG?= -g -ggdb
+-REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH)
++#DEBUG?= -g -ggdb
++REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG)
+ REAL_LDFLAGS=$(LDFLAGS) $(ARCH)
+
+ DYLIBSUFFIX=so
+@@ -34,6 +34,15 @@
+ DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
+ INSTALL= cp -r
+ endif
++ifeq ($(uname_S),FreeBSD)
++ CFLAGS?=$(CFLAGS)
++ CCLINK?=-pthread
++ LDFLAGS?=-L. -Wl,-rpath,.
++ DYLIBNAME?=libhiredis.so
++ DYLIB_MAKE_CMD?=$(CC) -o ${DYLIBNAME} ${OBJ}
++ STLIBNAME?=libhiredis.a
++ STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
++endif
+ ifeq ($(uname_S),Darwin)
+ DYLIBSUFFIX=dylib
+ DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX)
+@@ -104,7 +113,7 @@
+ $(CC) -MM *.c
+
+ # Installation related variables and target
+-PREFIX?=/usr/local
++PREFIX?=${PREFIX}
+ INCLUDE_PATH?=include/hiredis
+ LIBRARY_PATH?=lib
+ INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH)
diff --git a/databases/redis-devel/files/patch-redis.conf b/databases/redis-devel/files/patch-redis.conf
new file mode 100644
index 000000000000..d105b89a9e95
--- /dev/null
+++ b/databases/redis-devel/files/patch-redis.conf
@@ -0,0 +1,34 @@
+--- redis.conf.orig 2010-07-02 16:00:49.000000000 +0400
++++ redis.conf 2010-07-02 16:01:46.000000000 +0400
+@@ -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_RUNDIR%%/redis.pid
+
+ # Accept connections on the specified port, default is 6379
+ port 6379
+@@ -42,7 +42,7 @@
+ # 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
+
+ # Set the number of databases. The default database is DB 0, you can select
+ # a different one on a per-connection basis using SELECT <dbid> where
+@@ -86,7 +86,7 @@
+ # 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 %%REDIS_DBDIR%%/
+
+ ################################# REPLICATION #################################
+
diff --git a/databases/redis-devel/files/patch-src::Makefile b/databases/redis-devel/files/patch-src::Makefile
new file mode 100644
index 000000000000..b7386ebfa344
--- /dev/null
+++ b/databases/redis-devel/files/patch-src::Makefile
@@ -0,0 +1,31 @@
+--- src/Makefile.orig 2012-06-15 15:44:17.000000000 +0400
++++ src/Makefile 2012-07-02 04:11:38.000000000 +0400
+@@ -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
++DEPENDENCY_TARGETS=hiredis linenoise lua
+
+ # Default settings
+ STD= -std=c99 -pedantic
+@@ -50,6 +50,10 @@
+ FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) -g -ggdb
+ FINAL_LIBS= -ldl -lnsl -lsocket -lm -lpthread
+ DEBUG= -g -ggdb
++else ifeq ($(uname_S),FreeBSD)
++ FINAL_CFLAGS?= $(CFLAGS) $(REDIS_CFLAGS) -I${PREFIX}/include
++ FINAL_LDFLAGS= -pthread -L$(PREFIX)/lib
++ FINAL_LIBS= -lm -lexecinfo
+ else
+ FINAL_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+ FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) -g -rdynamic -ggdb
+@@ -79,7 +83,7 @@
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
+ REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
+
+-PREFIX?=/usr/local
++PREFIX:=${PREFIX}
+ INSTALL_BIN= $(PREFIX)/bin
+ INSTALL= cp -pf
+
diff --git a/databases/redis-devel/files/patch-src::config.h b/databases/redis-devel/files/patch-src::config.h
new file mode 100644
index 000000000000..ae6f5cb4fde2
--- /dev/null
+++ b/databases/redis-devel/files/patch-src::config.h
@@ -0,0 +1,11 @@
+--- src/config.h.orig 2012-02-24 16:56:36.000000000 +0400
++++ src/config.h 2012-02-24 16:57:01.000000000 +0400
+@@ -25,7 +25,7 @@
+ #endif
+
+ /* Test for backtrace() */
+-#if defined(__APPLE__) || defined(__linux__) || defined(__sun)
++#if defined(__APPLE__) || defined(__linux__) || defined(__sun) || defined(__FreeBSD__)
+ #define HAVE_BACKTRACE 1
+ #endif
+
diff --git a/databases/redis-devel/files/patch-src::mkreleasehdr.sh b/databases/redis-devel/files/patch-src::mkreleasehdr.sh
new file mode 100644
index 000000000000..2d818f69198b
--- /dev/null
+++ b/databases/redis-devel/files/patch-src::mkreleasehdr.sh
@@ -0,0 +1,11 @@
+--- src/mkreleasehdr.sh.orig 2010-12-24 09:37:11.000000000 +0300
++++ src/mkreleasehdr.sh 2010-12-24 09:37:16.000000000 +0300
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+-GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
+-GIT_DIRTY=`git diff 2> /dev/null | wc -l`
++GIT_SHA1="00000000"
++GIT_DIRTY="0"
+ test -f release.h || touch release.h
+ (cat release.h | grep SHA1 | grep $GIT_SHA1) && \
+ (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already uptodate
diff --git a/databases/redis-devel/files/pkg-install.in b/databases/redis-devel/files/pkg-install.in
new file mode 100644
index 000000000000..9eec80ea70f9
--- /dev/null
+++ b/databases/redis-devel/files/pkg-install.in
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+USER="%%REDIS_USER%%"
+USER_ID="%%REDIS_UID%%"
+GROUP="%%REDIS_GROUP%%"
+GROUP_ID="%%REDIS_GID%%"
+
+RUNTIME_DIRS="%%REDIS_LOGDIR%% %%REDIS_DBDIR%% %%REDIS_RUNDIR%%"
+
+case $2 in
+PRE-INSTALL)
+
+if [ `id -u` -ne 0 ]; then
+ echo; echo "You must be root to run this step!"; echo; echo
+ exit 1
+fi
+
+RES=`pw groupshow -n ${GROUP} 2>/dev/null`
+if [ $? -eq 0 ]; then
+ echo "You already have a group \"${GROUP}\", so we will use it."
+else
+ RES=`pw groupshow -g ${GROUP_ID} 2>/dev/null`
+ if [ $? -ne 0 ]; then
+ _GID="-g ${GROUP_ID}"
+ else
+ _GID=''
+ fi
+
+ if pw groupadd -n ${GROUP} ${_GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+RES=`id -u ${USER} 2>/dev/null`
+if [ $? -ne 0 ]; then
+ RES=`id -un ${USER_ID} 2>/dev/null`
+ if [ $? -ne 0 ]; then
+ _UID="-u ${USER_ID}"
+ else
+ _UID=''
+ fi
+
+ if pw useradd -n ${USER} ${_UID} -g ${GROUP} \
+ -w no -s /usr/sbin/nologin; then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+
+;;
+
+POST-INSTALL)
+
+for DIR in ${RUNTIME_DIRS}; do
+ mkdir -p ${DIR}
+ chown -R ${USER}:${GROUP} ${DIR}
+ chmod -R 755 ${DIR}
+done
+
+;;
+
+DEINSTALL)
+
+if [ -z ${UPGRADE_PORT} ] ; then
+
+ echo
+ echo "If you do not intend to reinstall \"%%PORTNAME%%\" you should manually"
+ echo "remove user '${USER}' (uid='${USER_ID}') and group '${GROUP}' (gid='${USER_ID}')."
+ echo
+ echo "Also you may want to remove the no longer required directoris:"
+ echo ${RUNTIME_DIRS}
+ echo
+
+fi
+
+esac
diff --git a/databases/redis-devel/files/pkg-message.in b/databases/redis-devel/files/pkg-message.in
new file mode 100644
index 000000000000..fd3763137ea3
--- /dev/null
+++ b/databases/redis-devel/files/pkg-message.in
@@ -0,0 +1,8 @@
+
+===> CONFIGURATION NOTE:
+
+ To setup "%%PORTNAME%%" you need to edit the configuration file:
+ %%PREFIX%%/etc/%%PORTNAME%%.conf
+
+ To run redis from startup, add %%PORTNAME%%_enable="YES"
+ in your /etc/rc.conf.
diff --git a/databases/redis-devel/files/redis.in b/databases/redis-devel/files/redis.in
new file mode 100644
index 000000000000..0e232f79f251
--- /dev/null
+++ b/databases/redis-devel/files/redis.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: redis
+# REQUIRE: LOGIN
+# BEFORE: securelevel
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `redis':
+#
+#redis_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="redis"
+rcvar=`set_rcvar`
+
+extra_commands="reload"
+
+command="%%PREFIX%%/bin/redis-server"
+config_file="%%PREFIX%%/etc/$name.conf"
+command_args="${config_file}"
+pidfile="%%REDIS_RUNDIR%%/$name.pid"
+required_files="${config_file}"
+
+# read configuration and set defaults
+load_rc_config "$name"
+: ${redis_enable="NO"}
+: ${redis_user="%%REDIS_USER%%"}
+
+run_rc_command "$1"
diff --git a/databases/redis-devel/pkg-descr b/databases/redis-devel/pkg-descr
new file mode 100644
index 000000000000..e034aa3723ba
--- /dev/null
+++ b/databases/redis-devel/pkg-descr
@@ -0,0 +1,19 @@
+Redis is an open source, advanced key-value store. It is often referred
+to as a data structure server since keys can contain strings, hashes,
+lists, sets and sorted sets.
+
+You can run atomic operations on these types, like appending to a string;
+incrementing the value in a hash; pushing to a list; computing set
+intersection, union and difference; or getting the member with highest
+ranking in a sorted set.
+
+In order to achieve its outstanding performance, Redis works with an
+in-memory dataset. Depending on your use case, you can persist it either
+by dumping the dataset to disk every once in a while, or by appending each
+command to a log.
+
+Redis also supports trivial-to-setup master-slave replication, with very
+fast non-blocking first synchronization, auto-reconnection on net split
+and so forth.
+
+WWW: http://redis.io/
diff --git a/databases/redis-devel/pkg-plist b/databases/redis-devel/pkg-plist
new file mode 100644
index 000000000000..44ea4d80f6e5
--- /dev/null
+++ b/databases/redis-devel/pkg-plist
@@ -0,0 +1,17 @@
+bin/redis-benchmark
+bin/redis-check-aof
+bin/redis-check-dump
+bin/redis-cli
+bin/redis-server
+@unexec (cmp -s %D/etc/redis.conf %D/etc/redis.conf.sample && rm -f %D/etc/redis.conf) || true
+etc/redis.conf.sample
+@exec [ -f %B/redis.conf ] || cp %B/%f %B/redis.conf
+@exec [ -d %%REDIS_DBDIR%% ] || mkdir -p %%REDIS_DBDIR%%
+@exec chown %%REDIS_USER%%:%%REDIS_GROUP%% %%REDIS_DBDIR%%
+@unexec if [ -z ${UPGRADE_PORT} ] ; then rmdir %%REDIS_DBDIR%% 2>/dev/null; fi
+@exec [ -d %%REDIS_LOGDIR%% ] || mkdir -p %%REDIS_LOGDIR%%
+@exec chown %%REDIS_USER%%:%%REDIS_GROUP%% %%REDIS_LOGDIR%%
+@unexec if [ -z ${UPGRADE_PORT} ] ; then rmdir %%REDIS_LOGDIR%% 2>/dev/null; fi
+@exec [ -d %%REDIS_RUNDIR%% ] || mkdir -p %%REDIS_RUNDIR%%
+@exec chown %%REDIS_USER%%:%%REDIS_GROUP%% %%REDIS_RUNDIR%%
+@unexec if [ -z ${UPGRADE_PORT} ] ; then rmdir %%REDIS_RUNDIR%% 2>/dev/null; fi