blob: 80d36d2ba1569717e81a7b5ee2061c31f0f397da [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "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 = ""
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 \
13 file://redis.conf \
14 file://init-redis-server \
15 file://redis.service \
16"
17
18SRC_URI_append_mips = " file://remove-atomics.patch"
19SRC_URI_append_arm = " file://remove-atomics.patch"
20
21SRC_URI[md5sum] = "c75b11e4177e153e4dc1d8dd3a6174e4"
22SRC_URI[sha256sum] = "ff0c38b8c156319249fec61e5018cf5b5fe63a65b61690bec798f4c998c232ad"
23
24inherit autotools-brokensep update-rc.d systemd useradd
25
26USERADD_PACKAGES = "${PN}"
27USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
28GROUPADD_PARAM_${PN} = "--system redis"
29
30
31REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
32
33do_install() {
34 export PREFIX=${D}/${prefix}
35 oe_runmake install
36 install -d ${D}/${sysconfdir}/redis
37 install -m 0644 ${WORKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf
38 install -d ${D}/${sysconfdir}/init.d
39 install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server
40 install -d ${D}/var/lib/redis/
41 chown redis.redis ${D}/var/lib/redis/
42
43 install -d ${D}${systemd_system_unitdir}
44 install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
45 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
46
47 if [ "${REDIS_ON_SYSTEMD}" = true ]; then
48 sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
49 fi
50}
51
52CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf"
53
54INITSCRIPT_NAME = "redis-server"
55INITSCRIPT_PARAMS = "defaults 87"
56
57SYSTEMD_SERVICE_${PN} = "redis.service"