Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [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 \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | file://redis.service \ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 16 | file://hiredis-update-Makefile-to-add-symbols-to-staticlib.patch \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 17 | " |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 18 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 19 | SRC_URI[md5sum] = "87be8867447f62524b584813e5a7bd14" |
| 20 | SRC_URI[sha256sum] = "93e422c0d584623601f89b956045be158889ebe594478a2c24e1bf218495633f" |
| 21 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | inherit autotools-brokensep update-rc.d systemd useradd |
| 23 | |
| 24 | USERADD_PACKAGES = "${PN}" |
| 25 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis" |
| 26 | GROUPADD_PARAM_${PN} = "--system redis" |
| 27 | |
| 28 | |
| 29 | REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 30 | |
| 31 | do_install() { |
| 32 | export PREFIX=${D}/${prefix} |
| 33 | oe_runmake install |
| 34 | install -d ${D}/${sysconfdir}/redis |
| 35 | install -m 0644 ${WORKDIR}/redis.conf ${D}/${sysconfdir}/redis/redis.conf |
| 36 | install -d ${D}/${sysconfdir}/init.d |
| 37 | install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server |
| 38 | install -d ${D}/var/lib/redis/ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 39 | chown redis.redis ${D}/var/lib/redis/ |
| 40 | |
| 41 | install -d ${D}${systemd_system_unitdir} |
| 42 | install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir} |
| 43 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service |
| 44 | |
| 45 | if [ "${REDIS_ON_SYSTEMD}" = true ]; then |
| 46 | sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf |
| 47 | fi |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf" |
| 51 | |
| 52 | INITSCRIPT_NAME = "redis-server" |
| 53 | INITSCRIPT_PARAMS = "defaults 87" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 54 | |
| 55 | SYSTEMD_SERVICE_${PN} = "redis.service" |