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