Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [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" |
Brad Bishop | 2d39a06 | 2019-10-28 08:33:36 -0400 | [diff] [blame] | 5 | LICENSE = "BSD-3-Clause" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=3c01b49fed4df1a79843688fa3f7b9d6" |
| 7 | DEPENDS = "readline lua ncurses" |
| 8 | |
| 9 | SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 10 | file://redis.conf \ |
| 11 | file://init-redis-server \ |
| 12 | file://redis.service \ |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 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://0005-Mark-extern-definition-of-SDS_NOINIT-in-sds.h.patch \ |
| 18 | file://GNU_SOURCE.patch \ |
| 19 | " |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 20 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 21 | SRC_URI[md5sum] = "612ec43075a888bc8b8a7dd8ccb2e0f7" |
| 22 | SRC_URI[sha256sum] = "61db74eabf6801f057fd24b590232f2f337d422280fd19486eca03be87d3a82b" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 23 | |
| 24 | inherit autotools-brokensep update-rc.d systemd useradd |
| 25 | |
Brad Bishop | a891d15 | 2019-09-13 06:17:45 -0400 | [diff] [blame] | 26 | FINAL_LIBS_x86_toolchain-clang = "-latomic" |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 27 | FINAL_LIBS_mips = "-latomic" |
| 28 | FINAL_LIBS_arm = "-latomic" |
| 29 | FINAL_LIBS_powerpc = "-latomic" |
| 30 | |
Brad Bishop | a891d15 | 2019-09-13 06:17:45 -0400 | [diff] [blame] | 31 | export FINAL_LIBS |
| 32 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 33 | USERADD_PACKAGES = "${PN}" |
| 34 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis" |
| 35 | GROUPADD_PARAM_${PN} = "--system redis" |
| 36 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 37 | REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" |
| 38 | |
| 39 | do_compile_prepend() { |
| 40 | (cd deps && oe_runmake hiredis lua linenoise) |
| 41 | } |
| 42 | |
| 43 | do_install() { |
| 44 | export PREFIX=${D}/${prefix} |
| 45 | oe_runmake install |
| 46 | install -d ${D}/${sysconfdir}/redis |
| 47 | install -m 0644 ${WORKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf |
| 48 | install -d ${D}/${sysconfdir}/init.d |
| 49 | install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server |
| 50 | install -d ${D}/var/lib/redis/ |
| 51 | chown redis.redis ${D}/var/lib/redis/ |
| 52 | |
| 53 | install -d ${D}${systemd_system_unitdir} |
| 54 | install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir} |
| 55 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service |
| 56 | |
| 57 | if [ "${REDIS_ON_SYSTEMD}" = true ]; then |
| 58 | sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf |
| 59 | fi |
| 60 | } |
| 61 | |
| 62 | CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf" |
| 63 | |
| 64 | INITSCRIPT_NAME = "redis-server" |
| 65 | INITSCRIPT_PARAMS = "defaults 87" |
| 66 | |
| 67 | SYSTEMD_SERVICE_${PN} = "redis.service" |