[packages/domoticz] keep userdata in writeable location

atler atler at pld-linux.org
Sat Aug 30 20:56:12 CEST 2025


commit 01d05c16f05fff827752828b309099defef72d81
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Aug 30 20:55:13 2025 +0200

    keep userdata in writeable location

 config.patch     | 4 ++--
 domoticz.conf    | 2 +-
 domoticz.service | 2 +-
 domoticz.spec    | 8 +++++---
 4 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/domoticz.spec b/domoticz.spec
index 5bfad3e..c834fec 100644
--- a/domoticz.spec
+++ b/domoticz.spec
@@ -106,9 +106,11 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/{domoticz,sysconfig},%{syst
 # move binary to standard directory
 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}
 
-sed -e 's#@DOMOTICZ_DIR@#%{_datadir}/%{name}#g' %{SOURCE1} > $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
-sed -e 's#@DOMOTICZ_DIR@#%{_datadir}/%{name}#g' scripts/domoticz.conf > $RPM_BUILD_ROOT%{_sysconfdir}/domoticz/domoticz.conf
-sed -e 's#@DOMOTICZ_CONF_DIR@#%{_sysconfdir}/%{name}#' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
+sed -e 's#@USERDATA_DIR@#%{_sharedstatedir}/%{name}#g' %{SOURCE1} > $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+sed -e 's#@APP_DIR@#%{_datadir}/%{name}#g' \
+	-e 's#@USERDATA_DIR@#%{_sharedstatedir}/%{name}#g' \
+	scripts/domoticz.conf > $RPM_BUILD_ROOT%{_sysconfdir}/domoticz/domoticz.conf
+sed -e 's#@CONF_DIR@#%{_sysconfdir}/%{name}#' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
 
 # Unbundle DroidSans.ttf
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element{al,-light,-dark}/fonts/{Droid,Open}Sans.ttf
diff --git a/config.patch b/config.patch
index 8dd9260..06c5e84 100644
--- a/config.patch
+++ b/config.patch
@@ -32,11 +32,11 @@
  
  # Application path (folder where domoticz is installed in)
 -# app_path=/opt/domoticz
-+app_path=@DOMOTICZ_DIR@
++app_path=@APP_DIR@
  
  # User data path (where backups and scripts are installed)
 -# userdata_path=/opt/domoticz
-+userdata_path=@DOMOTICZ_DIR@
++userdata_path=@USERDATA_DIR@
  
  # Run as daemon (default when launched as service)
  # daemon=yes
diff --git a/domoticz.conf b/domoticz.conf
index 3b85b85..d27f2f1 100644
--- a/domoticz.conf
+++ b/domoticz.conf
@@ -1 +1 @@
-DOMOTICZ_CONF=@DOMOTICZ_CONF_DIR@/domoticz.conf
+DOMOTICZ_CONF=@CONF_DIR@/domoticz.conf
diff --git a/domoticz.service b/domoticz.service
index 7f94b28..33342a9 100644
--- a/domoticz.service
+++ b/domoticz.service
@@ -7,7 +7,7 @@ User=domoticz
 Group=domoticz
 EnvironmentFile=/etc/sysconfig/domoticz
 ExecStart=/usr/bin/domoticz -f $DOMOTICZ_CONF
-WorkingDirectory=@DOMOTICZ_DIR@
+WorkingDirectory=@USERDATA_DIR@
 # Give the right to open priviliged ports. This allows you to run on a port <1024 without root permissions (user/group setting above)
 #CapabilityBoundingSet=CAP_NET_BIND_SERVICE
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/domoticz.git/commitdiff/01d05c16f05fff827752828b309099defef72d81



More information about the pld-cvs-commit mailing list