dockerd: Update to 26.1.4
[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:=2023.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://codeload.github.com/domoticz/domoticz/tar.gz/$(PKG_VERSION)?
16 PKG_HASH:=32bcf49df8c80c470352e63004a82d9601b90ccf406096099656250a4515ac28
17
18 PKG_MAINTAINER:=David Woodhouse <dwmw2@infradead.org>
19 PKG_LICENSE:=GPL-3.0
20 PKG_LICENSE_FILES:=License.txt
21 PKG_CPE_ID:=cpe:/a:domoticz:domoticz
22
23 PKG_BUILD_DEPENDS:=python3 minizip cereal
24 PKG_BUILD_FLAGS:=no-mips16 lto
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/domoticz
30 SECTION:=utils
31 CATEGORY:=Utilities
32 TITLE:=Open Source Home Automation System
33 URL:=http://domoticz.com/
34 USERID:=domoticz=6144:domoticz=6144
35 DEPENDS:= \
36 +boost \
37 +boost-date_time \
38 +boost-system \
39 +boost-thread \
40 +jsoncpp \
41 +libcurl \
42 +python3 \
43 +minizip \
44 +lua5.3 \
45 +libfmt \
46 +libmosquitto \
47 +libopenssl \
48 +libopenzwave \
49 +libsqlite3 \
50 +libstdcpp \
51 +telldus-core \
52 +zlib
53 endef
54
55 define Package/domoticz/description
56 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.
57 endef
58
59 CMAKE_OPTIONS += \
60 -DBUILD_SHARED_LIBS=yes \
61 -DBoost_NO_BOOST_CMAKE=yes \
62 -DGIT_SUBMODULE=no \
63 -DCMAKE_BUILD_TYPE=Release \
64 -DUSE_BUILTIN_MQTT=no \
65 -DUSE_BUILTIN_SQLITE=no \
66 -DUSE_BUILTIN_JSONCPP=no \
67 -DUSE_BUILTIN_MINIZIP=no \
68 -DUSE_BUILTIN_LIBFMT=no \
69 -DUSE_LUA_STATIC=no \
70 -DUSE_STATIC_BOOST=no \
71 -DUSE_STATIC_LIBSTDCXX=no \
72 -DUSE_STATIC_OPENZWAVE=no \
73 -DUSE_OPENSSL_STATIC=no \
74 -DUSE_PYTHON=yes \
75 -DWITH_LIBUSB=no
76
77 TARGET_CXXFLAGS += -DWITH_GPIO
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))