Merge pull request #4732 from hashashin/bash-4.4.12
[feed/packages.git] / utils / domoticz / Makefile
1 #
2 # Copyright (C) 2016 - 2017 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_MAJOR:=3
12 PKG_VERSION_PATCH:=8153
13 PKG_VERSION:=$(PKG_VERSION_MAJOR).$(PKG_VERSION_PATCH)
14 PKG_RELEASE:=3
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://github.com/domoticz/domoticz/archive/$(PKG_VERSION)/$(PKG_SOURCE)
18 PKG_HASH:=5ea8f37f2ef900e9bd17b1b5375e75bfdec4f09001e3e2e0b647a260989d014c
19
20 PKG_LICENSE:=GPL-3.0
21 PKG_LICENSE_FILES:=License.txt
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_USE_MIPS16:=0
25
26 CMAKE_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/cmake.mk
30
31 define Package/domoticz
32 SECTION:=utils
33 CATEGORY:=Utilities
34 TITLE:=Open Source Home Automation System
35 URL:=http://domoticz.com/
36 MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
37 USERID:=domoticz=6144:domoticz=6144
38 DEPENDS:= \
39 +boost \
40 +boost-date_time \
41 +boost-system \
42 +boost-thread \
43 +libcurl \
44 +libmosquittopp \
45 +libopenssl \
46 +libopenzwave \
47 +libsqlite3 \
48 +libstdcpp \
49 +zlib
50 endef
51
52 define Package/domoticz/description
53 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.
54 endef
55
56 CMAKE_OPTIONS += \
57 -DCMAKE_BUILD_TYPE=Release \
58 -DUSE_BUILTIN_MQTT=no \
59 -DUSE_BUILTIN_SQLITE=no \
60 -DUSE_STATIC_BOOST=no \
61 -DUSE_STATIC_LIBSTDCXX=no \
62 -DUSE_STATIC_OPENZWAVE=no \
63 -DUSE_PYTHON=no
64
65 TARGET_CXXFLAGS+=-DWITH_GPIO
66
67 define Build/Prepare
68 $(call Build/Prepare/Default)
69 # Fix APPVERSION to suppress update popup
70 sed -i 's/#define APPVERSION.*/#define APPVERSION $(PKG_VERSION_PATCH)/' \
71 $(PKG_BUILD_DIR)/appversion.default
72 # Remove unwanted scripts
73 cd $(PKG_BUILD_DIR)/scripts && rm -rf \
74 buienradar_rain_example.pl \
75 _domoticz_main* \
76 download_update.sh \
77 dzVents/{.gitignore,documentation,examples,generated_scripts} \
78 dzVents/runtime/{integration-tests,misc/smoothing.xlsx,tests} \
79 logrotate/ \
80 lua_parsers/example* \
81 lua/*demo.lua \
82 python/ \
83 readme.txt \
84 restart_domoticz \
85 templates/All.Python \
86 update_domoticz
87 # Remove *.md
88 cd $(PKG_BUILD_DIR) && $(FIND) -name '*.md' -delete
89 endef
90
91 define Package/domoticz/install
92 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/tty $(1)/etc/init.d
93 $(INSTALL_BIN) ./files/domoticz.hotplug $(1)/etc/hotplug.d/tty/domoticz
94 $(INSTALL_BIN) ./files/domoticz.init $(1)/etc/init.d/domoticz
95 $(INSTALL_CONF) ./files/domoticz.config $(1)/etc/config/domoticz
96 $(INSTALL_DIR) $(1)/usr/share/domoticz $(1)/usr/bin
97 $(CP) $(PKG_INSTALL_DIR)/usr/Config $(1)/usr/share/domoticz/openzwave
98 $(CP) $(PKG_INSTALL_DIR)/usr/scripts $(1)/usr/share/domoticz/
99 $(CP) $(PKG_INSTALL_DIR)/usr/www $(1)/usr/share/domoticz/
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/domoticz $(1)/usr/bin/domoticz
101 endef
102
103 define Package/domoticz/conffiles
104 /etc/config/domoticz
105 /var/lib/domoticz/
106 endef
107
108 $(eval $(call BuildPackage,domoticz))