domoticz.mk 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ################################################################################
  2. #
  3. # domoticz
  4. #
  5. ################################################################################
  6. DOMOTICZ_VERSION = 4.9700
  7. DOMOTICZ_SITE = $(call github,domoticz,domoticz,$(DOMOTICZ_VERSION))
  8. DOMOTICZ_LICENSE = GPL-3.0
  9. DOMOTICZ_LICENSE_FILES = License.txt
  10. DOMOTICZ_DEPENDENCIES = \
  11. boost \
  12. host-pkgconf \
  13. libcurl \
  14. lua \
  15. mosquitto \
  16. openssl \
  17. sqlite \
  18. zlib
  19. # Due to the dependency on mosquitto, domoticz depends on
  20. # !BR2_STATIC_LIBS so set USE_STATIC_BOOST to OFF
  21. DOMOTICZ_CONF_OPTS += -DUSE_STATIC_BOOST=OFF
  22. # Do not use any built-in libraries which are enabled by default for
  23. # lua, sqlite and mqtt
  24. DOMOTICZ_CONF_OPTS += \
  25. -DUSE_BUILTIN_LUA=OFF \
  26. -DUSE_BUILTIN_SQLITE=OFF \
  27. -DUSE_BUILTIN_MQTT=OFF
  28. ifeq ($(BR2_PACKAGE_LIBUSB),y)
  29. DOMOTICZ_DEPENDENCIES += libusb
  30. endif
  31. ifeq ($(BR2_PACKAGE_OPENZWAVE),y)
  32. DOMOTICZ_DEPENDENCIES += openzwave
  33. # Due to the dependency on mosquitto, domoticz depends on
  34. # !BR2_STATIC_LIBS so set USE_STATIC_OPENZWAVE to OFF otherwise
  35. # domoticz will not find the openzwave library as it searches by
  36. # default a static library.
  37. DOMOTICZ_CONF_OPTS += -DUSE_STATIC_OPENZWAVE=OFF
  38. endif
  39. ifeq ($(BR2_PACKAGE_PYTHON3),y)
  40. DOMOTICZ_DEPENDENCIES += python3
  41. DOMOTICZ_CONF_OPTS += -DUSE_PYTHON=ON
  42. else
  43. DOMOTICZ_CONF_OPTS += -DUSE_PYTHON=OFF
  44. endif
  45. # Install domoticz in a dedicated directory (/opt/domoticz) as
  46. # domoticz expects by default that all its subdirectories (www,
  47. # Config, scripts, ...) are in the binary directory.
  48. DOMOTICZ_TARGET_DIR = /opt/domoticz
  49. DOMOTICZ_CONF_OPTS += -DCMAKE_INSTALL_PREFIX=$(DOMOTICZ_TARGET_DIR)
  50. # Delete License.txt and updatedomo files installed by domoticz in target
  51. # directory
  52. # Do not delete History.txt as it is used in source code
  53. define DOMOTICZ_REMOVE_UNNEEDED_FILES
  54. $(RM) $(TARGET_DIR)/$(DOMOTICZ_TARGET_DIR)/License.txt
  55. $(RM) $(TARGET_DIR)/$(DOMOTICZ_TARGET_DIR)/updatedomo
  56. endef
  57. DOMOTICZ_POST_INSTALL_TARGET_HOOKS += DOMOTICZ_REMOVE_UNNEEDED_FILES
  58. # Use dedicated init scripts for systemV and systemd instead of using
  59. # domoticz.sh as it is not compatible with buildroot init system
  60. define DOMOTICZ_INSTALL_INIT_SYSV
  61. $(INSTALL) -D -m 0755 package/domoticz/S99domoticz \
  62. $(TARGET_DIR)/etc/init.d/S99domoticz
  63. endef
  64. define DOMOTICZ_INSTALL_INIT_SYSTEMD
  65. $(INSTALL) -D -m 644 package/domoticz/domoticz.service \
  66. $(TARGET_DIR)/usr/lib/systemd/system/domoticz.service
  67. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  68. ln -sf ../../../../usr/lib/systemd/system/domoticz.service \
  69. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/domoticz.service
  70. endef
  71. $(eval $(cmake-package))