diff --git a/spack.changes b/spack.changes index 458b96c..dd1ff06 100644 --- a/spack.changes +++ b/spack.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 1 05:55:10 UTC 2021 - Egbert Eich + +- Utilize sysuser infrastructure to set group spack. + ------------------------------------------------------------------- Wed Sep 29 20:32:58 UTC 2021 - Antoine Ginies diff --git a/spack.spec b/spack.spec index dfb4bc4..7fa09d2 100644 --- a/spack.spec +++ b/spack.spec @@ -63,6 +63,7 @@ BuildRequires: polkit BuildRequires: python-base BuildRequires: python3-urllib3 BuildRequires: sudo +BuildRequires: sysuser-tools Requires: %{name}-recipes = %{version} Requires: bzip2 Requires: curl @@ -352,6 +353,11 @@ ln -sf %{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cac # Remove problematic binaries which are removed upstream with # 0889be20e0d9dcdf4346cdeaa0647285187375f3 rm -r %{buildroot}%{_localstatedir}/lib/spack/repos/builtin/packages/patchelf/test/ + +echo "g %{name} -" > system-user-%{name}.conf +%sysusers_generate_pre system-user-%{name}.conf %{name} system-user-%{name}.conf +install -D -m 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-user-%{name}.conf + %fdupes %{buildroot}%{spack_dir} %fdupes %{buildroot}%{_datarootdir}/spack %fdupes %{buildroot}%{_localstatedir}/lib/spack @@ -364,8 +370,7 @@ cp -r texinfo/Spack.info.gz %{buildroot}%{_infodir} [ -d texinfo/Spack-figures ] && cp -r texinfo/Spack-figures %{buildroot}%{_infodir} %endif -%pre -getent group %spack_group >/dev/null || groupadd -r %spack_group +%pre -f %{name}.pre %post # Replace /etc/spack/compilers.yaml @@ -419,6 +424,7 @@ sed -i "s@HOSTTYPE@$HOSTTYPE@" %{spack_dir}/etc/spack/compilers.yaml %dir %{_sysconfdir}/skel/.spack %config %{_sysconfdir}/skel/.spack/config.yaml # repos directory is installed in -recipes +%{_sysusersdir}/system-user-%{name}.conf %exclude %{_localstatedir}/lib/spack/repos %files recipes