blob: 65b525709e031b7d013b4624e364192aa9ca9da8 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Redis key-value store"
2DESCRIPTION = "Redis is an open source, advanced key-value store."
3HOMEPAGE = "http://redis.io"
4SECTION = "libs"
5LICENSE = "BSD-3-Clause"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -05006LIC_FILES_CHKSUM = "file://COPYING;md5=8ffdd6c926faaece928cf9d9640132d2"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007DEPENDS = "readline lua ncurses"
8
9SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \
10 file://redis.conf \
11 file://init-redis-server \
12 file://redis.service \
13 file://hiredis-use-default-CC-if-it-is-set.patch \
14 file://lua-update-Makefile-to-use-environment-build-setting.patch \
15 file://oe-use-libc-malloc.patch \
16 file://0001-src-Do-not-reset-FINAL_LIBS.patch \
17 file://GNU_SOURCE.patch \
Andrew Geisslere34f8962021-04-15 15:53:51 -050018 file://0006-Define-correct-gregs-for-RISCV32.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 "
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050020SRC_URI[sha256sum] = "7a260bb74860f1b88c3d5942bf8ba60ca59f121c6dce42d3017bed6add0b9535"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021
22inherit autotools-brokensep update-rc.d systemd useradd
23
24FINAL_LIBS_x86_toolchain-clang = "-latomic"
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050025FINAL_LIBS_riscv32_toolchain-clang = "-latomic"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026FINAL_LIBS_mips = "-latomic"
27FINAL_LIBS_arm = "-latomic"
28FINAL_LIBS_powerpc = "-latomic"
29
30export FINAL_LIBS
31
32USERADD_PACKAGES = "${PN}"
33USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
34GROUPADD_PARAM_${PN} = "--system redis"
35
36REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
37
38do_compile_prepend() {
39 (cd deps && oe_runmake hiredis lua linenoise)
40}
41
42do_install() {
43 export PREFIX=${D}/${prefix}
44 oe_runmake install
45 install -d ${D}/${sysconfdir}/redis
46 install -m 0644 ${WORKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf
47 install -d ${D}/${sysconfdir}/init.d
48 install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server
49 install -d ${D}/var/lib/redis/
50 chown redis.redis ${D}/var/lib/redis/
51
52 install -d ${D}${systemd_system_unitdir}
53 install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
54 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
55
56 if [ "${REDIS_ON_SYSTEMD}" = true ]; then
57 sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
58 fi
59}
60
61CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf"
62
63INITSCRIPT_NAME = "redis-server"
64INITSCRIPT_PARAMS = "defaults 87"
65
66SYSTEMD_SERVICE_${PN} = "redis.service"