mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
26
package/redis/0001-uclibc.patch
Normal file
26
package/redis/0001-uclibc.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
redis-001-uclibc.patch: This patch fixes redis so that it can be compiled
|
||||
against uclibc. Patch originates from:
|
||||
|
||||
Support cross-compiling for uClibc targets
|
||||
https://github.com/antirez/redis/pull/537
|
||||
Mike Steinert, mike.steinert@gmail.com
|
||||
|
||||
Signed-off-by: Daniel Price <daniel.price@gmail.com>
|
||||
[Martin: adapt to 3.0.3]
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
[Titouan: adapt to 5.0.4]
|
||||
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
|
||||
|
||||
=========================================================================
|
||||
diff -ur old/src/config.h new/src/config.h
|
||||
--- old/src/config.h 2012-10-26 07:20:24.000000000 -0700
|
||||
+++ new/src/config.h 2012-10-31 13:41:51.206309564 -0700
|
||||
@@ -62,7 +62,7 @@
|
||||
#endif
|
||||
|
||||
/* Test for backtrace() */
|
||||
-#if defined(__APPLE__) || (defined(__linux__) && defined(__GLIBC__)) || \
|
||||
+#if defined(__APPLE__) || (defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__)) || \
|
||||
defined(__FreeBSD__) || (defined(__OpenBSD__) && defined(USE_BACKTRACE))\
|
||||
|| defined(__DragonFly__)
|
||||
#define HAVE_BACKTRACE 1
|
||||
32
package/redis/0002-largefile-conditional-define.patch
Normal file
32
package/redis/0002-largefile-conditional-define.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
Define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS conditionally
|
||||
|
||||
In order to avoid ugly warnings at compile time, only define
|
||||
_LARGEFILE_SOURCE and _FILE_OFFSET_BITS if they have not already been
|
||||
defined through the build command line.
|
||||
|
||||
Avoids:
|
||||
|
||||
In file included from redis.h:33:0,
|
||||
from migrate.c:1:
|
||||
fmacros.h:45:0: warning: "_LARGEFILE_SOURCE" redefined
|
||||
<command-line>:0:0: note: this is the location of the previous definition
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: redis-2.6.11/src/fmacros.h
|
||||
===================================================================
|
||||
--- redis-2.6.11.orig/src/fmacros.h 2013-03-25 22:09:15.000000000 +0100
|
||||
+++ redis-2.6.11/src/fmacros.h 2013-03-25 22:09:40.000000000 +0100
|
||||
@@ -42,7 +42,12 @@
|
||||
#define _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
+#ifndef _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE_SOURCE
|
||||
+#endif
|
||||
+
|
||||
+#ifndef _FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
+#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
From f79d1d1bf9e6f54b67e5482602084fbff7fd9cc9 Mon Sep 17 00:00:00 2001
|
||||
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
Date: Fri, 28 Oct 2016 12:50:34 -0300
|
||||
Subject: [PATCH] redis.conf: adjust defauts for buildroot
|
||||
|
||||
Based on Martin Bark's patch hence archlinux package.
|
||||
We just need to specify a proper db directory.
|
||||
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
---
|
||||
redis.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/redis.conf b/redis.conf
|
||||
index 22e00bc..3bb0430 100644
|
||||
--- a/redis.conf
|
||||
+++ b/redis.conf
|
||||
@@ -244,7 +244,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 #################################
|
||||
|
||||
--
|
||||
2.7.3
|
||||
|
||||
17
package/redis/Config.in
Normal file
17
package/redis/Config.in
Normal file
@@ -0,0 +1,17 @@
|
||||
config BR2_PACKAGE_REDIS
|
||||
bool "redis"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
depends on !BR2_STATIC_LIBS # dlfcn.h
|
||||
depends on BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
Redis is an open source, advanced key-value store. It is
|
||||
often referred to as a data structure server since keys can
|
||||
contain strings, hashes, lists, sets and sorted sets.
|
||||
|
||||
http://www.redis.io
|
||||
|
||||
comment "redis needs a toolchain w/ dynamic library, threads"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
|
||||
38
package/redis/S50redis
Normal file
38
package/redis/S50redis
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# start redis
|
||||
#
|
||||
|
||||
start() {
|
||||
printf "Starting redis: "
|
||||
umask 077
|
||||
start-stop-daemon -S -q -c redis:redis -b \
|
||||
--exec /usr/bin/redis-server -- /etc/redis.conf
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
stop() {
|
||||
printf "Stopping redis: "
|
||||
/usr/bin/redis-cli shutdown
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
5
package/redis/redis.hash
Normal file
5
package/redis/redis.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# From https://github.com/antirez/redis-hashes/blob/master/README
|
||||
sha256 2139009799d21d8ff94fc40b7f36ac46699b9e1254086299f8d3b223ca54a375 redis-5.0.5.tar.gz
|
||||
|
||||
# Locally calculated
|
||||
sha256 cbf420a3672475a6e2765e3c0984c1f81efe0212afb94a3c998ee63bfd661063 COPYING
|
||||
57
package/redis/redis.mk
Normal file
57
package/redis/redis.mk
Normal file
@@ -0,0 +1,57 @@
|
||||
################################################################################
|
||||
#
|
||||
# redis
|
||||
#
|
||||
################################################################################
|
||||
|
||||
REDIS_VERSION = 5.0.5
|
||||
REDIS_SITE = http://download.redis.io/releases
|
||||
REDIS_LICENSE = BSD-3-Clause (core); MIT and BSD family licenses (Bundled components)
|
||||
REDIS_LICENSE_FILES = COPYING
|
||||
|
||||
define REDIS_USERS
|
||||
redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server
|
||||
endef
|
||||
|
||||
# Uses __atomic_fetch_add_4. Adding -latomic to LDFLAGS does not work,
|
||||
# because LDFLAGS is used before the list of object files. We need to
|
||||
# add -latomic to FINAL_LIBS to provide -latomic at the correct place
|
||||
# in the linking command.
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
define REDIS_FIX_MAKEFILE
|
||||
$(SED) 's/FINAL_LIBS=-lm/FINAL_LIBS=-lm -latomic/' $(@D)/src/Makefile
|
||||
endef
|
||||
REDIS_POST_PATCH_HOOKS = REDIS_FIX_MAKEFILE
|
||||
endif
|
||||
|
||||
# Redis doesn't support DESTDIR (yet, see
|
||||
# https://github.com/antirez/redis/pull/609). We set PREFIX
|
||||
# instead.
|
||||
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
||||
PREFIX=$(TARGET_DIR)/usr MALLOC=libc
|
||||
|
||||
define REDIS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D) \
|
||||
LDCONFIG=true install
|
||||
$(INSTALL) -D -m 0644 $(@D)/redis.conf \
|
||||
$(TARGET_DIR)/etc/redis.conf
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 0755 -D package/redis/S50redis \
|
||||
$(TARGET_DIR)/etc/init.d/S50redis
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 package/redis/redis.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/redis.service
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -fs ../../../../usr/lib/systemd/system/redis.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/redis.service
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
22
package/redis/redis.service
Normal file
22
package/redis/redis.service
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user