From 33ccfa229d3230cdf7c48083db49ce5c2f8842f5 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 31 May 2012 13:53:04 +0200 Subject: testing/redis: new aport Advanced key-value store http://redis.googlecode.com --- testing/redis/APKBUILD | 60 +++++++++++++++++++++++++++++++++++++++++++ testing/redis/redis.confd | 20 +++++++++++++++ testing/redis/redis.initd | 42 ++++++++++++++++++++++++++++++ testing/redis/redis.logrotate | 5 ++++ 4 files changed, 127 insertions(+) create mode 100644 testing/redis/APKBUILD create mode 100644 testing/redis/redis.confd create mode 100644 testing/redis/redis.initd create mode 100644 testing/redis/redis.logrotate (limited to 'testing') diff --git a/testing/redis/APKBUILD b/testing/redis/APKBUILD new file mode 100644 index 0000000000..6321569a56 --- /dev/null +++ b/testing/redis/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: V.Krishn +# Maintainer: Natanael Copa +pkgname=redis +pkgver=2.4.14 +pkgrel=0 +pkgdesc="Advanced key-value store" +url="http://redis.googlecode.com" +arch="all" +license="BSD" +depends="" +depends_dev="" +makedepends="" +install="" +subpackages="" +pkgusers="redis" +pkggroups="redis" +source="http://redis.googlecode.com/files/$pkgname-$pkgver.tar.gz + redis.initd + redis.logrotate + redis.confd" + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + cd "$_builddir" +} + +build() { + cd "$_builddir" + export CFLAGS="$CFLAGS -std=c99" + make PREFIX=/usr INSTALL_BIN="$pkgdir"/usr/bin \ + FORCE_LIBC_MALLOC=yes || return 1 +} + +package() { + cd "$_builddir" + mkdir -p "$pkgdir"/usr/bin + + install -D -m755 "$_builddir/COPYING" \ + "$pkgdir/usr/share/licenses/redis/COPYING" || return 1 + install -D -m755 "$srcdir/redis.initd" "$pkgdir/etc/init.d/redis" \ + && install -Dm644 "$srcdir/redis.logrotate" \ + "$pkgdir/etc/logrotate.d/redis" \ + && install -Dm644 "$srcdir/redis.confd" \ + "$pkgdir/etc/conf.d/redis" \ + || return 1 + sed -i -e 's|daemonize no|daemonize yes|' \ + -e 's|dir \./|dir /var/lib/redis/|' \ + -e 's|logfile stdout|logfile /var/log/redis.log|' \ + $_builddir/redis.conf || return 1 + install -D -m644 "$_builddir/redis.conf" "$pkgdir/etc/redis.conf" \ + || retrun 1 + + make INSTALL_BIN="$pkgdir/usr/bin" PREFIX=/usr install || return 1 +} + + +md5sums="1bc8f833b955ef119d643da08084433f redis-2.4.14.tar.gz +9aee4f445f4f6fcbc4475691f12e62af redis.initd +9e2d75b7a9dc421122d673fe520ef17f redis.logrotate +91c1be756ef41ab3a47a3573100bb335 redis.confd" diff --git a/testing/redis/redis.confd b/testing/redis/redis.confd new file mode 100644 index 0000000000..3ee35cbb9c --- /dev/null +++ b/testing/redis/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.pid" + +# Redis options. +# (Redis expects the first argument to be the configuration file.) +REDIS_OPTS="${REDIS_CONF}" diff --git a/testing/redis/redis.initd b/testing/redis/redis.initd new file mode 100644 index 0000000000..a23bcc774e --- /dev/null +++ b/testing/redis/redis.initd @@ -0,0 +1,42 @@ +#!/sbin/runscript + +REDIS_EXEC=/usr/bin/redis-server +REDIS_PID=${REDIS_PID:-/var/run/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} +REDIS_PORT=${REDIS_PORT:-6379} +REDIS_CLIEXEC=/usr/bin/redis-cli + +depend() { + use net localmount logger + after keepalived firewall +} + +start() { + + local PID_DIR=$(dirname ${REDIS_PID}) + checkpath -d -o ${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/testing/redis/redis.logrotate b/testing/redis/redis.logrotate new file mode 100644 index 0000000000..01d11422a5 --- /dev/null +++ b/testing/redis/redis.logrotate @@ -0,0 +1,5 @@ +/var/log/redis.log { + notifempty + copytruncate + missingok +} -- cgit v1.2.3