Automatic import for version 2.2.8

This commit is contained in:
Rosa 2012-02-01 20:01:41 +04:00
commit 6223ba0a83
6 changed files with 282 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"redis-2.2.8.tar.gz": 30fb67ed71c179a7294d06d2c83c9b074a98fb79

50
redis-conf.patch Normal file
View file

@ -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 #################################

97
redis-initscript.patch Normal file
View file

@ -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
+

9
redis.logrotate Normal file
View file

@ -0,0 +1,9 @@
/var/log/redis/*.log {
weekly
rotate 10
copytruncate
delaycompress
compress
notifempty
missingok
}

122
redis.spec Normal file
View file

@ -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 <<EOF
---------------------------------------------------
The test suite often fails to start a server, with
'child process exited abnormally' -- sometimes it works.
---------------------------------------------------
EOF
make test && true
%clean
rm -rf %{buildroot}
%pre
/usr/sbin/groupadd -r %{name} &>/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 <aginies@mandriva.com> 2.2.8-1mdv2011.0
+ Revision: 683424
- fix group in subpackages
- fix group
- import redis
* Wed Jun 8 2011 Antoine Ginies <aginies@mandriva.com> 2.2.8
- first release for Mandriva based on OpenSUSE SRPM

2
redis.sysconfig Normal file
View file

@ -0,0 +1,2 @@
REDIS_HOST=localhost
REDIS_PORT=6379