commit 6223ba0a8335d82ca9b2722ea796456b1bccb24e Author: Rosa Date: Wed Feb 1 20:01:41 2012 +0400 Automatic import for version 2.2.8 diff --git a/.abf.yml b/.abf.yml new file mode 100644 index 0000000..e4cb63b --- /dev/null +++ b/.abf.yml @@ -0,0 +1,2 @@ +sources: + "redis-2.2.8.tar.gz": 30fb67ed71c179a7294d06d2c83c9b074a98fb79 diff --git a/redis-conf.patch b/redis-conf.patch new file mode 100644 index 0000000..e28e401 --- /dev/null +++ b/redis-conf.patch @@ -0,0 +1,50 @@ +--- + redis.conf | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +Index: redis.conf +=================================================================== +--- redis.conf.orig ++++ redis.conf +@@ -14,7 +14,7 @@ + + # 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. +@@ -27,7 +27,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 + + # Specify the path for the unix socket that will be used to listen for + # incoming connections. There is no default, so Redis will not listen +@@ -44,12 +44,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 + + # To enable logging to the system logger, just set 'syslog-enabled' to yes, + # and optionally update the other syslog parameters to suit your needs. +@@ -103,7 +103,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 ################################# + diff --git a/redis-initscript.patch b/redis-initscript.patch new file mode 100644 index 0000000..62e6b9b --- /dev/null +++ b/redis-initscript.patch @@ -0,0 +1,97 @@ +--- + utils/redis_init_script | 67 +++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 53 insertions(+), 14 deletions(-) + +Index: utils/redis_init_script +=================================================================== +--- utils/redis_init_script.orig ++++ utils/redis_init_script +@@ -1,35 +1,74 @@ + #!/bin/sh ++# ++# /etc/init.d/redis ++# ++### BEGIN INIT INFO ++# Provides: redis ++# Required-Start: $syslog $remote_fs ++# Should-Start: ++# Required-Stop: $syslog $remote_fs ++# Should-Stop: ++# Default-Start: 3 4 5 ++# Default-Stop: 0 1 2 6 ++# Short-Description: Redis server ++# Description: Starts and stops the Redis daemon ++### END INIT INFO ++ ++. /etc/rc.status + + REDISPORT=6379 +-EXEC=/usr/local/bin/redis-server ++EXEC=/usr/sbin/redis-server + +-PIDFILE=/var/run/redis_${REDISPORT}.pid +-CONF="/etc/redis/${REDISPORT}.conf" ++LOGFILE=/var/log/redis.log ++PIDFILE=/var/run/redis.pid ++CONF=/etc/redis.conf + + case "$1" in + start) +- if [ -f $PIDFILE ] +- then +- echo -n "$PIDFILE exists, process is already running or crashed\n" +- else +- echo -n "Starting Redis server...\n" +- $EXEC $CONF ++ if [ ! -r $LOGFILE ]; then ++ touch $LOGFILE ++ chown redis:redis $LOGFILE ++ fi ++ # Create a pidfile the server can write into. ++ if [ ! -r $PIDFILE ]; then ++ touch $PIDFILE ++ chown redis:redis $PIDFILE + fi ++ echo -n "Starting service Redis " ++ /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF >/dev/null 2>&1 ++ rc_status -v + ;; + stop) + if [ ! -f $PIDFILE ] + then +- echo -n "$PIDFILE does not exist, process is not running\n" ++ echo -n "$PIDFILE does not exist, process is not running" ++ rc_failed + else ++ echo -n "Stopping service Redis..." ++ echo -e "SHUTDOWN\r" | /usr/bin/netcat localhost $REDISPORT & + PID=$(cat $PIDFILE) +- echo -n "Stopping ...\n" +- echo -n "SHUTDOWN\r\n" | nc localhost $REDISPORT & + while [ -x /proc/${PIDFILE} ] + do +- echo "Waiting for Redis to shutdown ..." + sleep 1 + done +- echo "Redis stopped" + fi ++ rc_status -v ++ ;; ++ restart) ++ $0 stop ++ $0 start + ;; ++ reload) ++ $0 restart ++ ;; ++ status) ++ echo -n "Checking for service Redis: " ++ /sbin/checkproc -p $PIDFILE $EXEC ++ rc_status -v ++ ;; ++ *) ++ echo $"Usage: $0 {start|stop|status|restart|reload}" ++ exit 1 + esac ++rc_exit ++ diff --git a/redis.logrotate b/redis.logrotate new file mode 100644 index 0000000..f61acf0 --- /dev/null +++ b/redis.logrotate @@ -0,0 +1,9 @@ +/var/log/redis/*.log { + weekly + rotate 10 + copytruncate + delaycompress + compress + notifempty + missingok +} diff --git a/redis.spec b/redis.spec new file mode 100644 index 0000000..f20e001 --- /dev/null +++ b/redis.spec @@ -0,0 +1,122 @@ +%define _data_dir %{_var}/lib/%{name} +%define _log_dir %{_var}/log/%{name} + +Name: redis +Version: 2.2.8 +Release: %mkrel 1 +License: BSD License +Group: Databases +Summary: Persistent key-value database +Url: http://redis.io/ +Source: http://redis.googlecode.com/files/%{name}-%{version}.tar.gz +Source1: %{name}.logrotate +Source4: redis.sysconfig +Patch0: %{name}-initscript.patch +Patch1: %{name}-conf.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: netcat +Requires: logrotate +BuildRequires: tcl + +%description +Redis is an advanced key-value store. It is similar to memcached but the dataset +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. + +%package doc +Summary: HTML documentation for redis +Group: Databases +Requires: redis = %{version} + +%description doc +HTML documentation for redis database. + +%prep +%setup -q +%patch0 +mv doc html + +%build +make PROF="%{optflags}" %{?jobs:-j%jobs} + +%install +%{__install} -Dd -m 0755 \ + %{buildroot}%{_initrddir}/ \ + %{buildroot}%{_sysconfdir}/logrotate.d \ + %{buildroot}%{_bindir} \ + %{buildroot}%{_libdir} \ + %{buildroot}%{_sbindir} \ + %{buildroot}%{_log_dir} \ + %{buildroot}%{_data_dir} + +%{__install} -m 0755 src/redis-benchmark %{buildroot}%{_bindir}/redis-benchmark +%{__install} -m 0755 src/redis-cli %{buildroot}%{_bindir}/redis-cli +%{__install} -m 0755 src/redis-check-dump %{buildroot}%{_bindir}/redis-check-dump +%{__install} -m 0755 src/redis-check-aof %{buildroot}%{_bindir}/redis-check-aof +%{__install} -m 0755 src/redis-server %{buildroot}%{_sbindir}/redis-server +%{__install} -m 0640 redis.conf %{buildroot}%{_sysconfdir}/redis.conf + +# init +%{__install} -m 0755 utils/redis_init_script %{buildroot}%{_initrddir}/redis +%{__ln_s} %{_initrddir}/%{name} %{buildroot}%{_sbindir}/rc%{name} + +# logrotate +%{__install} -m 0644 %{S:1} \ + %{buildroot}%{_sysconfdir}/logrotate.d/%{name} + +%check + +cat </dev/null || : +/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "User for Redis key-value store" -d %{_data_dir} %{name} &>/dev/null || : + +%post +%_post_service %{name} +echo "To start the database server, do:" +echo " sudo rcredis start; insserv redis" + +%preun +%_preun_service %{name} + +%files +%defattr(-,root,root) +%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING Changelog README TODO +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%{_bindir}/redis-* +%{_sbindir}/redis-* +%{_sbindir}/rc%{name} +%config(noreplace) %{_initrddir}/redis +%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/redis.conf +%dir %attr(0750, %{name}, %{name}) %{_data_dir} +%dir %attr(0750, %{name}, %{name}) %{_log_dir} + +%files doc +%defattr(-,root,root) +%doc html/ + + + +%changelog +* Thu Jun 09 2011 Antoine Ginies 2.2.8-1mdv2011.0 ++ Revision: 683424 +- fix group in subpackages +- fix group +- import redis + + +* Wed Jun 8 2011 Antoine Ginies 2.2.8 +- first release for Mandriva based on OpenSUSE SRPM diff --git a/redis.sysconfig b/redis.sysconfig new file mode 100644 index 0000000..f443d2e --- /dev/null +++ b/redis.sysconfig @@ -0,0 +1,2 @@ +REDIS_HOST=localhost +REDIS_PORT=6379 \ No newline at end of file