summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo P2016-04-05 01:13:58 -0400
committerLeo P2016-04-05 01:13:58 -0400
commitf1a6118a225268149a82fde1c64abdf23899f580 (patch)
tree18d245fc24aadef0b746c11a0820b2d7b00dcc89
downloadaur-redis-testing.tar.gz
first
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD54
-rw-r--r--redis-2.8.11-use-system-jemalloc.patch15
-rw-r--r--redis.conf-sane-defaults.patch31
-rw-r--r--redis.install8
-rw-r--r--redis.logrotate5
-rw-r--r--redis.service22
7 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9bb4155c3d19
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = redis-testing
+ pkgdesc = Advanced key-value store
+ pkgver = 3.2.0_rc3
+ pkgrel = 1
+ url = http://redis.io/
+ install = redis.install
+ arch = i686
+ arch = x86_64
+ license = BSD
+ depends = jemalloc
+ depends = grep
+ depends = shadow
+ provides = redis
+ conflicts = redis
+ backup = etc/redis.conf
+ backup = etc/logrotate.d/redis
+ source = https://github.com/antirez/redis/archive/3.2.0-rc3.tar.gz
+ source = redis.service
+ source = redis.logrotate
+ source = redis.conf-sane-defaults.patch
+ source = redis-2.8.11-use-system-jemalloc.patch
+ md5sums = 2882bca0eb0116b56188af92fbc963fa
+ md5sums = afa0f4a9000c26c3323e83fe34883e23
+ md5sums = 9e2d75b7a9dc421122d673fe520ef17f
+ md5sums = 990536d339b694d76415ec1e847b861a
+ md5sums = 2ae176578f538e37a67a463258302bc6
+
+pkgname = redis-testing
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5cd4694ed3b8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# $Id: PKGBUILD 159813 2016-02-01 18:34:51Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
+# Contributor: Jan-Erik Rediger <badboy at archlinux dot us>
+# Contributor: nofxx <x@<nick>.com>
+
+pkgname=redis-testing
+provides=('redis')
+conflicts=('redis')
+_tag=3.2.0-rc3
+pkgver=${_tag/-/_}
+pkgrel=1
+pkgdesc='Advanced key-value store'
+arch=('i686' 'x86_64')
+url='http://redis.io/'
+license=('BSD')
+depends=('jemalloc' 'grep' 'shadow')
+backup=('etc/redis.conf'
+ 'etc/logrotate.d/redis')
+install=redis.install
+source=(https://github.com/antirez/redis/archive/${_tag}.tar.gz
+ redis.service
+ redis.logrotate
+ redis.conf-sane-defaults.patch
+ redis-2.8.11-use-system-jemalloc.patch)
+md5sums=('2882bca0eb0116b56188af92fbc963fa'
+ 'afa0f4a9000c26c3323e83fe34883e23'
+ '9e2d75b7a9dc421122d673fe520ef17f'
+ '990536d339b694d76415ec1e847b861a'
+ '2ae176578f538e37a67a463258302bc6')
+
+prepare() {
+ cd redis-$_tag
+ patch -p1 -i ../redis.conf-sane-defaults.patch
+ patch -p1 -i ../redis-2.8.11-use-system-jemalloc.patch
+}
+
+build() {
+ make -C redis-$_tag
+}
+
+package() {
+ cd redis-$_tag
+ make PREFIX="$pkgdir"/usr install
+
+ 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
+
+ ln -sf redis-server $pkgdir/usr/bin/redis-sentinel
+}
diff --git a/redis-2.8.11-use-system-jemalloc.patch b/redis-2.8.11-use-system-jemalloc.patch
new file mode 100644
index 000000000000..5da3d6816fe3
--- /dev/null
+++ b/redis-2.8.11-use-system-jemalloc.patch
@@ -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)
diff --git a/redis.conf-sane-defaults.patch b/redis.conf-sane-defaults.patch
new file mode 100644
index 000000000000..97b1086457e2
--- /dev/null
+++ b/redis.conf-sane-defaults.patch
@@ -0,0 +1,31 @@
+diff --git a/redis.conf b/redis.conf
+index 6efb6ac..344e021 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -45,7 +45,7 @@
+ # Examples:
+ #
+ # bind 192.168.1.100 10.0.0.1
+-# bind 127.0.0.1 ::1
++bind 127.0.0.1 ::1
+ #
+ # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
+ # internet, binding to all the interfaces is dangerous and will expose the
+@@ -118,7 +118,7 @@
+ # 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
+
+ ################################# GENERAL #####################################
+
+@@ -243,7 +243,7 @@
+ # 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 #################################
+
diff --git a/redis.install b/redis.install
new file mode 100644
index 000000000000..027e758a61c6
--- /dev/null
+++ b/redis.install
@@ -0,0 +1,8 @@
+post_install() {
+ getent group redis >/dev/null || groupadd --system redis
+ getent passwd redis >/dev/null || useradd --system -g redis \
+ -d /var/lib/redis -s /bin/false redis
+
+ install -dm700 var/lib/redis
+ chown redis:redis var/lib/redis
+}
diff --git a/redis.logrotate b/redis.logrotate
new file mode 100644
index 000000000000..01d11422a596
--- /dev/null
+++ b/redis.logrotate
@@ -0,0 +1,5 @@
+/var/log/redis.log {
+ notifempty
+ copytruncate
+ missingok
+}
diff --git a/redis.service b/redis.service
new file mode 100644
index 000000000000..0a8162b8ab8e
--- /dev/null
+++ b/redis.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Advanced key-value store
+After=network.target
+
+[Service]
+Type=simple
+User=redis
+Group=redis
+ExecStart=/usr/bin/redis-server /etc/redis.conf
+ExecStop=/usr/bin/redis-cli shutdown
+CapabilityBoundingSet=
+PrivateTmp=true
+PrivateDevices=true
+ProtectSystem=full
+ProtectHome=true
+NoNewPrivileges=true
+RuntimeDirectory=redis
+RuntimeDirectoryMode=755
+LimitNOFILE=10032
+
+[Install]
+WantedBy=multi-user.target