mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 17:04:32 +04:00
domoticz: improve config, don't require telldus
Add support for configuring the -vhostname, as it helps to get the right issuer into OAuth2 tokens. Also disable the mdns responder by default; when we're running on OpenWrt we have better options that that. Clean up the logging options, and also make it export $TZ to work around our musl hack which otherwise opens and reads /etc/TZ thousands of times a minute. Also drop the telldus dependency. Domoticz will dlopen that at runtime without having to have it present at build time at all, so it should still work for users who install it. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=domoticz
|
PKG_NAME:=domoticz
|
||||||
PKG_VERSION:=2025.2
|
PKG_VERSION:=2025.2
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/domoticz/domoticz/tar.gz/$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/domoticz/domoticz/tar.gz/$(PKG_VERSION)?
|
||||||
@@ -47,7 +47,6 @@ define Package/domoticz
|
|||||||
+libopenzwave \
|
+libopenzwave \
|
||||||
+libsqlite3 \
|
+libsqlite3 \
|
||||||
+libstdcpp \
|
+libstdcpp \
|
||||||
+telldus-core \
|
|
||||||
+zlib
|
+zlib
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -72,7 +71,8 @@ CMAKE_OPTIONS += \
|
|||||||
-DUSE_STATIC_OPENZWAVE=no \
|
-DUSE_STATIC_OPENZWAVE=no \
|
||||||
-DUSE_OPENSSL_STATIC=no \
|
-DUSE_OPENSSL_STATIC=no \
|
||||||
-DUSE_PYTHON=yes \
|
-DUSE_PYTHON=yes \
|
||||||
-DWITH_LIBUSB=no
|
-DWITH_LIBUSB=no \
|
||||||
|
-DWITH_TELLDUSCORE=no
|
||||||
|
|
||||||
TARGET_CXXFLAGS += -DWITH_GPIO
|
TARGET_CXXFLAGS += -DWITH_GPIO
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
config domoticz
|
config domoticz
|
||||||
option disabled '1'
|
option disabled '1'
|
||||||
option loglevel '1'
|
# (combination of: all,normal,status,error,debug)
|
||||||
|
option loglevel 'normal'
|
||||||
|
# (combination of: all,normal,hardware,received,webserver,eventsystem,python,thread_id,sql,auth)
|
||||||
|
option debuglevel 'normal'
|
||||||
|
# [user|daemon|local0 .. local7]
|
||||||
option syslog 'daemon'
|
option syslog 'daemon'
|
||||||
|
# You can point it at ACME certs directly and it reloads automatically when they change.
|
||||||
# option sslcert '/path/to/ssl.crt'
|
# option sslcert '/path/to/ssl.crt'
|
||||||
# option sslkey '/path/to/ssl.key'
|
# option sslkey '/path/to/ssl.key'
|
||||||
# option sslpass 'passphrase'
|
# option sslpass 'passphrase'
|
||||||
# option ssldhparam '/path/to/dhparam.pem'
|
# option ssldhparam '/path/to/dhparam.pem'
|
||||||
|
# option mdns '0'
|
||||||
|
# option www '8080'
|
||||||
option sslwww '0'
|
option sslwww '0'
|
||||||
# CAUTION - by default, /var is not persistent accross reboots
|
# CAUTION - by default, /var is not persistent accross reboots
|
||||||
# Don't forget the trailing / - domoticz requires it
|
# Don't forget the trailing / - domoticz requires it
|
||||||
|
|||||||
@@ -7,18 +7,22 @@ PIDFILE=/var/run/domoticz.pid
|
|||||||
|
|
||||||
start_domoticz() {
|
start_domoticz() {
|
||||||
local section="$1"
|
local section="$1"
|
||||||
local disabled loglevel sslcert sslpass sslwww syslog userdata
|
local disabled loglevel debuglevel mdns sslcert sslpass sslwww www syslog vhostname userdata
|
||||||
|
|
||||||
config_get_bool disabled "$section" "disabled" 0
|
config_get_bool disabled "$section" "disabled" 0
|
||||||
[ "$disabled" -gt 0 ] && return
|
[ "$disabled" -gt 0 ] && return
|
||||||
|
|
||||||
config_get loglevel "$section" "loglevel"
|
config_get loglevel "$section" "loglevel"
|
||||||
|
config_get debuglevel "$section" "debuglevel"
|
||||||
|
config_get_bool mdns "$section" "mdns" 0
|
||||||
config_get sslcert "$section" "sslcert"
|
config_get sslcert "$section" "sslcert"
|
||||||
config_get sslkey "$section" "sslkey"
|
config_get sslkey "$section" "sslkey"
|
||||||
config_get sslpass "$section" "sslpass"
|
config_get sslpass "$section" "sslpass"
|
||||||
config_get ssldhparam "$section" "ssldhparam"
|
config_get ssldhparam "$section" "ssldhparam"
|
||||||
config_get sslwww "$section" "sslwww"
|
config_get sslwww "$section" "sslwww"
|
||||||
|
config_get www "$section" "www"
|
||||||
config_get syslog "$section" "syslog"
|
config_get syslog "$section" "syslog"
|
||||||
|
config_get vhostname "$section" "vhostname"
|
||||||
config_get userdata "$section" "userdata" userdata /var/lib/domoticz
|
config_get userdata "$section" "userdata" userdata /var/lib/domoticz
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
@@ -26,8 +30,12 @@ start_domoticz() {
|
|||||||
procd_append_param command -noupdates
|
procd_append_param command -noupdates
|
||||||
procd_append_param command -approot /usr/share/domoticz/
|
procd_append_param command -approot /usr/share/domoticz/
|
||||||
|
|
||||||
|
[ "$mdns" -eq 0 ] && procd_append_param command "-nomdns"
|
||||||
[ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
|
[ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
|
||||||
|
[ -n "$debuglevel" ] && procd_append_param command -debuglevel "$debuglevel"
|
||||||
[ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
|
[ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
|
||||||
|
[ -n "$vhostname" ] && procd_append_param command -vhostname "$vhostname"
|
||||||
|
[ -n "$www" ] && procd_append_param command -www "$www"
|
||||||
|
|
||||||
[ -d "${userdata}" ] || {
|
[ -d "${userdata}" ] || {
|
||||||
mkdir -p "${userdata}"
|
mkdir -p "${userdata}"
|
||||||
@@ -56,6 +64,10 @@ start_domoticz() {
|
|||||||
[ -n "$ssldhparam" ] && procd_append_param command -ssldhparam "$ssldhparam"
|
[ -n "$ssldhparam" ] && procd_append_param command -ssldhparam "$ssldhparam"
|
||||||
} || procd_append_param command -sslwww 0
|
} || procd_append_param command -sslwww 0
|
||||||
|
|
||||||
|
# OpenWrt musl has a hack to read /etc/TZ every time if $TZ isn't set.
|
||||||
|
# Work around it by setting $TZ
|
||||||
|
[ -r "/etc/TZ" ] && procd_append_param env TZ="$(cat /etc/TZ)"
|
||||||
|
|
||||||
procd_set_param pidfile "$PIDFILE"
|
procd_set_param pidfile "$PIDFILE"
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
procd_set_param stdout 0
|
procd_set_param stdout 0
|
||||||
|
|||||||
41
utils/domoticz/patches/001-domoticz-2025.2-no-telldus.patch
Normal file
41
utils/domoticz/patches/001-domoticz-2025.2-no-telldus.patch
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -32,6 +32,7 @@ option(USE_PYTHON "Use Python for Plugin
|
||||||
|
option(INCLUDE_LINUX_I2C "Include I2C support" YES)
|
||||||
|
option(INCLUDE_SPI "Include SPI support" YES)
|
||||||
|
option(WITH_LIBUSB "Enable libusb support" YES)
|
||||||
|
+option(WITH_TELLDUSCORE "Enable Telldus support" YES)
|
||||||
|
|
||||||
|
# Link static or shared, external dependencies
|
||||||
|
option(USE_LUA_STATIC "Link LUA static" YES)
|
||||||
|
@@ -783,17 +784,19 @@ ELSE()
|
||||||
|
message(STATUS "GPIO is not available")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
-find_path(TELLDUSCORE_INCLUDE NAMES telldus-core.h)
|
||||||
|
-IF(TELLDUSCORE_INCLUDE)
|
||||||
|
- message(STATUS "Found telldus-core (telldus-core.h) at : ${TELLDUSCORE_INCLUDE}")
|
||||||
|
- find_library(TELLDUS_LIBRARIES NAMES libtelldus-core.so)
|
||||||
|
- IF(TELLDUS_LIBRARIES)
|
||||||
|
- message(STATUS "Found libtelldus-core at : ${TELLDUS_LIBRARIES}, adding telldus support")
|
||||||
|
- add_definitions(-DWITH_TELLDUSCORE)
|
||||||
|
- ENDIF(TELLDUS_LIBRARIES)
|
||||||
|
-ELSE()
|
||||||
|
- message(STATUS "Not found telldus-core (telldus-core.h), not adding tellstick support")
|
||||||
|
-ENDIF(TELLDUSCORE_INCLUDE)
|
||||||
|
+IF(WITH_TELLDUSCORE)
|
||||||
|
+ find_path(TELLDUSCORE_INCLUDE NAMES telldus-core.h)
|
||||||
|
+ IF(TELLDUSCORE_INCLUDE)
|
||||||
|
+ message(STATUS "Found telldus-core (telldus-core.h) at : ${TELLDUSCORE_INCLUDE}")
|
||||||
|
+ find_library(TELLDUS_LIBRARIES NAMES libtelldus-core.so)
|
||||||
|
+ IF(TELLDUS_LIBRARIES)
|
||||||
|
+ message(STATUS "Found libtelldus-core at : ${TELLDUS_LIBRARIES}, adding telldus support")
|
||||||
|
+ add_definitions(-DWITH_TELLDUSCORE)
|
||||||
|
+ ENDIF(TELLDUS_LIBRARIES)
|
||||||
|
+ ELSE()
|
||||||
|
+ message(STATUS "Not found telldus-core (telldus-core.h), not adding tellstick support")
|
||||||
|
+ ENDIF(TELLDUSCORE_INCLUDE)
|
||||||
|
+ENDIF(WITH_TELLDUSCORE)
|
||||||
|
|
||||||
|
# Handle resolving
|
||||||
|
check_function_exists(res_init HAVE_LIBC_RESOLV)
|
||||||
Reference in New Issue
Block a user