[arch-commits] Commit in redis/trunk (5 files)
Bartłomiej Piotrowski
bpiotrowski at archlinux.org
Wed Aug 27 12:59:31 UTC 2014
Date: Wednesday, August 27, 2014 @ 14:59:30
Author: bpiotrowski
Revision: 117961
upgpkg: redis 2.8.13-2
- log to journald by default
- use system jemalloc
- replace bunch of seds modyfing default settings with a patch
- rewrite redis.install to use getent
Added:
redis/trunk/redis-2.8.11-use-system-jemalloc.patch
redis/trunk/redis.conf-sane-defaults.patch
Modified:
redis/trunk/PKGBUILD
redis/trunk/redis.install
redis/trunk/redis.service
----------------------------------------+
PKGBUILD | 62 +++++++++++++++----------------
redis-2.8.11-use-system-jemalloc.patch | 15 +++++++
redis.conf-sane-defaults.patch | 31 +++++++++++++++
redis.install | 16 ++------
redis.service | 4 --
5 files changed, 82 insertions(+), 46 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-08-27 12:49:20 UTC (rev 117960)
+++ PKGBUILD 2014-08-27 12:59:30 UTC (rev 117961)
@@ -1,51 +1,51 @@
# $Id$
-# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
-# Maintainer: Jan-Erik Rediger <badboy at archlinux dot us>
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+# Contributor: Jan-Erik Rediger <badboy at archlinux dot us>
# Contributor: nofxx <x@<nick>.com>
pkgname=redis
pkgver=2.8.13
-pkgrel=1
-pkgdesc="Advanced key-value store"
+pkgrel=2
+pkgdesc='Advanced key-value store'
arch=('i686' 'x86_64')
-url="http://redis.io/"
+url='http://redis.io/'
license=('BSD')
-depends=('bash')
-makedepends=('gcc>=3.1' 'make' 'pkgconfig')
-backup=("etc/redis.conf"
- "etc/logrotate.d/redis")
+depends=('jemalloc')
+backup=('etc/redis.conf'
+ 'etc/logrotate.d/redis')
install=redis.install
-source=("http://download.redis.io/releases/redis-$pkgver.tar.gz"
- "redis.service"
- "redis.logrotate"
- "redis.tmpfiles.d")
+source=(http://download.redis.io/releases/redis-$pkgver.tar.gz
+ redis.service
+ redis.logrotate redis.tmpfiles.d
+ redis.conf-sane-defaults.patch
+ redis-2.8.11-use-system-jemalloc.patch)
md5sums=('ea92053cbb6f4eb8a4347dbaac7d7dff'
- '5320aa6d0f31aadc1d6202ca40425aea'
+ 'aec12c881dc2693754f85539ae8e0bc7'
'9e2d75b7a9dc421122d673fe520ef17f'
- 'dd9ab8022b4d963b2e5899170dfff490')
+ 'dd9ab8022b4d963b2e5899170dfff490'
+ 'b1beae6954b780da261b4056fd7f918a'
+ '2ae176578f538e37a67a463258302bc6')
prepare() {
- cd "$srcdir/${pkgname}-${pkgver}"
- sed -i 's|# bind 127.0.0.1|bind 127.0.0.1|' redis.conf
- sed -i 's|daemonize no|daemonize yes|' redis.conf
- sed -i 's|dir \./|dir /var/lib/redis/|' redis.conf
- sed -i 's|pidfile .*|pidfile /run/redis/redis.pid|' redis.conf
- sed -i 's|logfile stdout|logfile /var/log/redis.log|' redis.conf
+ cd $pkgname-$pkgver
+ patch -p1 -i ../redis.conf-sane-defaults.patch
+ patch -p1 -i ../redis-2.8.11-use-system-jemalloc.patch
}
build() {
- cd "$srcdir/${pkgname}-${pkgver}"
- make
+ make -C $pkgname-$pkgver
}
package() {
- cd "$srcdir/${pkgname}-${pkgver}"
- mkdir -p $pkgdir/usr/bin
- make INSTALL_BIN="$pkgdir/usr/bin" PREFIX=/usr install
+ cd $pkgname-$pkgver
+ make PREFIX="$pkgdir"/usr install
- install -Dm755 "$srcdir/${pkgname}-${pkgver}/COPYING" "$pkgdir/usr/share/licenses/redis/COPYING"
- install -Dm644 "$srcdir"/redis.service "$pkgdir"/usr/lib/systemd/system/redis.service
- install -Dm644 "$srcdir/redis.logrotate" "$pkgdir/etc/logrotate.d/redis"
- install -Dm644 "$srcdir/${pkgname}-${pkgver}/redis.conf" "$pkgdir/etc/redis.conf"
- install -Dm644 "$srcdir/redis.tmpfiles.d" "$pkgdir/usr/lib/tmpfiles.d/redis.conf"
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/redis/LICENSE
+ install -Dm644 redis.conf "$pkgdir"/etc/redis.conf
+ install -Dm644 ../redis.service "$pkgdir"/usr/lib/systemd/system/redis.service
+
+ # files kept for compatibility with installations made before 2.8.13-2
+ install -Dm644 ../redis.logrotate "$pkgdir"/etc/logrotate.d/redis
+ install -Dm644 ../redis.tmpfiles.d "$pkgdir"/usr/lib/tmpfiles.d/redis.conf
}
Added: redis-2.8.11-use-system-jemalloc.patch
===================================================================
--- redis-2.8.11-use-system-jemalloc.patch (rev 0)
+++ redis-2.8.11-use-system-jemalloc.patch 2014-08-27 12:59:30 UTC (rev 117961)
@@ -0,0 +1,15 @@
+Index: redis-2.8.11/src/Makefile
+===================================================================
+--- redis-2.8.11.orig/src/Makefile
++++ redis-2.8.11/src/Makefile
+@@ -84,8 +84,8 @@ endif
+
+ ifeq ($(MALLOC),jemalloc)
+ DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
Added: redis.conf-sane-defaults.patch
===================================================================
--- redis.conf-sane-defaults.patch (rev 0)
+++ redis.conf-sane-defaults.patch 2014-08-27 12:59:30 UTC (rev 117961)
@@ -0,0 +1,31 @@
+diff --git a/redis.conf b/redis.conf
+index 6efb6ac..344e021 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -61,7 +61,7 @@ tcp-backlog 511
+ # Examples:
+ #
+ # bind 192.168.1.100 10.0.0.1
+-# 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
+@@ -87,7 +87,7 @@ timeout 0
+ # On other kernels the period depends on the kernel configuration.
+ #
+ # A reasonable value for this option is 60 seconds.
+-tcp-keepalive 0
++tcp-keepalive 60
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -184,7 +184,7 @@ dbfilename dump.rdb
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
Modified: redis.install
===================================================================
--- redis.install 2014-08-27 12:49:20 UTC (rev 117960)
+++ redis.install 2014-08-27 12:59:30 UTC (rev 117961)
@@ -1,14 +1,8 @@
post_install() {
- grep -E "^redis:" etc/group >/dev/null || groupadd --system redis
- grep -E "^redis:" etc/passwd >/dev/null || useradd --system -g redis -d /var/lib/redis -s /bin/false redis
- touch var/log/redis.log
- chown redis:redis var/log/redis.log
- systemd-tmpfiles --create redis.conf
- install -dm0700 var/lib/redis
- chown -R redis:redis var/lib/redis
-}
+ getent group redis >/dev/null || groupadd --system redis
+ getent passwd minetest >/dev/null || useradd --system -g redis \
+ -d /var/lib/redis -s /bin/false redis
-post_upgrade() {
- post_install
- echo "Redis starts from redis user by default. Check redis.service file"
+ install -dm700 var/lib/redis
+ chown redis:redis var/lib/redis
}
Modified: redis.service
===================================================================
--- redis.service 2014-08-27 12:49:20 UTC (rev 117960)
+++ redis.service 2014-08-27 12:59:30 UTC (rev 117961)
@@ -3,13 +3,9 @@
After=network.target
[Service]
-Type=forking
User=redis
-PIDFile=/run/redis/redis.pid
-ExecStartPre=/bin/mkdir -p /var/lib/redis
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
-Restart=always
[Install]
WantedBy=multi-user.target
More information about the arch-commits
mailing list