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