redis.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ################################################################################
  2. #
  3. # redis
  4. #
  5. ################################################################################
  6. REDIS_VERSION = 3.2.12
  7. REDIS_SITE = http://download.redis.io/releases
  8. REDIS_LICENSE = BSD-3-Clause (core); MIT and BSD family licenses (Bundled components)
  9. REDIS_LICENSE_FILES = COPYING
  10. define REDIS_USERS
  11. redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server
  12. endef
  13. # Uses __atomic_fetch_add_4. Adding -latomic to LDFLAGS does not work,
  14. # because LDFLAGS is used before the list of object files. We need to
  15. # add -latomic to FINAL_LIBS to provide -latomic at the correct place
  16. # in the linking command.
  17. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  18. define REDIS_FIX_MAKEFILE
  19. $(SED) 's/FINAL_LIBS=-lm/FINAL_LIBS=-lm -latomic/' $(@D)/src/Makefile
  20. endef
  21. REDIS_POST_PATCH_HOOKS = REDIS_FIX_MAKEFILE
  22. endif
  23. # Redis doesn't support DESTDIR (yet, see
  24. # https://github.com/antirez/redis/pull/609). We set PREFIX
  25. # instead.
  26. REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
  27. PREFIX=$(TARGET_DIR)/usr MALLOC=libc
  28. define REDIS_BUILD_CMDS
  29. $(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
  30. endef
  31. define REDIS_INSTALL_TARGET_CMDS
  32. $(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D) \
  33. LDCONFIG=true install
  34. $(INSTALL) -D -m 0644 $(@D)/redis.conf \
  35. $(TARGET_DIR)/etc/redis.conf
  36. endef
  37. define REDIS_INSTALL_INIT_SYSV
  38. $(INSTALL) -m 0755 -D package/redis/S50redis \
  39. $(TARGET_DIR)/etc/init.d/S50redis
  40. endef
  41. define REDIS_INSTALL_INIT_SYSTEMD
  42. $(INSTALL) -D -m 0644 package/redis/redis.service \
  43. $(TARGET_DIR)/usr/lib/systemd/system/redis.service
  44. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  45. ln -fs ../../../../usr/lib/systemd/system/redis.service \
  46. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/redis.service
  47. endef
  48. $(eval $(generic-package))