From e962a073e584cbf94764e2942bcf7dafb936c1d299a5f677cef036f51b30a324 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 14 Dec 2021 11:16:05 +0000 Subject: [PATCH] Accepting request 940447 from home:mslacken:sp - fixed the configuration files /etc/skel/.spack/{config|modules}.yaml so that spack writes to $HOME if started as user OBS-URL: https://build.opensuse.org/request/show/940447 OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=40 --- spack.changes | 6 ++++++ spack.spec | 45 ++++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/spack.changes b/spack.changes index d5f6a25..2466f03 100644 --- a/spack.changes +++ b/spack.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Dec 14 11:13:37 UTC 2021 - Christian Goll + +- fixed the configuration files /etc/skel/.spack/{config|modules}.yaml + so that spack writes to $HOME if started as user + ------------------------------------------------------------------- Mon Dec 13 08:19:33 UTC 2021 - Christian Goll diff --git a/spack.spec b/spack.spec index 53c98db..52752d4 100644 --- a/spack.spec +++ b/spack.spec @@ -291,15 +291,21 @@ cp -r bin/spack* %{buildroot}%{_bindir}/ cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/ install -m 755 %{S:3} %{buildroot}/%{spack_dir}/run-find-external.sh -# Fix more paths -sed -i 's@\(\sroot:\) $spack/opt/spack@\1 ~/spack/packages@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml +# Make spack only to write to home dir of user, if run as user +sed -i 's@\(\sroot:\) /opt/spack@\1 ~/spack/packages@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml sed -i 's@\(\ssource_cache:\).*@\1 /var/tmp/$user/spack-cache@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml -sed -i 's@\(\stcl:\).*@\1 ~/spack/modules@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml -sed -i 's@\(\slmod:\).*@\1 ~/spack/lmod@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml cat >> %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml <> %{buildroot}%{_sysconfdir}/skel/.spack/modules.yaml < %{buildroot}%{spack_dir}/etc/spack/modules.yaml < %{buildroot}%{spack_dir}/etc/spack/modules.yaml <