diff --git a/Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch b/Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch new file mode 100644 index 0000000..0f6cd1b --- /dev/null +++ b/Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch @@ -0,0 +1,143 @@ +From fbbddf93f0715830a6ae9842c91f89ae40973619 Mon Sep 17 00:00:00 2001 +From: Egbert Eich +Date: Sat, 21 Nov 2020 21:46:02 +0100 +Subject: [PATCH 4/4] Adapt shell scripts that set up the environment for + different shells + +Signed-off-by: Egbert Eich +--- + share/spack/setup-env.csh | 5 +++- + share/spack/setup-env.fish | 15 +--------- + share/spack/setup-env.sh | 57 +++----------------------------------- + 3 files changed, 9 insertions(+), 68 deletions(-) + +diff --git a/share/spack/setup-env.csh b/share/spack/setup-env.csh +index b70036456..ab3d941ef 100755 +--- a/share/spack/setup-env.csh ++++ b/share/spack/setup-env.csh +@@ -12,6 +12,10 @@ + # + + # prevent infinite recursion when spack shells out (e.g., on cray for modules) ++if ($?SPACK_ROOT == 0) then ++ setenv SPACK_ROOT = @@_prefix@@ ++endif ++ + if ($?_sp_initializing) then + exit 0 + endif +@@ -59,7 +63,6 @@ alias spacktivate 'spack env activate' + alias _spack_pathadd 'set _pa_args = (\!*) && source $_spack_share_dir/csh/pathadd.csh' + + # Set variables needed by this script +-_spack_pathadd PATH "$SPACK_ROOT/bin" + eval `spack --print-shell-vars csh` + + # Set up module search paths in the user environment +diff --git a/share/spack/setup-env.fish b/share/spack/setup-env.fish +index b74eae34d..decb718e1 100755 +--- a/share/spack/setup-env.fish ++++ b/share/spack/setup-env.fish +@@ -660,20 +660,7 @@ end + + + +-# +-# Figure out where this file is. Below code only needs to work in fish +-# +-set -l sp_source_file (status -f) # name of current file +- +- +- +-# +-# Find root directory and add bin to path. +-# +-set -l sp_share_dir (realpath (dirname $sp_source_file)) +-set -l sp_prefix (realpath (dirname (dirname $sp_share_dir))) +-spack_pathadd PATH "$sp_prefix/bin" +-set -xg SPACK_ROOT $sp_prefix ++set -xg SPACK_ROOT @@_prefix@@ + + + +diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh +index 5761d1636..768866abe 100755 +--- a/share/spack/setup-env.sh ++++ b/share/spack/setup-env.sh +@@ -246,58 +246,6 @@ _sp_shell=$(_spack_determine_shell) + + alias spacktivate="spack env activate" + +-# +-# Figure out where this file is. +-# +-if [ "$_sp_shell" = bash ]; then +- _sp_source_file="${BASH_SOURCE[0]:-}" +-elif [ "$_sp_shell" = zsh ]; then +- _sp_source_file="${(%):-%N}" +-else +- # Try to read the /proc filesystem (works on linux without lsof) +- # In dash, the sourced file is the last one opened (and it's kept open) +- _sp_source_file_fd="$(\ls /proc/$$/fd 2>/dev/null | sort -n | tail -1)" +- if ! _sp_source_file="$(readlink /proc/$$/fd/$_sp_source_file_fd)"; then +- # Last resort: try lsof. This works in dash on macos -- same reason. +- # macos has lsof installed by default; some linux containers don't. +- _sp_lsof_output="$(lsof -p $$ -Fn0 | tail -1)" +- _sp_source_file="${_sp_lsof_output#*n}" +- fi +- +- # If we can't find this script's path after all that, bail out with +- # plain old $0, which WILL NOT work if this is sourced indirectly. +- if [ ! -f "$_sp_source_file" ]; then +- _sp_source_file="$0" +- fi +-fi +- +-# +-# Find root directory and add bin to path. +-# +-# We send cd output to /dev/null to avoid because a lot of users set up +-# their shell so that cd prints things out to the tty. +-_sp_share_dir="$(cd "$(dirname $_sp_source_file)" > /dev/null && pwd)" +-_sp_prefix="$(cd "$(dirname $(dirname $_sp_share_dir))" > /dev/null && pwd)" +-if [ -x "$_sp_prefix/bin/spack" ]; then +- export SPACK_ROOT="${_sp_prefix}" +-else +- # If the shell couldn't find the sourced script, fall back to +- # whatever the user set SPACK_ROOT to. +- if [ -n "$SPACK_ROOT" ]; then +- _sp_prefix="$SPACK_ROOT" +- _sp_share_dir="$_sp_prefix/share/spack" +- fi +- +- # If SPACK_ROOT didn't work, fail. We should need this rarely, as +- # the tricks above for finding the sourced file are pretty robust. +- if [ ! -x "$_sp_prefix/bin/spack" ]; then +- echo "==> Error: SPACK_ROOT must point to spack's prefix when using $_sp_shell" +- echo "Run this with the correct prefix before sourcing setup-env.sh:" +- echo " export SPACK_ROOT=" +- return 1 +- fi +-fi +-_spack_pathadd PATH "${_sp_prefix%/}/bin" + + # + # Check whether a function of the given name is defined +@@ -369,10 +317,13 @@ _sp_multi_pathadd() { + } + _sp_multi_pathadd MODULEPATH "$_sp_tcl_roots" + +++export SPACK_ROOT=@@_prefix@@ ++ ++ + # Add programmable tab completion for Bash + # + if [ "$_sp_shell" = bash ]; then +- source $_sp_share_dir/spack-completion.bash ++ source $SPACK_ROOT/share/spack/spack-completion.bash + fi + + # done: unset sentinel variable as we're no longer initializing +-- +2.26.2 + diff --git a/Make-spack-paths-compliant-to-distro-installation.patch b/Make-spack-paths-compliant-to-distro-installation.patch index 3cca9a2..f357d50 100644 --- a/Make-spack-paths-compliant-to-distro-installation.patch +++ b/Make-spack-paths-compliant-to-distro-installation.patch @@ -1,9 +1,7 @@ +From f0ccc0fee51e272776af8b4f85f4b4d2d2854bf7 Mon Sep 17 00:00:00 2001 From: Egbert Eich -Date: Tue Sep 22 09:42:40 2020 +0200 -Subject: Make spack paths compliant to distro installation -Patch-mainline: Not yet -Git-commit: 0e7934fd94b6f5ec2059b73d7b17b7e048d61b2d -References: +Date: Tue, 22 Sep 2020 09:42:40 +0200 +Subject: [PATCH 2/4] Make spack paths compliant to distro installation Signed-off-by: Egbert Eich --- @@ -11,11 +9,12 @@ Signed-off-by: Egbert Eich etc/spack/defaults/repos.yaml | 2 +- lib/spack/spack/paths.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) + diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml -index a572787..cbad1b7 100644 +index d1a7f35a6..4813a8a0a 100644 --- a/etc/spack/defaults/config.yaml +++ b/etc/spack/defaults/config.yaml -@@ -21,7 +21,7 @@ config: +@@ -31,13 +31,13 @@ config: # Locations where templates should be found template_dirs: @@ -23,9 +22,6 @@ index a572787..cbad1b7 100644 + - /usr/share/spack/templates - # Default directory layout -@@ -30,8 +30,8 @@ config: - # Locations where different types of modules should be installed. module_roots: - tcl: $spack/share/spack/modules @@ -35,7 +31,7 @@ index a572787..cbad1b7 100644 # Temporary locations Spack can try to use for builds. -@@ -67,7 +67,7 @@ config: +@@ -77,7 +77,7 @@ config: # Cache directory for already downloaded source tarballs and archived # repositories. This can be purged with `spack clean --downloads`. @@ -45,7 +41,7 @@ index a572787..cbad1b7 100644 # Cache directory for miscellaneous files, like the package index. diff --git a/etc/spack/defaults/repos.yaml b/etc/spack/defaults/repos.yaml -index f3e0065..2469194 100644 +index f3e00653e..246919425 100644 --- a/etc/spack/defaults/repos.yaml +++ b/etc/spack/defaults/repos.yaml @@ -11,4 +11,4 @@ @@ -55,15 +51,18 @@ index f3e0065..2469194 100644 - - $spack/var/spack/repos/builtin + - /var/lib/spack/repos/builtin diff --git a/lib/spack/spack/paths.py b/lib/spack/spack/paths.py -index e5541ef..bc8e49d 100644 +index 9c803cba7..f16e8ca54 100644 --- a/lib/spack/spack/paths.py +++ b/lib/spack/spack/paths.py -@@ -37,7 +37,7 @@ +@@ -39,7 +39,7 @@ operating_system_path = os.path.join(module_path, 'operating_systems') test_path = os.path.join(module_path, "test") hooks_path = os.path.join(module_path, "hooks") -var_path = os.path.join(prefix, "var", "spack") +var_path = os.path.join("/", "var", "lib", "spack") repos_path = os.path.join(var_path, "repos") + tests_path = os.path.join(var_path, "tests") share_path = os.path.join(prefix, "share", "spack") - +-- +2.26.2 + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..58ef5ee --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + doc + diff --git a/added-dockerfile-for-opensuse-leap-15.patch b/added-dockerfile-for-opensuse-leap-15.patch new file mode 100644 index 0000000..aace121 --- /dev/null +++ b/added-dockerfile-for-opensuse-leap-15.patch @@ -0,0 +1,77 @@ +From d9b88381189ca860cd63c48a53d2298fd8d206db Mon Sep 17 00:00:00 2001 +From: Christian Goll +Date: Tue, 24 Nov 2020 16:35:32 +0100 +Subject: [PATCH 1/2] added dockerfile for opensuse leap 15 + +--- + share/spack/docker/leap-15.dockerfile | 58 +++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + create mode 100644 share/spack/docker/leap-15.dockerfile + +diff --git a/share/spack/docker/leap-15.dockerfile b/share/spack/docker/leap-15.dockerfile +new file mode 100644 +index 000000000..36054cd44 +--- /dev/null ++++ b/share/spack/docker/leap-15.dockerfile +@@ -0,0 +1,58 @@ ++FROM opensuse/leap:15.2 ++MAINTAINER SUSE HPC ++ ++ENV DOCKERFILE_BASE=opensuse \ ++ DOCKERFILE_DISTRO=opensuse_leap \ ++ DOCKERFILE_DISTRO_VERSION=15.2 \ ++ SPACK_ROOT_DOCKER=/opt/spack \ ++ DEBIAN_FRONTEND=noninteractive \ ++ CURRENTLY_BUILDING_DOCKER_IMAGE=1 \ ++ container=docker ++ ++COPY bin $SPACK_ROOT/bin ++COPY etc $SPACK_ROOT/etc ++COPY lib $SPACK_ROOT/lib ++COPY share $SPACK_ROOT/share ++COPY var $SPACK_ROOT/var ++ ++ ++RUN mkdir -p $SPACK_ROOT/opt/spack ++ ++RUN zypper ref && \ ++ zypper up -y && \ ++ zypper in -y python3-base \ ++ xz gzip tar bzip2 curl patch \ ++ gcc-c++ make cmake automake&&\ ++ zypper clean ++ ++# clean up manpages ++RUN rm -rf /var/cache/zypp/* \ ++ rm -rf /usr/share/doc/packages/* \ ++ rm -rf /usr/share/doc/manual/* ++ ++ ++RUN mkdir -p /root/.spack \ ++ && cp $SPACK_ROOT/share/spack/docker/modules.yaml \ ++ /root/.spack/modules.yaml \ ++ && rm -rf /root/*.* /run/nologin $SPACK_ROOT/.git ++ ++# [WORKAROUND] ++# https://superuser.com/questions/1241548/ ++# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889 ++RUN [ -f ~/.profile ] \ ++ && sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \ ++ || true ++ ++WORKDIR /root ++SHELL ["docker-shell"] ++ ++# Find tools which are in distro ++RUN spack external find --scope system ++ ++# TODO: add a command to Spack that (re)creates the package cache ++RUN spack spec hdf5+mpi ++ ++ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"] ++CMD ["interactive-shell"] ++ ++ +-- +2.26.2 + diff --git a/fix-tumbleweed-naming.patch b/fix-tumbleweed-naming.patch index fe2044a..a19c225 100644 --- a/fix-tumbleweed-naming.patch +++ b/fix-tumbleweed-naming.patch @@ -1,7 +1,7 @@ -From dce8997ce770ec420b2946936caf92760638d439 Mon Sep 17 00:00:00 2001 +From e752e8f95a5fecf223e2849beeb8bd7cef234c60 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 11 Nov 2020 20:29:55 +0100 -Subject: [PATCH] fix tumbleweed naming +Subject: [PATCH 1/4] fix tumbleweed naming --- lib/spack/spack/operating_systems/linux_distro.py | 5 +++++ diff --git a/spack-0.15.4.tar.gz b/spack-0.15.4.tar.gz deleted file mode 100644 index 1208486..0000000 --- a/spack-0.15.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce195bc79956675d813cc7837840517135064dcbe211e797b7d171cd8810d31d -size 4805201 diff --git a/spack-0.16.0.tar.gz b/spack-0.16.0.tar.gz new file mode 100644 index 0000000..02733bd --- /dev/null +++ b/spack-0.16.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064b2532c70916c7684d4c7c973416ac32dd2ea15f5c392654c75258bfc8c6c2 +size 5512800 diff --git a/spack-rpmlintrc b/spack-rpmlintrc new file mode 100644 index 0000000..3bed81d --- /dev/null +++ b/spack-rpmlintrc @@ -0,0 +1,13 @@ +# Fully intentional +addFilter("hidden-file-or-dir /etc/skel/.spack") +# These files are patches and not to be run directly +addFilter("script-without-shebang") +# These files are installed as part of the spack recipes +# and shouldn't be in a devel package +addFilter("devel-file-in-non-devel-package*") +# The spack group needs to be added to the list of known groups +addFilter("non-standard-group Unspecified") +addFilter("non-standard-gid .* spack") +# Spurious self-applying patches from an upstream source. +# These are part of recipes and not intended to run as scripts. +addFilter("non-executable-script /var/lib/spack/repos.*") diff --git a/spack.changes b/spack.changes index 4b6724a..9c816fe 100644 --- a/spack.changes +++ b/spack.changes @@ -1,3 +1,35 @@ +------------------------------------------------------------------- +Tue Dec 8 14:19:00 UTC 2020 - Christian Goll + +- added test for /etc/spack/no_rpm_trigger + +------------------------------------------------------------------- +Wed Dec 2 12:33:44 UTC 2020 - Christian Goll + +- added %triggerin and %triggerpostun for the packages which + can be detected by spack + +------------------------------------------------------------------- +Wed Nov 25 10:58:48 UTC 2020 - Christian Goll + +- updated to 0.16.0 +- added find for external packages +- added dockerfile for leap + * added patchfile added-dockerfile-for-opensuse-leap-15.patch + +------------------------------------------------------------------- +Tue Nov 24 13:45:24 UTC 2020 - Egbert Eich + +- Add documentation (man and info pages, pdf doesn't build + currently). + * Do not ship documentation sources. +- Do not distribute Dockerfiles and other container related + material, yet. This needs to be fixed so that the samples + work with SUSE. +- Fully integrate spack into SUSE directory structure, fix + paths where required. + * Fix setup scripts to work correctly in above environment. + ------------------------------------------------------------------- Mon Nov 16 14:42:32 UTC 2020 - Christian Goll diff --git a/spack.spec b/spack.spec index dd3739c..a3c2a76 100644 --- a/spack.spec +++ b/spack.spec @@ -15,28 +15,49 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%global flavor @BUILD_FLAVOR@%{?nil} +%if "%{flavor}" == "doc" +%bcond_without doc +%endif + +%if %{with doc} && (0%{?sle_version} > 0) && (150200 >= 0%{?sle_version}) +ExclusiveArch: do_not_build +%endif + %define spack_dir %_prefix/lib/spack/ %define spack_group spack - +# These packages are found and can be used by spack, /etc/spack/packages-yaml +# needs to be updated when one of these packages is updated or uninstalled. +# Distinguish between packages we recommend and packages which +%define spack_trigger_recommended autoconf bash bison bzip2 cmake-full ccache cpio diffutils findutils flex gcc gcc-fortran git-lfs make m4 ncurses-devel libtool openssl perl-base pkgconf pkgconf-pkg-config python3-basetar info xz +# packages recognized by spack, but not recommended +%define spack_trigger_packages ghostscript go fish fzf hugo java-11-openjdk-devel java-14-openjdk-devel java-15-openjdk-devel java-16-openjdk-devel java-1_8_0-openjdk-devel ruby +# non oss packages +%define spack_trigger_external cuda-nvcc Name: spack -Version: 0.15.4 +Version: 0.16.0 Release: 0 Summary: Package manager for HPC systems License: Apache-2.0 AND MIT AND Python-2.0 AND BSD-3-Clause URL: https://spack.io -Source0: https://github.com/spack/spack/archive/v%{version}.tar.gz#/spack-%{version}.tar.gz +Source0: https://github.com/spack/spack/archive/v%{version}.tar.gz#/spack-%{version}.tar.gz Source1: README.SUSE -Source1: spack-recipes-rpmlintrc +Source2: spack-rpmlintrc Patch0: Make-spack-paths-compliant-to-distro-installation.patch Patch1: fix-tumbleweed-naming.patch +Patch2: Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch +Patch3: added-dockerfile-for-opensuse-leap-15.patch +# upstream patch removes also problemtatic binaries +#Patch4: spack-test-15702.patch +%if %{without doc} BuildRequires: polkit BuildRequires: fdupes BuildRequires: python-base +BuildRequires: python3-urllib3 BuildRequires: lua-lmod Requires: %{name}-recipes = %{version} Requires: curl Requires: lua-lmod -Requires: pattern() = devel_basis Requires: polkit Requires: gcc-fortran Requires: gpg2 @@ -44,8 +65,25 @@ Requires: xz Requires: bzip2 Requires: spack-recipes Recommends: spack-recipes = %version +Recommends: %spack_trigger_recommended +%else +BuildRequires: patterns-base-basesystem +BuildRequires: spack +BuildRequires: makeinfo +BuildRequires: distribution-release +BuildRequires: %{python_module Sphinx >= 1.8} +BuildRequires: %{python_module sphinxcontrib-programoutput} +BuildRequires: git +# html +BuildRequires: graphviz +# info +BuildRequires: graphviz-gnome +## pdf +# BuildRequires: python3-Sphinx-latex +Requires: spack +%endif BuildArch: noarch -%if 0%{?sle_version} <= 120500 && !0%{?is_opensuse} +%if 0%{?sle_version} <= 120500 && !0%{?is_opensuse} %define __python3 python3 %endif @@ -77,68 +115,127 @@ using different compilers, options, and MPI implementations. This package contains the built-in package recipes. +%package man +Summary: Man Page for Spack - Package manager for HPC systems +Requires: man + +%description man +Spack is a configurable Python-based HPC package manager, automating +the installation and fine-tuning of simulations and libraries. +It operates on a wide variety of HPC platforms and enables users +to build many code configurations. Software installed by Spack +runs correctly regardless of environment, and file management +is streamlined. Spack can install many variants of the same build +using different compilers, options, and MPI implementations. + +This package contains the man page. + +%package info +Summary: Info Page for Spack - Package manager for HPC systems +Requires: info + +%description info +Spack is a configurable Python-based HPC package manager, automating +the installation and fine-tuning of simulations and libraries. +It operates on a wide variety of HPC platforms and enables users +to build many code configurations. Software installed by Spack +runs correctly regardless of environment, and file management +is streamlined. Spack can install many variants of the same build +using different compilers, options, and MPI implementations. + +This package contains the info page. + %prep %setup -q +%if %{without doc} %autopatch -p1 +# set SPACK_ROOT +for i in share/spack/setup-env.*; do + sed -i -e "s;@@_prefix@@;%_prefix;g" $i +done +%endif + %build # Nothing to build - +%if %{with doc} +cd lib/spack/docs +# Causes issues building texinfo as a suitable image cannot be found +grep -rl ":target:" | xargs sed -i -e "/:target:/s/^/#/" -e "/figure::/s/^/#/" +# Fix path to var - we install this to the 'real' /var +grep -rl "\$SPACK_ROOT/var" | xargs sed -i -e "s@\(.*\)\$SPACK_ROOT/var\(/spack.*\)@\1/var/lib\2@g" +# spack cannot run without knowing at least the compiler +spack compiler find +make man info #text dirhtml +gzip _build/texinfo/Spack.info _build/man/spack.1 +%endif %install -%doc %{S:1} + +%if %{without doc} +cp %{S:1} . # Fix some rpmlint warnings ## Remove files not required to run spack rm -rf lib/spack/spack/test rm -rf share/spack/qa +rm -rf share/spack/logo rm -rf var/spack/repos/builtin.mock var/spack/gpg.mock var/spack/mock_configs rm -rf lib/spack/external/ruamel/yaml/.ruamel find . -type f -name .gitignore -delete find . -type f -name .nojekyll -delete +# Fix _spack_root link rm -f lib/spack/docs/_spack_root ln -sf ../.. lib/spack/docs/_spack_root +# Do not ship Docker and container building for now - needs fixing +rm -rf share/spack/{templates/container} +rm -rf share/spack/docker/{centos,ubuntu}*.dockerfile +# Do not ship AWS specifics +rm -f share/spack/setup-tutorial-env.sh +# Fix rpmlint warnings ## No need for the standalone scripts rm -f lib/spack/external/macholib/macho_*.py ## Fix shebangs -sed -i 's@#!/bin/env sh@#!/bin/bash@' var/spack/repos/builtin/packages/beast-tracer/tracer -sed -i 's@#!/usr/bin/env bash@#!/bin/bash@' share/spack/docker/package-index/split.sh +sed -i 's@#!/bin/env sh@#!/bin/bash@' var/spack/repos/builtin/packages/beast-tracer/tracer sed -i 's@#! /usr/bin/env bash@ #!/bin/bash@' share/spack/docker/entrypoint.bash +sed -i 's@#!/usr/bin/env bash@#!/bin/bash@' share/spack/docker/package-index/split.sh mkdir -p %{buildroot}%{spack_dir} mkdir -p %{buildroot}%{spack_dir}/opt -mkdir -p %{buildroot}%{spack_dir}/bin -mkdir -p %{buildroot}%{_datarootdir}/spack +mkdir -p %{buildroot}%{_datarootdir}/spack/lib/spack mkdir -p %{buildroot}%{_datarootdir}/spack/modules mkdir -p %{buildroot}%{_localstatedir}/lib/spack mkdir -p %{buildroot}%{_localstatedir}/lib/spack/junit-report mkdir -p %{buildroot}%{_localstatedir}/cache/spack mkdir -p %{buildroot}%{_sysconfdir}/skel/.spack/ mkdir -p %{buildroot}/%{_bindir} +# Link avoids having to fix paths ln -sf %{buildroot}/%{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cache # Copy files to corresponding paths -cp -r etc lib %{buildroot}%{spack_dir} +cp -r etc %{buildroot}%{_prefix} +cp -r lib/spack/{env,external,llnl,spack} %{buildroot}%{spack_dir} cp -r share/spack/* %{buildroot}%{_datarootdir}/spack cp -r var/spack/* %{buildroot}%{_localstatedir}/lib/spack cp -r bin/sbang %{buildroot}/%{_bindir} -cp -r bin/spack* %{buildroot}%{spack_dir}/bin +cp -r bin/spack* %{buildroot}%{_bindir}/ cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/ -sed -i 's@\(\sinstall_tree:\).*@\1 ~/spack/packages@' %{buildroot}%{_sysconfdir}/skel/.spack/config.yaml +# Fix more paths +sed -i 's@\(\sroot:\) $spack/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}%{_bindir}/spack -chmod 0755 %{buildroot}%{_bindir}/spack -ln -s spack %{buildroot}%{_bindir}/spack-python -ln -s %{_bindir}/sbang %{buildroot}%{spack_dir}/bin/sbang - # compile python files for python3 +# %%{buildroot}%%{spack_dir}/spack %py_compile . # make shell scripts executeable @@ -223,13 +320,24 @@ modules: all: '{compiler.name}-{compiler.version}/{name}/{version}' ^mpi: '{compiler.name}-{compiler.version}/{^mpi.name}-{^mpi.version}/{name}/{version}' EOF +mkdir -p %{buildroot}%{_sysconfdir}/spack # Fix link to not point into buildroot rm -f %{buildroot}%{_localstatedir}/lib/spack/cache ln -sf %{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cache +# Remove problematic binaries which are removed upstream with +# 0889be20e0d9dcdf4346cdeaa0647285187375f3 +rm -r %{buildroot}%{_localstatedir}/lib/spack/repos/builtin/packages/patchelf/test/ %fdupes %{buildroot}%{spack_dir} %fdupes %{buildroot}%{_datarootdir}/spack %fdupes %{buildroot}%{_localstatedir}/lib/spack +%else +mkdir -p %{buildroot}%{_infodir} +mkdir -p %{buildroot}%{_mandir}/man1 +cd lib/spack/docs/_build +cp man/spack.1.gz %{buildroot}%{_mandir}/man1/ +cp -r texinfo/Spack.info.gz texinfo/Spack-figures %{buildroot}%{_infodir} +%endif %pre getent group %spack_group >/dev/null || groupadd -r %spack_group @@ -254,16 +362,33 @@ if [ -e /etc/os-release ] ; then sed -i "s@SUSE_VERSION@$SPACK_NAME@g" /etc/profile.d/spack.sh fi sed -i "s@HOSTTYPE@$HOSTTYPE@" %{spack_dir}/etc/spack/compilers.yaml +# find installed programms +test -e %{_sysconfdir}/spack/no_rpm_trigger || spack external find --scope system +%triggerin -- %{?spack_trigger_recommended} %{?spack_trigger_packages} %{?spack_trigger_external} +test -e %{_sysconfdir}/spack/no_rpm_trigger || spack external find --scope system +test -e %{_sysconfdir}/spack/no_rpm_trigger || echo "Create %{_sysconfdir}/spack/no_rpm_trigger to stop spack to search for new packages after a rpm install" +%triggerpostun -- %{?spack_trigger_recommended} %{?spack_trigger_packages} %{?spack_trigger_external} +test -e %{_sysconfdir}/spack/no_rpm_trigger || rm /etc/spack/packages.yaml +test -e %{_sysconfdir}/spack/no_rpm_trigger || spack external find --scope system +test -e %{_sysconfdir}/spack/no_rpm_trigger || echo "Create %{_sysconfdir}/spack/no_rpm_trigger to stop spack to search for new packages after a rpm install" + + +%if %{without doc} %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%doc CHANGELOG.md NOTICE README.md +%doc CHANGELOG.md NOTICE README.md README.SUSE +%dir %{_sysconfdir}/spack/ %{_bindir}/* +%if 0%{?suse_version} <= 1500 +%dir %{_prefix}/etc +%endif +%{_prefix}/etc/spack %attr(0775, root, spack) %{_localstatedir}/lib/spack/junit-report %attr(0775, root, spack) %{spack_dir}/opt %attr(0775, root, spack) %{_localstatedir}/cache/spack %attr(0775, root, spack) %{_datarootdir}/spack/modules -%{_prefix}/lib/spack +%{spack_dir} %{_localstatedir}/cache/spack %{_localstatedir}/lib/spack %{_datarootdir}/spack @@ -274,11 +399,18 @@ sed -i "s@HOSTTYPE@$HOSTTYPE@" %{spack_dir}/etc/spack/compilers.yaml # repos directory is installed in -recipes %exclude %{_localstatedir}/lib/spack/repos - %files recipes %license COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc CHANGELOG.md NOTICE README.md %{_localstatedir}/lib/spack/repos +%else +%files man +%{_mandir}/man1/* + +%files info +%{_infodir}/* + +%endif %changelog