diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-31 13:53:04 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-31 13:53:04 +0200 |
commit | 33ccfa229d3230cdf7c48083db49ce5c2f8842f5 (patch) | |
tree | 100dba6f32adbef343f9e7b4ab6f9e1a80af9431 /testing | |
parent | ae10eeb740d8e4f5c4a9eddd348f9b30456ec604 (diff) | |
download | aports-33ccfa229d3230cdf7c48083db49ce5c2f8842f5.tar.bz2 aports-33ccfa229d3230cdf7c48083db49ce5c2f8842f5.tar.xz |
testing/redis: new aport
Advanced key-value store
http://redis.googlecode.com
Diffstat (limited to 'testing')
-rw-r--r-- | testing/redis/APKBUILD | 60 | ||||
-rw-r--r-- | testing/redis/redis.confd | 20 | ||||
-rw-r--r-- | testing/redis/redis.initd | 42 | ||||
-rw-r--r-- | testing/redis/redis.logrotate | 5 |
4 files changed, 127 insertions, 0 deletions
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 <vkrishn4@gmail.com> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +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 +} |