spec: switch to use sysusers compat macro

This switches the %pre scriplet to use the sysusers compat
macro when creating system user/group.
This ensures that only dnsmasq entries are created, without
triggering actions for other sysusers.d files that may be on
disk.

Refs:
 * https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format
 * https://bugzilla.redhat.com/show_bug.cgi?id=1792462
This commit is contained in:
Luca BRUNO 2020-12-10 12:11:57 +00:00 committed by pemensik
parent 08446b0eff
commit b7481f49d6

View File

@ -57,6 +57,7 @@ Buildrequires: gcc
BuildRequires: gnupg2
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%if %{with sourcegit}
BuildRequires: git-core
@ -152,7 +153,7 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
%pre
#precreate users so that rpm can install files owned by that user
%sysusers_create_package %{name} %{SOURCE2}
%sysusers_create_compat %{SOURCE2}
%post
%systemd_post dnsmasq.service