From ad0d775a93277dc3df8851ff682d18e15e13789f Mon Sep 17 00:00:00 2001 From: Fabian Deutsch Date: Thu, 12 Jan 2012 22:09:07 +0100 Subject: [PATCH] Update to 2.4.6 and introduce systemd unit. Signed-off-by: Fabian Deutsch --- redis-2.4.6-redis.conf.patch | 44 ++++++++++++++++++++++++++++++++++++ redis.service | 11 +++++++++ redis.spec | 20 ++++++++++++---- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 redis-2.4.6-redis.conf.patch create mode 100644 redis.service diff --git a/redis-2.4.6-redis.conf.patch b/redis-2.4.6-redis.conf.patch new file mode 100644 index 0000000..109238e --- /dev/null +++ b/redis-2.4.6-redis.conf.patch @@ -0,0 +1,44 @@ +--- redis-2.4.6/redis.conf.orig 2012-01-13 09:01:20.032263652 +0100 ++++ redis-2.4.6/redis.conf 2012-01-13 09:02:57.223037913 +0100 +@@ -18,7 +18,7 @@ + + # 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. + # If port 0 is specified Redis will not listen on a TCP socket. +@@ -27,7 +27,7 @@ + # 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 +@@ -45,12 +45,12 @@ + # 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. +@@ -104,7 +104,7 @@ + # 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.service b/redis.service new file mode 100644 index 0000000..4983939 --- /dev/null +++ b/redis.service @@ -0,0 +1,11 @@ +[Unit] +Description=A persistent key-value database +After=syslog.target network.target + +[Service] +PIDFile=/var/run/redis/redis.pid +ExecStart=/usr/sbin/redis-server + +[Install] +WantedBy=multi-user.target + diff --git a/redis.spec b/redis.spec index 45b1457..e1313ca 100644 --- a/redis.spec +++ b/redis.spec @@ -7,7 +7,7 @@ %endif Name: redis -Version: 2.2.12 +Version: 2.4.6 Release: 1%{?dist} Summary: A persistent key-value database @@ -17,9 +17,11 @@ URL: http://redis.io Source0: http://redis.googlecode.com/files/%{name}-%{version}.tar.gz Source1: %{name}.logrotate Source2: %{name}.init +Source3: %{name}.service # Update configuration for Fedora -Patch0: %{name}-2.2.2-redis.conf.patch +Patch0: %{name}-2.4.6-redis.conf.patch +BuildRequires: systemd-units %if !0%{?el5} BuildRequires: tcl >= 8.5 %if 0%{?with_perftools} @@ -49,7 +51,7 @@ different kind of sorting abilities. %build make %{?_smp_mflags} \ DEBUG="" \ - CFLAGS='%{optflags} -std=c99' \ + CFLAGS='%{optflags}' \ %if !0%{?el5} %if 0%{?with_perftools} USE_TCMALLOC=yes \ @@ -72,6 +74,9 @@ install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name} install -d -m 755 %{buildroot}%{_localstatedir}/log/%{name} install -d -m 755 %{buildroot}%{_localstatedir}/run/%{name} +# Install systemd unit +install -p -D -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}/%{name}.service + # Fix non-standard-executable-perm error chmod 755 %{buildroot}%{_bindir}/%{name}-* @@ -97,7 +102,7 @@ fi %files %defattr(-,root,root,-) -%doc 00-RELEASENOTES BUGS COPYING Changelog README doc/ +%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING README TODO %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/%{name}.conf %dir %attr(0755, redis, root) %{_localstatedir}/lib/%{name} @@ -106,8 +111,15 @@ fi %{_bindir}/%{name}-* %{_sbindir}/%{name}-* %{_initrddir}/%{name} +%{_unitdir}/%{name}.service %changelog +* Thu Jan 12 2012 Fabian Deutsch - 2.4.6-1 +- Update to 2.4.6 +- systemd unit file added +- Compiler flags changed to compile 2.4.6 +- Remove doc/ and Changelog + * Sun Jul 24 2011 Silas Sewell - 2.2.12-1 - Update to redis 2.2.12