blob: 40473461a2947ab5dc74e985daa25c6fcba920c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
SUMMARY = "Redis key-value store"
DESCRIPTION = "Redis is an open source, advanced key-value store."
HOMEPAGE = "http://redis.io"
SECTION = "libs"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=8ffdd6c926faaece928cf9d9640132d2"
DEPENDS = "readline lua ncurses"
SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \
file://redis.conf \
file://init-redis-server \
file://redis.service \
file://0001-hiredis-use-default-CC-if-it-is-set.patch \
file://0002-lua-update-Makefile-to-use-environment-build-setting.patch \
file://0003-hack-to-force-use-of-libc-malloc.patch \
file://0004-src-Do-not-reset-FINAL_LIBS.patch \
file://0005-Define-_GNU_SOURCE-to-get-PTHREAD_MUTEX_INITIALIZER.patch \
file://0006-Define-correct-gregs-for-RISCV32.patch \
"
SRC_URI[sha256sum] = "846bff83c26d827d49f8cc8114ea9d1e72eea1169f7de36b8135ea2cec104e7d"
inherit autotools-brokensep update-rc.d systemd useradd
FINAL_LIBS:x86:toolchain-clang = "-latomic"
FINAL_LIBS:riscv32 = "-latomic"
FINAL_LIBS:mips = "-latomic"
FINAL_LIBS:arm = "-latomic"
FINAL_LIBS:powerpc = "-latomic"
export FINAL_LIBS
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
GROUPADD_PARAM:${PN} = "--system redis"
REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
do_compile:prepend() {
(cd deps && oe_runmake hiredis lua linenoise)
}
do_install() {
export PREFIX=${D}/${prefix}
oe_runmake install
install -d ${D}/${sysconfdir}/redis
install -m 0644 ${UNPACKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf
install -d ${D}/${sysconfdir}/init.d
install -m 0755 ${UNPACKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server
install -d ${D}/var/lib/redis/
chown redis.redis ${D}/var/lib/redis/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${UNPACKDIR}/redis.service ${D}${systemd_system_unitdir}
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
if [ "${REDIS_ON_SYSTEMD}" = true ]; then
sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
fi
}
CONFFILES:${PN} = "${sysconfdir}/redis/redis.conf"
INITSCRIPT_NAME = "redis-server"
INITSCRIPT_PARAMS = "defaults 87"
SYSTEMD_SERVICE:${PN} = "redis.service"
|