packages: redis/redis-redis.conf.patch (NEW), redis/redis.init (NEW), redis...

glen glen at pld-linux.org
Sat Oct 9 13:34:20 CEST 2010


Author: glen                         Date: Sat Oct  9 11:34:20 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initial from https://bugzilla.redhat.com/show_bug.cgi?id=619237
  http://github.com/downloads/silas/rpms/redis-2.0.1-1.fc13.src.rpm

---- Files affected:
packages/redis:
   redis-redis.conf.patch (NONE -> 1.1)  (NEW), redis.init (NONE -> 1.1)  (NEW), redis.logrotate (NONE -> 1.1)  (NEW), redis.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/redis/redis-redis.conf.patch
diff -u /dev/null packages/redis/redis-redis.conf.patch:1.1
--- /dev/null	Sat Oct  9 13:34:20 2010
+++ packages/redis/redis-redis.conf.patch	Sat Oct  9 13:34:14 2010
@@ -0,0 +1,50 @@
+diff -up redis-2.0.0/redis.conf.orig redis-2.0.0/redis.conf
+--- redis-2.0.0/redis.conf.orig	2010-09-04 15:59:16.599206633 -0400
++++ redis-2.0.0/redis.conf	2010-09-04 16:01:59.234209087 -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 /var/run/redis/redis.pid
+ 
+ # Accept connections on the specified port, default is 6379
+ port 6379
+@@ -26,7 +26,7 @@ port 6379
+ # If you want you can bind a single interface, if the bind option is not
+ # specified all the interfaces will listen for incoming connections.
+ #
+-# bind 127.0.0.1
++bind 127.0.0.1
+ 
+ # Close the connection after a client is idle for N seconds (0 to disable)
+ timeout 300
+@@ -37,12 +37,12 @@ timeout 300
+ # verbose (many rarely useful info, but not a mess like the debug level)
+ # notice (moderately verbose, what you want in production probably)
+ # warning (only very important / critical messages are logged)
+-loglevel verbose
++loglevel notice
+ 
+ # 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 /var/log/redis/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 @@ dbfilename dump.rdb
+ # 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 /var/lib/redis/
+ 
+ ################################# REPLICATION #################################
+ 

================================================================
Index: packages/redis/redis.init
diff -u /dev/null packages/redis/redis.init:1.1
--- /dev/null	Sat Oct  9 13:34:20 2010
+++ packages/redis/redis.init	Sat Oct  9 13:34:14 2010
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# redis        init file for starting up the redis daemon
+#
+# chkconfig:   - 20 80
+# description: Starts and stops the redis daemon.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+name="redis-server"
+exec="/usr/sbin/$name"
+pidfile="/var/run/redis/redis.pid"
+REDIS_CONFIG="/etc/redis.conf"
+
+[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
+
+lockfile=/var/lock/subsys/redis
+
+start() {
+    [ -f $REDIS_CONFIG ] || exit 6
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $name: "
+    daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $name: "
+    killproc -p $pidfile $name
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    false
+}
+
+rh_status() {
+    status -p $pidfile $name
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
+        exit 2
+esac
+exit $?

================================================================
Index: packages/redis/redis.logrotate
diff -u /dev/null packages/redis/redis.logrotate:1.1
--- /dev/null	Sat Oct  9 13:34:20 2010
+++ packages/redis/redis.logrotate	Sat Oct  9 13:34:14 2010
@@ -0,0 +1,9 @@
+/var/log/redis/redis.log {
+    weekly
+    rotate 10
+    copytruncate
+    delaycompress
+    compress
+    notifempty
+    missingok
+}

================================================================
Index: packages/redis/redis.spec
diff -u /dev/null packages/redis/redis.spec:1.1
--- /dev/null	Sat Oct  9 13:34:20 2010
+++ packages/redis/redis.spec	Sat Oct  9 13:34:14 2010
@@ -0,0 +1,106 @@
+# $Revision$, $Date$
+# TODO
+# - register user/gid, pld initscript
+# - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
+#
+# Conditional build:
+%bcond_without	tests		# build without tests
+
+Summary:	A persistent key-value database
+Name:		redis
+Version:	2.0.2
+Release:	0.1
+License:	BSD
+Group:		Applications/Databases
+URL:		http://code.google.com/p/redis/
+Source0:	http://redis.googlecode.com/files/%{name}-%{version}.tar.gz
+# Source0-md5:	1658ab25161efcc0d0e98b4d1e38a985
+Source1:	%{name}.logrotate
+Source2:	%{name}.init
+Patch0:		%{name}-redis.conf.patch
+BuildRequires:	sed >= 4.0
+%{?with_tests:BuildRequires:	tcl}
+Requires(post):	/sbin/chkconfig
+Requires(preun):	/sbin/chkconfig
+Requires(preun):	rc-scripts
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Redis is an advanced key-value store. It is similar to memcached but
+the data set is not volatile, and values can be strings, exactly like
+in memcached, but also lists, sets, and ordered sets. All this data
+types can be manipulated with atomic operations to push/pop elements,
+add/remove elements, perform server side union, intersection,
+difference between sets, and so forth. Redis supports different kind
+of sorting abilities.
+
+%prep
+%setup -q
+%patch0 -p1
+# Remove integration tests
+%{__sed} -i -e '/    execute_tests "integration\/replication"/d' tests/test_helper.tcl
+%{__sed} -i -e '/    execute_tests "integration\/aof"/d' tests/test_helper.tcl
+
+%build
+%{__make} all \
+	DEBUG="" \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcflags} -std=c99"
+
+%if %{with tests}
+tclsh tests/test_helper.tcl
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+# Install binaries
+install -p -D %{name}-benchmark $RPM_BUILD_ROOT%{_bindir}/%{name}-benchmark
+install -p -D %{name}-cli $RPM_BUILD_ROOT%{_bindir}/%{name}-cli
+install -p -D %{name}-check-aof $RPM_BUILD_ROOT%{_bindir}/%{name}-check-aof
+install -p -D %{name}-check-dump $RPM_BUILD_ROOT%{_bindir}/%{name}-check-dump
+install -p -D %{name}-server $RPM_BUILD_ROOT%{_sbindir}/%{name}-server
+# Install misc other
+install -p -D %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+install -p -D %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install -p -D %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
+install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
+install -d $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
+install -d $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
+
+%clean
+rm -fr $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add redis
+
+%pre
+%groupadd -g 99 redis
+%useradd -u 99 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
+
+%preun
+if [ "$1" = 0 ]; then
+	%service redis stop
+	/sbin/chkconfig --del redis
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc 00-RELEASENOTES BUGS COPYING Changelog README TODO doc/
+%config(noreplace) %{_sysconfdir}/%{name}.conf
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%attr(755,root,root) %{_bindir}/%{name}-*
+%attr(755,root,root) %{_sbindir}/%{name}-*
+%config(noreplace) /etc/logrotate.d/%{name}
+%dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
+%dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
+%dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2010/10/09 11:34:14  glen
+- initial from https://bugzilla.redhat.com/show_bug.cgi?id=619237
+  http://github.com/downloads/silas/rpms/redis-2.0.1-1.fc13.src.rpm
================================================================


More information about the pld-cvs-commit mailing list