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