From 3db17b99a31d38479354ea1683ef90bd757be862 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 3 Apr 2024 18:22:23 +0200 Subject: [PATCH] SPEC: use sysusers as additional source This partially reverts 736430aa0ed0f9c9e36315ea97de65908c29f590 The reason is that 'sysusers_create_compat' macro is evaluated after the tar ball is extracted, after SSSD is built and after content of the BUILD and BUILDROOT directories is removed, so otherwise there is no extracted or built data available anymore. See https://github.com/SSSD/sssd/pull/7267#discussion_r1549282574 for details. --- contrib/sssd.spec.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 70c459333d2..aaff10e7b77 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -65,6 +65,9 @@ Summary: System Security Services Daemon License: GPLv3+ URL: https://github.com/SSSD/sssd/ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +%if %{use_sysusers} +Source1: sssd.sysusers +%endif ### Patches ### # Place your patches here: @@ -733,7 +736,7 @@ do done %if %{use_sysusers} -install -D -p -m 0644 contrib/sssd.sysusers %{buildroot}%{_sysusersdir}/sssd.conf +install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %endif %files @@ -1047,7 +1050,7 @@ install -D -p -m 0644 contrib/sssd.sysusers %{buildroot}%{_sysusersdir}/sssd.con %if %{use_sssd_user} %pre common %if %{use_sysusers} -%sysusers_create_compat contrib/sssd.sysusers +%sysusers_create_compat %{SOURCE1} %else getent group sssd >/dev/null || groupadd -r sssd getent passwd sssd >/dev/null || useradd -r -g sssd -d / -s /sbin/nologin -c "User for sssd" sssd