Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [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" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=3c01b49fed4df1a79843688fa3f7b9d6" |
| 7 | DEPENDS = "" |
| 8 | |
| 9 | SRC_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 | |
| 18 | SRC_URI_append_mips = " file://remove-atomics.patch" |
| 19 | SRC_URI_append_arm = " file://remove-atomics.patch" |
| 20 | |
| 21 | SRC_URI[md5sum] = "c75b11e4177e153e4dc1d8dd3a6174e4" |
| 22 | SRC_URI[sha256sum] = "ff0c38b8c156319249fec61e5018cf5b5fe63a65b61690bec798f4c998c232ad" |
| 23 | |
| 24 | inherit autotools-brokensep update-rc.d systemd useradd |
| 25 | |
| 26 | USERADD_PACKAGES = "${PN}" |
| 27 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis" |
| 28 | GROUPADD_PARAM_${PN} = "--system redis" |
| 29 | |
| 30 | |
| 31 | REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" |
| 32 | |
| 33 | do_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 | |
| 52 | CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf" |
| 53 | |
| 54 | INITSCRIPT_NAME = "redis-server" |
| 55 | INITSCRIPT_PARAMS = "defaults 87" |
| 56 | |
| 57 | SYSTEMD_SERVICE_${PN} = "redis.service" |