]> git.pld-linux.org Git - packages/domoticz.git/blobdiff - domoticz.spec
macros for %systemd*
[packages/domoticz.git] / domoticz.spec
index e7a597f24a4b071c9870a944b0ed498fe4dcbbda..e1bb9caca7e4590463a2b6b2ecf7b7f9a5fb919e 100644 (file)
@@ -17,6 +17,7 @@ Patch1:               %{name}-openzwave.patch
 Patch2:                %{name}-python.patch
 Patch3:                no-git.patch
 Patch4:                boost-1.73.patch
+Patch5:                %{name}-gpio.patch
 BuildRequires: boost-devel >= 1.66.0
 BuildRequires: cereal-devel
 BuildRequires: cmake >= 3.16.0
@@ -33,6 +34,7 @@ BuildRequires:        openssl-devel
 BuildRequires: pkgconfig
 BuildRequires: python3 >= 1:3.4
 BuildRequires: python3-devel >= 1:3.4
+BuildRequires: rpmbuild(macros) >= 1.644
 BuildRequires: sqlite3-devel
 BuildRequires: tinyxml-devel
 BuildRequires: tinyxpath-devel
@@ -42,6 +44,8 @@ Requires(pre):        /usr/sbin/useradd
 Requires(post,preun,postun):   systemd-units >= 38
 Requires:      fonts-TTF-Google-Droid
 Requires:      libopenzwave >= 1.5.0
+Provides:      group(domoticz)
+Provides:      user(domoticz)
 
 %description
 Domoticz is a Home Automation System that lets you monitor and
@@ -56,6 +60,7 @@ and much more. Notifications/Alerts can be sent to any mobile device
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 APPVERSION="%{version}"
 echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
@@ -117,12 +122,8 @@ ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
 rm -rf $RPM_BUILD_ROOT
 
 %pre
-getent group domoticz >/dev/null || groupadd -r domoticz
-getent passwd domoticz >/dev/null || \
-useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
--c "Domoticz Home Automation Server" domoticz
-# For OpenZWave USB access (/dev/ttyACM#)
-usermod -G domoticz,dialout domoticz
+%groupadd -g 342 domoticz
+%useradd -u 342 -r -d %{_datadir} -s /bin/false -c "Domoticz Home Automation Server" -G dialout -g domoticz domoticz
 
 %post
 %systemd_post %{name}.service
@@ -131,6 +132,10 @@ usermod -G domoticz,dialout domoticz
 %systemd_preun %{name}.service
 
 %postun
+if [ "$1" = "0" ]; then
+       %userremove mpd
+       %groupremove mpd
+fi
 %systemd_reload
 
 %files
This page took 0.079724 seconds and 4 git commands to generate.