2 # Copyright (C) 2016 - 2017 Stijn Tintel <stijn@linux-ipv6.be>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
12 PKG_VERSION_PATCH
:=10717
14 PKG_VERSION
:=$(PKG_VERSION_MAJOR
).
$(PKG_VERSION_PATCH
)
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
19 PKG_SOURCE_URL
:=https
://github.com
/domoticz
/domoticz
/archive
/$(PKG_VERSION
)/$(PKG_SOURCE
)
21 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_COMMIT
).
tar.gz
22 PKG_SOURCE_URL
:=https
://github.com
/domoticz
/domoticz
/archive
/$(PKG_COMMIT
)/$(PKG_SOURCE
)
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_COMMIT
)
25 PKG_HASH
:=c053a2161942529f56b748945ec297dcd67f449e68029fc886893a528891ad86
28 PKG_LICENSE_FILES
:=License.txt
30 PKG_BUILD_DEPENDS
:=python3
36 include $(INCLUDE_DIR
)/package.mk
37 include $(INCLUDE_DIR
)/cmake.mk
39 define Package
/domoticz
42 TITLE
:=Open Source Home Automation System
43 URL
:=http
://domoticz.com
/
44 MAINTAINER
:=Stijn Tintel
<stijn@linux-ipv6.be
>
45 USERID
:=domoticz
=6144:domoticz
=6144
61 define Package
/domoticz
/description
62 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.
66 -DBUILD_SHARED_LIBS
=yes \
67 -DBoost_NO_BOOST_CMAKE
=yes \
68 -DCMAKE_BUILD_TYPE
=Release \
69 -DUSE_BUILTIN_MQTT
=no \
70 -DUSE_BUILTIN_SQLITE
=no \
71 -DUSE_STATIC_BOOST
=no \
72 -DUSE_STATIC_LIBSTDCXX
=no \
73 -DUSE_STATIC_OPENZWAVE
=no \
74 -DUSE_OPENSSL_STATIC
=no \
79 TARGET_CXXFLAGS
+=-DWITH_GPIO
-flto
82 $(call Build
/Prepare
/Default
)
83 # Fix APPVERSION/APPDATE since we don't build from a git tree
84 sed
-i
's/#define APPVERSION.*/#define APPVERSION $(PKG_VERSION_PATCH)/' \
85 $(PKG_BUILD_DIR
)/appversion.default
86 COMMITDATE
=`tar tvfz $(DL_DIR)/$(PKG_SOURCE) --full-time | sed 's/.* \(20..-..-.. ..:..:..\) domoticz-.*/\1/;q'`; \
87 COMMITTS
=`date --date="$$$${COMMITDATE}" +%s`; \
88 sed
-i
"s/#define APPDATE.*/#define APPDATE $$$${COMMITTS}/" $(PKG_BUILD_DIR
)/appversion.default
89 ifneq ($(PKG_COMMIT
),)
90 sed
-i
"s/#define APPHASH.*/#define APPHASH \"$(shell echo $(PKG_COMMIT) | cut -c1-8)\"/" $(PKG_BUILD_DIR
)/appversion.default
92 # Remove unwanted scripts
93 cd
$(PKG_BUILD_DIR
)/scripts
&& rm -rf \
94 buienradar_rain_example.pl \
97 dzVents
/{.gitignore
,documentation
,examples
,generated_scripts
,data
} \
98 dzVents
/runtime
/{integration-tests
,misc
/smoothing.xlsx
,tests
} \
100 lua_parsers
/example
* \
105 templates
/All.Python \
109 cd
$(PKG_BUILD_DIR
) && $(FIND
) -name
'*.md' -delete
112 define Package
/domoticz
/install
113 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/hotplug.d
/tty
$(1)/etc
/init.d
$(1)/etc
/domoticz
/plugins
114 $(INSTALL_BIN
) .
/files
/domoticz.hotplug
$(1)/etc
/hotplug.d
/tty
/domoticz
115 $(INSTALL_BIN
) .
/files
/domoticz.init
$(1)/etc
/init.d
/domoticz
116 $(INSTALL_CONF
) .
/files
/domoticz.config
$(1)/etc
/config
/domoticz
117 $(INSTALL_DIR
) $(1)/usr
/share
/domoticz
$(1)/usr
/bin
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/dzVents
$(1)/usr
/share
/domoticz
/dzVents
119 $(CP
) $(PKG_INSTALL_DIR
)/usr
/Config
$(1)/usr
/share
/domoticz
/Config
120 $(CP
) $(PKG_INSTALL_DIR
)/usr
/scripts
$(1)/etc
/domoticz
/scripts
121 ln
-sf
/var
/lib
/domoticz
/dzVents
/generated_scripts
$(1)/etc
/domoticz
/scripts
/dzVents
122 ln
-sf
/var
/lib
/domoticz
/dzVents
/data
$(1)/etc
/domoticz
/scripts
/dzVents
123 $(CP
) $(PKG_INSTALL_DIR
)/usr
/www
$(1)/usr
/share
/domoticz
/
124 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/domoticz
$(1)/usr
/bin
/domoticz
125 # compress static web content
126 find
$(1)/usr
/share
/domoticz
/www
-name
"*.css" -exec gzip
-9 {} \
;
127 find
$(1)/usr
/share
/domoticz
/www
-name
"*.js" -exec gzip
-9 {} \
;
128 gzip
-9 $(1)/usr
/share
/domoticz
/www
/*.html
129 gzip
-9 $(1)/usr
/share
/domoticz
/www
/secpanel
/*.html
130 find
$(1)/usr
/share
/domoticz
/www
/views
-name
"*.html" -exec sh
-c
'grep -q "<\!--#embed" {} || gzip -9 {}' \
;
133 define Package
/domoticz
/conffiles
139 $(eval
$(call BuildPackage
,domoticz
))