Index: head/databases/redis/Makefile =================================================================== --- head/databases/redis/Makefile (revision 400427) +++ head/databases/redis/Makefile (revision 400428) @@ -1,108 +1,109 @@ # Created by: Sergey Skvortsov # $FreeBSD$ PORTNAME= redis DISTVERSION= 3.0.5 +PORTREVISION= 1 CATEGORIES= databases MASTER_SITES= http://download.redis.io/releases/ MAINTAINER= osa@FreeBSD.org COMMENT= Persistent key-value database with built-in net interface LICENSE= BSD3CLAUSE USES= execinfo OPTIONS_DEFINE= TESTS TRIB OPTIONS_RADIO= EXTLUA OPTIONS_RADIO_EXTLUA= LUA LUAJIT OPTIONS_SUB= yes LUA_DESC= Use lang/lua instead of builtin lua LUAJIT_DESC= Use lang/luajit instead of builtin lua TESTS_DESC= Install lang/tcl for redis unit tests TRIB_DESC= Install redis-trib.rb (lang/ruby req.) .include .if ${PORT_OPTIONS:MTRIB} CATEGORIES+= ruby USE_RUBY= yes RUN_DEPENDS= rubygem-redis>=2.2:${PORTSDIR}/databases/rubygem-redis .endif .if ${PORT_OPTIONS:MLUA} USES+= lua:51 EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-Makefile.lua .endif .if ${PORT_OPTIONS:MLUAJIT} LIB_DEPENDS+= libluajit-5.1.so:${PORTSDIR}/lang/luajit EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-Makefile.luajit .endif .if ${PORT_OPTIONS:MLUA} || ${PORT_OPTIONS:MLUAJIT} CFLAGS+= -fPIC LDFLAGS+= -Wl,-E .endif .if ${PORT_OPTIONS:MTESTS} USES+= tcl:build .endif CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib -lpthread -lm -lexecinfo CONFLICTS?= redis-devel-3.* USES+= gmake MAKE_ENV= "V=yo" -USE_RC_SUBR= redis +USE_RC_SUBR= redis sentinel BIN_FILES= redis-benchmark redis-check-aof redis-check-dump \ redis-cli redis-sentinel 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} .if ${PORT_OPTIONS:MLUAJIT} || ${PORT_OPTIONS:MLUA} post-patch: @cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/ .endif 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/!} ${STAGEDIR}${PREFIX}/bin/ .if ${PORT_OPTIONS:MTRIB} ${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/ .endif ${INSTALL_DATA} ${WRKDIR}/redis.conf ${STAGEDIR}${PREFIX}/etc/redis.conf.sample ${INSTALL_DATA} ${WRKSRC}/sentinel.conf ${STAGEDIR}${PREFIX}/etc/sentinel.conf.sample ${MKDIR} ${STAGEDIR}${REDIS_LOGDIR} \ ${STAGEDIR}${REDIS_DBDIR} \ ${STAGEDIR}${REDIS_RUNDIR} regression-test: build @cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl .include Index: head/databases/redis/files/sentinel.in =================================================================== --- head/databases/redis/files/sentinel.in (nonexistent) +++ head/databases/redis/files/sentinel.in (revision 400428) @@ -0,0 +1,42 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sentinel +# REQUIRE: LOGIN +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `sentinel': +# +#sentinel_enable="YES" +# + +. /etc/rc.subr + +name="sentinel" +rcvar="${name}_enable" + +command="/usr/local/bin/redis-sentinel" +pidfile="/var/run/redis/$name.pid" + +# read configuration and set defaults +load_rc_config "$name" +: ${sentinel_enable="NO"} +: ${sentinel_user="redis"} +: ${sentinel_config="/usr/local/etc/$name.conf"} + +command_args="${sentinel_config} --daemonize yes --pidfile ${pidfile}" +required_files="${sentinel_config}" +start_precmd="${name}_checks" +restart_precmd="${name}_checks" + +sentinel_checks() +{ + if [ x`id -u ${sentinel_user}` != x`stat -f %u ${sentinel_config}` ]; then + err 1 "${sentinel_config} must be owned by user ${sentinel_user}" + fi +} + +run_rc_command "$1" Property changes on: head/databases/redis/files/sentinel.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/databases/redis/pkg-plist =================================================================== --- head/databases/redis/pkg-plist (revision 400427) +++ head/databases/redis/pkg-plist (revision 400428) @@ -1,12 +1,12 @@ bin/redis-benchmark bin/redis-check-aof bin/redis-check-dump bin/redis-cli bin/redis-sentinel bin/redis-server %%TRIB%%bin/redis-trib.rb @sample etc/redis.conf.sample -@sample etc/sentinel.conf.sample +@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%% @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_LOGDIR%% @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_RUNDIR%% Index: head/databases/redis-devel/Makefile =================================================================== --- head/databases/redis-devel/Makefile (revision 400427) +++ head/databases/redis-devel/Makefile (revision 400428) @@ -1,109 +1,110 @@ # Created by: Sergey Skvortsov # $FreeBSD$ PORTNAME= redis DISTVERSION= 3.0.5 +PORTREVISION= 1 CATEGORIES= databases MASTER_SITES= http://download.redis.io/releases/ PKGNAMESUFFIX= -devel MAINTAINER= osa@FreeBSD.org COMMENT= Persistent key-value database with built-in net interface LICENSE= BSD3CLAUSE USES= execinfo OPTIONS_DEFINE= TESTS TRIB OPTIONS_RADIO= EXTLUA OPTIONS_RADIO_EXTLUA= LUA LUAJIT OPTIONS_SUB= yes LUA_DESC= Use lang/lua instead of builtin lua LUAJIT_DESC= Use lang/luajit instead of builtin lua TESTS_DESC= Install lang/tcl for redis unit tests TRIB_DESC= Install redis-trib.rb (lang/ruby req.) .include .if ${PORT_OPTIONS:MTRIB} CATEGORIES+= ruby USE_RUBY= yes RUN_DEPENDS= rubygem-redis>=2.2:${PORTSDIR}/databases/rubygem-redis .endif .if ${PORT_OPTIONS:MLUA} USES+= lua:51 EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-Makefile.lua .endif .if ${PORT_OPTIONS:MLUAJIT} LIB_DEPENDS+= libluajit-5.1.so:${PORTSDIR}/lang/luajit EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-Makefile.luajit .endif .if ${PORT_OPTIONS:MLUA} || ${PORT_OPTIONS:MLUAJIT} CFLAGS+= -fPIC LDFLAGS+= -Wl,-E .endif .if ${PORT_OPTIONS:MTESTS} USES+= tcl:build .endif CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib -lpthread -lm -lexecinfo CONFLICTS?= redis-3.* USES+= gmake MAKE_ENV= "V=yo" -USE_RC_SUBR= redis +USE_RC_SUBR= redis sentinel BIN_FILES= redis-benchmark redis-check-aof redis-check-dump \ redis-cli redis-sentinel 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} .if ${PORT_OPTIONS:MLUAJIT} || ${PORT_OPTIONS:MLUA} post-patch: @cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/ .endif 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/!} ${STAGEDIR}${PREFIX}/bin/ .if ${PORT_OPTIONS:MTRIB} ${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/ .endif ${INSTALL_DATA} ${WRKDIR}/redis.conf ${STAGEDIR}${PREFIX}/etc/redis.conf.sample ${INSTALL_DATA} ${WRKSRC}/sentinel.conf ${STAGEDIR}${PREFIX}/etc/sentinel.conf.sample ${MKDIR} ${STAGEDIR}${REDIS_LOGDIR} \ ${STAGEDIR}${REDIS_DBDIR} \ ${STAGEDIR}${REDIS_RUNDIR} regression-test: build @cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl .include Index: head/databases/redis-devel/files/sentinel.in =================================================================== --- head/databases/redis-devel/files/sentinel.in (nonexistent) +++ head/databases/redis-devel/files/sentinel.in (revision 400428) @@ -0,0 +1,42 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sentinel +# REQUIRE: LOGIN +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `sentinel': +# +#sentinel_enable="YES" +# + +. /etc/rc.subr + +name="sentinel" +rcvar="${name}_enable" + +command="/usr/local/bin/redis-sentinel" +pidfile="/var/run/redis/$name.pid" + +# read configuration and set defaults +load_rc_config "$name" +: ${sentinel_enable="NO"} +: ${sentinel_user="redis"} +: ${sentinel_config="/usr/local/etc/$name.conf"} + +command_args="${sentinel_config} --daemonize yes --pidfile ${pidfile}" +required_files="${sentinel_config}" +start_precmd="${name}_checks" +restart_precmd="${name}_checks" + +sentinel_checks() +{ + if [ x`id -u ${sentinel_user}` != x`stat -f %u ${sentinel_config}` ]; then + err 1 "${sentinel_config} must be owned by user ${sentinel_user}" + fi +} + +run_rc_command "$1" Property changes on: head/databases/redis-devel/files/sentinel.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/databases/redis-devel/pkg-plist =================================================================== --- head/databases/redis-devel/pkg-plist (revision 400427) +++ head/databases/redis-devel/pkg-plist (revision 400428) @@ -1,12 +1,12 @@ bin/redis-benchmark bin/redis-check-aof bin/redis-check-dump bin/redis-cli bin/redis-sentinel bin/redis-server %%TRIB%%bin/redis-trib.rb @sample etc/redis.conf.sample -@sample etc/sentinel.conf.sample +@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%% @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_LOGDIR%% @dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_RUNDIR%%