diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/redis |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/redis')
-rw-r--r-- | community/redis/PKGBUILD | 35 | ||||
-rw-r--r-- | community/redis/redis.d | 53 | ||||
-rw-r--r-- | community/redis/redis.logrotate | 5 |
3 files changed, 93 insertions, 0 deletions
diff --git a/community/redis/PKGBUILD b/community/redis/PKGBUILD new file mode 100644 index 000000000..2f90659f0 --- /dev/null +++ b/community/redis/PKGBUILD @@ -0,0 +1,35 @@ +# $Id: PKGBUILD 41768 2011-03-08 20:19:06Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Maintainer: Jan-Erik Rediger <badboy at archlinux dot us> +# Contributor: nofxx <x@<nick>.com> + +pkgname=redis +pkgver=2.2.2 +pkgrel=1 +pkgdesc="Advanced key-value store" +arch=('i686' 'x86_64') +url="http://code.google.com/p/redis" +license=('BSD') +depends=('bash') +makedepends=('gcc>=3.1' 'make' 'pkgconfig') +backup=("etc/redis.conf" + "etc/logrotate.d/redis") +source=("http://redis.googlecode.com/files/${pkgname}-${pkgver}.tar.gz" + "redis.d" + "redis.logrotate") +md5sums=('1c5b0d961da84a8f9b44a328b438549e' + 'bf61968d18d0e42529880f5c488ea9ed' + '9e2d75b7a9dc421122d673fe520ef17f') + +build() { + cd "$srcdir/${pkgname}-${pkgver}" + CFLAGS="$CFLAGS -std=c99" make + mkdir -p $pkgdir/usr/bin + make INSTALL_BIN="$pkgdir/usr/bin" PREFIX=/usr install + + install -D -m755 "$srcdir/${pkgname}-${pkgver}/COPYING" "$pkgdir/usr/share/licenses/redis/COPYING" + install -D -m755 "$srcdir/redis.d" "$pkgdir/etc/rc.d/redis" + install -Dm644 "$srcdir/redis.logrotate" "$pkgdir/etc/logrotate.d/redis" + sed -i 's|daemonize no|daemonize yes|;s|dir \./|dir /var/lib/redis/|;s|logfile stdout|logfile /var/log/redis.log| ' $srcdir/${pkgname}-${pkgver}/redis.conf + install -D -m644 "$srcdir/${pkgname}-${pkgver}/redis.conf" "$pkgdir/etc/redis.conf" +} diff --git a/community/redis/redis.d b/community/redis/redis.d new file mode 100644 index 000000000..333f45d6b --- /dev/null +++ b/community/redis/redis.d @@ -0,0 +1,53 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`cat /var/run/redis.pid 2>/dev/null` +case "$1" in + start) + stat_busy "Starting Redis Server" + [ -d /var/lib/redis ] || { mkdir /var/lib/redis; } + if [ -z "$PID" ]; then + /usr/bin/redis-server /etc/redis.conf >/dev/null + RESULT=$? + else + REDIS_PID=`pidof redis-server` + if [ -z "$REDIS_PID" ]; then + /usr/bin/redis-server /etc/redis.conf >/dev/null + RESULT=$? + elif [ `pidof redis-server` -eq $PID ]; then + RESULT=1 + else + /usr/bin/redis-server /etc/redis.conf >/dev/null + RESULT=$? + fi + fi + + if [ $RESULT -gt 0 ]; then + stat_fail + else + add_daemon redis + stat_done + fi + ;; + stop) + stat_busy "Stopping Redis Server" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm /var/run/redis.pid + rm_daemon redis + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/community/redis/redis.logrotate b/community/redis/redis.logrotate new file mode 100644 index 000000000..01d11422a --- /dev/null +++ b/community/redis/redis.logrotate @@ -0,0 +1,5 @@ +/var/log/redis.log { + notifempty + copytruncate + missingok +} |