memcached: bump version to 1.4.36
[buildroot-gz.git] / package / domoticz / domoticz.mk
blob48cdbc4152403ce8948947c14f949f91c70c2b56
1 ################################################################################
3 # domoticz
5 ################################################################################
7 DOMOTICZ_VERSION = 3.5877
8 DOMOTICZ_SITE = $(call github,domoticz,domoticz,$(DOMOTICZ_VERSION))
9 DOMOTICZ_LICENSE = GPLv3
10 DOMOTICZ_LICENSE_FILES = License.txt
11 DOMOTICZ_DEPENDENCIES = \
12 boost \
13 host-pkgconf \
14 libcurl \
15 lua \
16 mosquitto \
17 openssl \
18 sqlite \
19 zlib
21 # Fixes:
22 # http://autobuild.buildroot.org/results/454c0ea393615bae2d1b44be9920f25b5c49fc33
23 # There is an issue with powerpc64le and boost::uuids::random_generator on the
24 # following line of code (from include/boost/uuid/seed_rng.hpp):
25 # sha.process_bytes( (unsigned char const*)&std::rand, sizeof( void(*)() ) )
26 # This line "inspects the first couple bytes (here eight) of the std::rand
27 # function to seed some rng. Due to the implementation of process_bytes and
28 # inlining happening, it seems that one of the loops therein uses &rand-1 as
29 # some boundary, compiling with -O0 makes that reloc come out as 'rand + 0' and
30 # the link will succeed."
31 # See: https://bugzilla.suse.com/show_bug.cgi?id=955832#c7
32 ifeq ($(BR2_powerpc64le),y)
33 DOMOTICZ_CXXFLAGS += -O0
34 endif
36 # Due to the dependency on mosquitto, domoticz depends on
37 # !BR2_STATIC_LIBS so set USE_STATIC_BOOST to OFF
38 DOMOTICZ_CONF_OPTS += -DUSE_STATIC_BOOST=OFF
40 # Do not use any built-in libraries which are enabled by default for
41 # lua, sqlite and mqtt
42 DOMOTICZ_CONF_OPTS += \
43 -DUSE_BUILTIN_LUA=OFF \
44 -DUSE_BUILTIN_SQLITE=OFF \
45 -DUSE_BUILTIN_MQTT=OFF \
46 -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) $(DOMOTICZ_CXXFLAGS)"
48 ifeq ($(BR2_PACKAGE_LIBUSB),y)
49 DOMOTICZ_DEPENDENCIES += libusb
50 endif
52 ifeq ($(BR2_PACKAGE_OPENZWAVE),y)
53 DOMOTICZ_DEPENDENCIES += openzwave
55 # Due to the dependency on mosquitto, domoticz depends on
56 # !BR2_STATIC_LIBS so set USE_STATIC_OPENZWAVE to OFF otherwise
57 # domoticz will not find the openzwave library as it searches by
58 # default a static library.
59 DOMOTICZ_CONF_OPTS += -DUSE_STATIC_OPENZWAVE=OFF
60 endif
62 # Install domoticz in a dedicated directory (/opt/domoticz) as
63 # domoticz expects by default that all its subdirectories (www,
64 # Config, scripts, ...) are in the binary directory.
65 DOMOTICZ_TARGET_DIR = /opt/domoticz
66 DOMOTICZ_CONF_OPTS += -DCMAKE_INSTALL_PREFIX=$(DOMOTICZ_TARGET_DIR)
68 # Delete License.txt and updatedomo files installed by domoticz in target
69 # directory
70 # Do not delete History.txt as it is used in source code
71 define DOMOTICZ_REMOVE_UNNEEDED_FILES
72 $(RM) $(TARGET_DIR)/$(DOMOTICZ_TARGET_DIR)/License.txt
73 $(RM) $(TARGET_DIR)/$(DOMOTICZ_TARGET_DIR)/updatedomo
74 endef
76 DOMOTICZ_POST_INSTALL_TARGET_HOOKS += DOMOTICZ_REMOVE_UNNEEDED_FILES
78 # Use dedicated init scripts for systemV and systemd instead of using
79 # domoticz.sh as it is not compatible with buildroot init system
80 define DOMOTICZ_INSTALL_INIT_SYSV
81 $(INSTALL) -D -m 0755 package/domoticz/S99domoticz \
82 $(TARGET_DIR)/etc/init.d/S99domoticz
83 endef
85 define DOMOTICZ_INSTALL_INIT_SYSTEMD
86 $(INSTALL) -D -m 644 package/domoticz/domoticz.service \
87 $(TARGET_DIR)/usr/lib/systemd/system/domoticz.service
88 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
89 ln -sf ../../../../usr/lib/systemd/system/domoticz.service \
90 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/domoticz.service
91 endef
93 $(eval $(cmake-package))