0241d8275163be1f8fae9a2a90778a8325809565
[feed/packages.git] / utils / domoticz / Makefile
1 #
2 # Copyright (C) 2016 - 2020 Stijn Tintel <stijn@linux-ipv6.be>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=domoticz
11 PKG_VERSION:=2021.1
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/domoticz/domoticz/archive/$(PKG_VERSION)/$(PKG_SOURCE)
16 PKG_HASH:=c4dc3455edae8bf00d2e950002f70d5b90ac577b1559ef7ada6870d970069fbb
17
18 PKG_MAINTAINER:=David Woodhouse <dwmw2@infradead.org>
19 PKG_LICENSE:=GPL-3.0
20 PKG_LICENSE_FILES:=License.txt
21
22 PKG_BUILD_DEPENDS:=python3 minizip cereal
23 PKG_USE_MIPS16:=0
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 define Package/domoticz
29 SECTION:=utils
30 CATEGORY:=Utilities
31 TITLE:=Open Source Home Automation System
32 URL:=http://domoticz.com/
33 USERID:=domoticz=6144:domoticz=6144
34 DEPENDS:= \
35 +boost \
36 +boost-date_time \
37 +boost-system \
38 +boost-thread \
39 +jsoncpp \
40 +libcurl \
41 +python3 \
42 +minizip \
43 +lua5.3 \
44 +libfmt \
45 +libmosquitto \
46 +libopenssl \
47 +libopenzwave \
48 +libsqlite3 \
49 +libstdcpp \
50 +telldus-core \
51 +zlib
52 endef
53
54 define Package/domoticz/description
55 Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device.
56 endef
57
58 CMAKE_OPTIONS += \
59 -DBUILD_SHARED_LIBS=yes \
60 -DBoost_NO_BOOST_CMAKE=yes \
61 -DGIT_SUBMODULE=no \
62 -DCMAKE_BUILD_TYPE=Release \
63 -DUSE_BUILTIN_MQTT=no \
64 -DUSE_BUILTIN_SQLITE=no \
65 -DUSE_BUILTIN_JSONCPP=no \
66 -DUSE_BUILTIN_MINIZIP=no \
67 -DUSE_BUILTIN_LIBFMT=no \
68 -DUSE_LUA_STATIC=no \
69 -DUSE_STATIC_BOOST=no \
70 -DUSE_STATIC_LIBSTDCXX=no \
71 -DUSE_STATIC_OPENZWAVE=no \
72 -DUSE_OPENSSL_STATIC=no \
73 -DUSE_PYTHON=yes \
74 -DWITH_LIBUSB=no
75
76 TARGET_CFLAGS += -flto
77 TARGET_CXXFLAGS += -DWITH_GPIO -flto
78
79 define Build/Prepare
80 $(call Build/Prepare/Default)
81 # Remove unwanted scripts
82 cd $(PKG_BUILD_DIR)/scripts && rm -rf \
83 buienradar_rain_example.pl \
84 _domoticz_main* \
85 download_update.sh \
86 dzVents/{.gitignore,documentation,examples,generated_scripts,data} \
87 dzVents/runtime/{integration-tests,misc/smoothing.xlsx,tests} \
88 logrotate/ \
89 lua_parsers/example* \
90 lua/*demo.lua \
91 python/ \
92 readme.txt \
93 restart_domoticz \
94 templates/All.Python \
95 update_domoticz \
96 domoticz.conf
97 # Remove *.md
98 cd $(PKG_BUILD_DIR) && $(FIND) -name '*.md' -delete
99 endef
100
101 define Package/domoticz/install
102 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/tty $(1)/etc/init.d $(1)/etc/domoticz/plugins
103 $(INSTALL_BIN) ./files/domoticz.hotplug $(1)/etc/hotplug.d/tty/domoticz
104 $(INSTALL_BIN) ./files/domoticz.init $(1)/etc/init.d/domoticz
105 $(INSTALL_CONF) ./files/domoticz.config $(1)/etc/config/domoticz
106 $(INSTALL_DIR) $(1)/usr/share/domoticz $(1)/usr/bin
107 $(CP) $(PKG_INSTALL_DIR)/usr/dzVents $(1)/usr/share/domoticz/dzVents
108 $(CP) $(PKG_INSTALL_DIR)/usr/Config $(1)/usr/share/domoticz/Config
109 $(CP) $(PKG_INSTALL_DIR)/usr/scripts $(1)/etc/domoticz/scripts
110 ln -sf /var/lib/domoticz/dzVents/generated_scripts $(1)/etc/domoticz/scripts/dzVents
111 ln -sf /var/lib/domoticz/dzVents/data $(1)/etc/domoticz/scripts/dzVents
112 $(CP) $(PKG_INSTALL_DIR)/usr/www $(1)/usr/share/domoticz/
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/domoticz $(1)/usr/bin/domoticz
114 # compress static web content
115 find $(1)/usr/share/domoticz/www -name "*.css" -exec gzip -9 {} \;
116 find $(1)/usr/share/domoticz/www -name "*.js" -exec gzip -9 {} \;
117 gzip -9 $(1)/usr/share/domoticz/www/*.html
118 gzip -9 $(1)/usr/share/domoticz/www/secpanel/*.html
119 find $(1)/usr/share/domoticz/www/views -name "*.html" -exec sh -c 'grep -q "<\!--#embed" {} || gzip -9 {}' \;
120 endef
121
122 define Package/domoticz/conffiles
123 /etc/config/domoticz
124 /var/lib/domoticz/
125 /etc/domoticz/
126 endef
127
128 $(eval $(call BuildPackage,domoticz))