domoticz.mk 2.9 KB

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