]> git.pld-linux.org Git - packages/domoticz.git/commitdiff
handle user/group correctly
authorJan Palus <atler@pld-linux.org>
Thu, 8 Apr 2021 19:54:01 +0000 (21:54 +0200)
committerJan Palus <atler@pld-linux.org>
Thu, 8 Apr 2021 22:23:47 +0000 (00:23 +0200)
domoticz.spec

index e7a597f24a4b071c9870a944b0ed498fe4dcbbda..7f0a9c446d24b1dd24d0648498fccbe232d81a9b 100644 (file)
@@ -42,6 +42,8 @@ Requires(pre):        /usr/sbin/useradd
 Requires(post,preun,postun):   systemd-units >= 38
 Requires:      fonts-TTF-Google-Droid
 Requires:      libopenzwave >= 1.5.0
 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
 
 %description
 Domoticz is a Home Automation System that lets you monitor and
@@ -117,12 +119,8 @@ ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
 rm -rf $RPM_BUILD_ROOT
 
 %pre
 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
 
 %post
 %systemd_post %{name}.service
@@ -131,6 +129,10 @@ usermod -G domoticz,dialout domoticz
 %systemd_preun %{name}.service
 
 %postun
 %systemd_preun %{name}.service
 
 %postun
+if [ "$1" = "0" ]; then
+       %userremove mpd
+       %groupremove mpd
+fi
 %systemd_reload
 
 %files
 %systemd_reload
 
 %files
This page took 0.129191 seconds and 4 git commands to generate.