Skip to content

Commit

Permalink
SPEC: use sysusers as additional source
Browse files Browse the repository at this point in the history
This partially reverts 736430a

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 #7267 (comment) for
details.
  • Loading branch information
alexey-tikhonov committed Apr 8, 2024
1 parent f30902f commit 98b18e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/build-sssd-srpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ runs:
with:
tarball: ${{ inputs.working-directory }}/sssd-${{ steps.sanitize.outputs.version }}.tar.gz
specfile: ${{ inputs.working-directory }}/sssd.spec
sourcefiles: ${{ inputs.working-directory }}/contrib/sssd.sysusers
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5742,6 +5742,7 @@ if GIT_CHECKOUT
endif
cp $(builddir)/contrib/sssd.spec $(RPMBUILD)/SPECS
cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
cp $(srcdir)/contrib/sssd.sysusers $(RPMBUILD)/SOURCES

rpms: rpmbrprep
cd $(RPMBUILD); \
Expand Down
5 changes: 3 additions & 2 deletions contrib/sssd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Summary: System Security Services Daemon
License: GPLv3+
URL: https://github.com/SSSD/sssd/
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: sssd.sysusers

### Patches ###
# Place your patches here:
Expand Down Expand Up @@ -733,7 +734,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
Expand Down Expand Up @@ -1047,7 +1048,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
Expand Down

0 comments on commit 98b18e5

Please sign in to comment.