From: Jan Palus Date: Thu, 8 Apr 2021 19:54:01 +0000 (+0200) Subject: handle user/group correctly X-Git-Tag: auto/th/domoticz-2021.1-1~8 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdomoticz.git;a=commitdiff_plain;h=ed4fe78 handle user/group correctly --- diff --git a/domoticz.spec b/domoticz.spec index e7a597f..7f0a9c4 100644 --- a/domoticz.spec +++ b/domoticz.spec @@ -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 +Provides: group(domoticz) +Provides: user(domoticz) %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 -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 +129,10 @@ usermod -G domoticz,dialout domoticz %systemd_preun %{name}.service %postun +if [ "$1" = "0" ]; then + %userremove mpd + %groupremove mpd +fi %systemd_reload %files