blob: 5df5312a0f20ab7dd14e8e5d2f3b506d408c05e4 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Redis key-value store"
2DESCRIPTION = "Redis is an open source, advanced key-value store."
3HOMEPAGE = "http://redis.io"
4SECTION = "libs"
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=3c01b49fed4df1a79843688fa3f7b9d6"
7DEPENDS = "readline lua ncurses"
8
9SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \
10 file://hiredis-use-default-CC-if-it-is-set.patch \
11 file://lua-update-Makefile-to-use-environment-build-setting.patch \
12 file://oe-use-libc-malloc.patch \
Brad Bishop26bdd442019-08-16 17:08:17 -040013 file://Fixed-stack-trace-generation-on-aarch64.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040014 file://redis.conf \
15 file://init-redis-server \
16 file://redis.service \
17"
18
19SRC_URI_append_mips = " file://remove-atomics.patch"
20SRC_URI_append_arm = " file://remove-atomics.patch"
21SRC_URI_append_powerpc = " file://remove-atomics.patch"
22
23SRC_URI[md5sum] = "96ae20ffd68b9daee24b702b754d89f3"
24SRC_URI[sha256sum] = "1e1e18420a86cfb285933123b04a82e1ebda20bfb0a289472745a087587e93a7"
25
26inherit autotools-brokensep update-rc.d systemd useradd
27
28USERADD_PACKAGES = "${PN}"
29USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
30GROUPADD_PARAM_${PN} = "--system redis"
31
32
33REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
34
35do_compile_prepend() {
36 (cd deps && oe_runmake hiredis lua linenoise)
37}
38
39do_install() {
40 export PREFIX=${D}/${prefix}
41 oe_runmake install
42 install -d ${D}/${sysconfdir}/redis
43 install -m 0644 ${WORKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf
44 install -d ${D}/${sysconfdir}/init.d
45 install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server
46 install -d ${D}/var/lib/redis/
47 chown redis.redis ${D}/var/lib/redis/
48
49 install -d ${D}${systemd_system_unitdir}
50 install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
51 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
52
53 if [ "${REDIS_ON_SYSTEMD}" = true ]; then
54 sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
55 fi
56}
57
58CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf"
59
60INITSCRIPT_NAME = "redis-server"
61INITSCRIPT_PARAMS = "defaults 87"
62
63SYSTEMD_SERVICE_${PN} = "redis.service"