diff options
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | spack.bin.py | 14 | ||||
-rw-r--r-- | spack.binsh | 2 | ||||
-rw-r--r-- | spack.csh | 1 | ||||
-rw-r--r-- | spack.env.sh.patch | 103 | ||||
-rw-r--r-- | spack.pkaction | 3 | ||||
-rw-r--r-- | spack.sh | 1 | ||||
-rw-r--r-- | spack.tmpfiles | 3 |
10 files changed, 164 insertions, 36 deletions
@@ -1,31 +1,34 @@ pkgbase = spack pkgdesc = A flexible package manager for supercomputer that supports multiple versions, configurations, platforms, and compilers. - pkgver = 0.16.0 + pkgver = 0.21.2 pkgrel = 1 url = https://spack.io/ arch = i686 arch = x86_64 license = MIT + makedepends = debugedit + makedepends = patch depends = python depends = polkit optdepends = env-modules-tcl optdepends = lmod - source = https://github.com/spack/spack/archive/v0.16.0.tar.gz + source = spack-0.21.2.tar.gz::https://github.com/spack/spack/archive/v0.21.2.tar.gz source = spack.sysusers source = spack.tmpfiles source = spack.pkaction source = spack.pkrules source = spack.sh source = spack.csh - source = spack.binsh - sha256sums = 064b2532c70916c7684d4c7c973416ac32dd2ea15f5c392654c75258bfc8c6c2 + source = spack.bin.py + source = spack.env.sh.patch + sha256sums = SKIP sha256sums = e6d46e8f5140b4e86596d38f23af379d9adce8e9afc66f800571d7a4d9211e19 - sha256sums = 1d0a241779d3d165ddf7c1350091eb96c6dec7cf1fa6141485585f4b72c968ea - sha256sums = c9d79463721f5006ae6129e175ca8038bb13b9beb9b584a890662110fcf0579a + sha256sums = db0cc4a4ab32e6ee2e5c32898c69a0f0ce05b4e3c605beb024b5463c46e3710f + sha256sums = 1f2c4c6b8841d927fa4056206b8e5603719c0d829586ff0937efaa935d054376 sha256sums = 7f593b7f9289972ae83ad11e0dd3281faf1c56bffa0428dd69641b36b8b94356 - sha256sums = 163202be92788f98283d1b0b7c365d736a1675b16ef91f27d2a58617f17030f7 - sha256sums = 7fb67101a9095a05006862e478cedf1a5771725ae2c8420c248e1ad5d3b504e2 - sha256sums = a82a14f51519f8f3ea594845e5f9bf61988f3ba79d55099409acd7730debb6a0 + sha256sums = 0bddb0a0f1d470509f44c3031041ab0de5472de84f58c90d4b6c91e6782cb6a2 + sha256sums = 7b427625d7890dbc0ae493da095a4d7de47742fd3b02e3f42d7ee52e3599a4ac + sha256sums = 70ac76748d40d93fb5e5597fbaae933756c4eeb0b8969255e16435d0fad60006 + sha256sums = bcde5253c94d2117fec9cc96f52924c99588b06a052782c22a1f3bc6da3043e8 pkgname = spack - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d725ba4cf0d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.tar.* +pkg/ +src/ @@ -1,35 +1,43 @@ -# Maintainer: Guillaume Dolle <dev at gdolle.com> +# Maintainer: Nicolas Derumigny nderumigny <at> gmail <dot> com pkgname=spack -pkgver=0.16.0 +pkgver=0.21.2 pkgrel=1 pkgdesc="A flexible package manager for supercomputer that supports multiple versions, configurations, platforms, and compilers." arch=('i686' 'x86_64') url="https://spack.io/" license=('MIT') depends=('python' 'polkit') -optdepends=( 'env-modules-tcl' 'lmod' ) -source=(https://github.com/spack/spack/archive/v${pkgver}.tar.gz +optdepends=( 'env-modules-tcl' 'lmod' ) +makedepends=( 'debugedit' 'patch' ) +source=( + spack-${pkgver}.tar.gz::https://github.com/spack/spack/archive/v${pkgver}.tar.gz spack.sysusers spack.tmpfiles spack.pkaction spack.pkrules spack.sh spack.csh - spack.binsh) -sha256sums=('064b2532c70916c7684d4c7c973416ac32dd2ea15f5c392654c75258bfc8c6c2' - 'e6d46e8f5140b4e86596d38f23af379d9adce8e9afc66f800571d7a4d9211e19' - '1d0a241779d3d165ddf7c1350091eb96c6dec7cf1fa6141485585f4b72c968ea' - 'c9d79463721f5006ae6129e175ca8038bb13b9beb9b584a890662110fcf0579a' - '7f593b7f9289972ae83ad11e0dd3281faf1c56bffa0428dd69641b36b8b94356' - '163202be92788f98283d1b0b7c365d736a1675b16ef91f27d2a58617f17030f7' - '7fb67101a9095a05006862e478cedf1a5771725ae2c8420c248e1ad5d3b504e2' - 'a82a14f51519f8f3ea594845e5f9bf61988f3ba79d55099409acd7730debb6a0') + spack.bin.py + spack.env.sh.patch + ) +sha256sums=( + 'SKIP' + 'e6d46e8f5140b4e86596d38f23af379d9adce8e9afc66f800571d7a4d9211e19' + 'db0cc4a4ab32e6ee2e5c32898c69a0f0ce05b4e3c605beb024b5463c46e3710f' + '1f2c4c6b8841d927fa4056206b8e5603719c0d829586ff0937efaa935d054376' + '7f593b7f9289972ae83ad11e0dd3281faf1c56bffa0428dd69641b36b8b94356' + '0bddb0a0f1d470509f44c3031041ab0de5472de84f58c90d4b6c91e6782cb6a2' + '7b427625d7890dbc0ae493da095a4d7de47742fd3b02e3f42d7ee52e3599a4ac' + '70ac76748d40d93fb5e5597fbaae933756c4eeb0b8969255e16435d0fad60006' + 'bcde5253c94d2117fec9cc96f52924c99588b06a052782c22a1f3bc6da3043e8' +) _spackroot=/opt/spack _spackcfg=etc/spack/defaults/config.yaml +_spacksetenv_sh=share/spack/setup-env.sh prepare() { cd ${srcdir}/${pkgname}-${pkgver} - sed -i "s/install_tree:.*/install_tree: \/var\/lib\/spack\/packages/g" ${_spackcfg} + sed -i "s/root: *\$spack.*/root: \/var\/lib\/spack\/packages/g" ${_spackcfg} sed -i "s/source_cache:.*/source_cache: \/var\/lib\/spack\/cache\/source/g" ${_spackcfg} sed -i "s/misc_cache:.*/misc_cache: \/var\/lib\/spack\/cache\/misc/g" ${_spackcfg} sed -i "s/tcl:.*/tcl: \/var\/lib\/spack\/modules\/tcl/g" ${_spackcfg} @@ -41,28 +49,27 @@ prepare() { package() { cd ${srcdir}/${pkgname}-${pkgver} mkdir -p ${pkgdir}/${_spackroot}/ - mkdir -p ${pkgdir}/${_spackroot}/libexec/ mkdir -p ${pkgdir}/${_spackroot}/bin/ cp -dr --no-preserve=ownership share ${pkgdir}/${_spackroot} cp -dr --no-preserve=ownership lib ${pkgdir}/${_spackroot} - cp -dr --no-preserve=ownership bin/* ${pkgdir}/${_spackroot}/libexec + cp -dr --no-preserve=ownership bin ${pkgdir}/${_spackroot} cp -dr --no-preserve=ownership etc ${pkgdir}/${_spackroot} cp -dr --no-preserve=ownership var ${pkgdir}/${_spackroot} find ./* -maxdepth 0 -type f \( ! -name ".*" \) -exec install -Dm 644 "{}" "${pkgdir}/${_spackroot}/{}" \; + cd ${pkgdir}/${_spackroot} + patch -p0 < ${srcdir}/spack.env.sh.patch + cd ${srcdir} install -Dm 644 ${pkgname}.sh ${pkgdir}/etc/profile.d/${pkgname}.sh install -Dm 644 ${pkgname}.csh ${pkgdir}/etc/profile.d/${pkgname}.csh install -Dm 644 ${pkgname}.sysusers ${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf install -Dm 644 ${pkgname}.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf + install -Dm 755 ${pkgname}.bin.py ${pkgdir}/usr/bin/${pkgname} install -Dm 644 ${pkgname}.pkrules ${pkgdir}/usr/share/polkit-1/rules.d/${pkgname}.rules install -Dm 644 ${pkgname}.pkaction ${pkgdir}/usr/share/polkit-1/actions/org.archlinux.pkexec.spack.policy # Fix mode to match polkit. install -d -o root -g 102 -m 750 ${pkgdir}/usr/share/polkit-1/rules.d - - # Script using polkit. - install -Dm 755 ${pkgname}.binsh ${pkgdir}/${_spackroot}/bin/${pkgname} } - diff --git a/spack.bin.py b/spack.bin.py new file mode 100644 index 000000000000..cc8777253dc1 --- /dev/null +++ b/spack.bin.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +import os +import sys + +env = os.environ.copy() +# removing user-specific environement variables +for var in ["USER", "HOME", "LOGNAME"]: + if var in env: + env.pop(var) +arg_list = ["/usr/bin/pkexec", "--user", "spack", "/usr/bin/env"] +arg_list += [var + "=" + value for var, value in env.items()] +arg_list.append("/opt/spack/bin/spack") +arg_list += sys.argv[1:] +os.execv("/usr/bin/pkexec", arg_list) diff --git a/spack.binsh b/spack.binsh deleted file mode 100644 index fd420f4c0371..000000000000 --- a/spack.binsh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -pkexec --user spack ${SPACK_ROOT}/libexec/spack $@ diff --git a/spack.csh b/spack.csh index 90e1ca2a8287..03bf2f6dff1a 100644 --- a/spack.csh +++ b/spack.csh @@ -1,3 +1,2 @@ setenv SPACK_ROOT /opt/spack -setenv PATH /opt/spack/bin:${PATH} setenv MODULEPATH /var/lib/spack/modules/tcl/:${MODULEPATH} diff --git a/spack.env.sh.patch b/spack.env.sh.patch new file mode 100644 index 000000000000..750d5508f05f --- /dev/null +++ b/spack.env.sh.patch @@ -0,0 +1,103 @@ +--- share/spack/setup-env.sh 2021-11-15 00:06:07.160481958 +0100 ++++ share/spack/setup-env.sh 2021-11-15 00:09:10.820476320 +0100 +@@ -45,6 +45,10 @@ + fi + export _sp_initializing=true + ++_pkexec_env() { ++ /usr/bin/spack $@ ++} ++ + + _spack_shell_wrapper() { + # Store LD_LIBRARY_PATH variables from spack shell function +@@ -75,7 +79,7 @@ + [ "${_sp_flags#*h}" != "${_sp_flags}" ] || \ + [ "${_sp_flags#*V}" != "${_sp_flags}" ]; + then +- command spack $_sp_flags "$@" ++ _pkexec_env $_sp_flags "$@" + return + fi + +@@ -96,7 +100,7 @@ + shift + fi + if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then +- command spack cd -h ++ _pkexec_env cd -h + else + LOC="$(spack location $_sp_arg "$@")" + if [ -d "$LOC" ] ; then +@@ -115,7 +119,7 @@ + fi + + if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then +- command spack env -h ++ _pkexec_env env -h + else + case $_sp_arg in + activate) +@@ -132,10 +136,10 @@ + [ "${_a#* --help}" != "$_a" ]; + then + # No args or args contain --sh, --csh, or -h/--help: just execute. +- command spack env activate "$@" ++ _pkexec_env env activate "$@" + else + # Actual call to activate: source the output. +- stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags env activate --sh "$@")" || return ++ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" _pkexec_env $_sp_flags env activate --sh "$@")" || return + eval "$stdout" + fi + ;; +@@ -151,18 +155,18 @@ + [ "${_a#* --csh}" != "$_a" ]; + then + # Args contain --sh or --csh: just execute. +- command spack env deactivate "$@" ++ _pkexec_env env deactivate "$@" + elif [ -n "$*" ]; then + # Any other arguments are an error or -h/--help: just run help. +- command spack env deactivate -h ++ _pkexec_env env deactivate -h + else + # No args: source the output of the command. +- stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags env deactivate --sh)" || return ++ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" _pkexec_env $_sp_flags env deactivate --sh)" || return + eval "$stdout" + fi + ;; + *) +- command spack env $_sp_arg "$@" ++ _pkexec_env env $_sp_arg "$@" + ;; + esac + fi +@@ -183,14 +187,14 @@ + [ "${_a#* --help}" != "$_a" ]; + then + # Args contain --sh, --csh, or -h/--help: just execute. +- command spack $_sp_flags $_sp_subcommand "$@" ++ _pkexec_env $_sp_flags $_sp_subcommand "$@" + else +- stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags $_sp_subcommand --sh "$@")" || return ++ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" _pkexec_env $_sp_flags $_sp_subcommand --sh "$@")" || return + eval "$stdout" + fi + ;; + *) +- command spack $_sp_flags $_sp_subcommand "$@" ++ _pkexec_env $_sp_flags $_sp_subcommand "$@" + ;; + esac + } +@@ -365,7 +369,7 @@ + _spack_pathadd PATH "${_sp_module_bin}" + fi; + else +- stdout="$(command spack --print-shell-vars sh)" || return ++ stdout="$(_pkexec_env --print-shell-vars sh)" || return + eval "$stdout" + fi; + diff --git a/spack.pkaction b/spack.pkaction index e6ef88d6b7ea..93c2ea4738d9 100644 --- a/spack.pkaction +++ b/spack.pkaction @@ -11,8 +11,7 @@ <allow_inactive>auth_admin</allow_inactive> <allow_active>auth_admin</allow_active> </defaults> - <annotate key="org.freedesktop.policykit.exec.path">/opt/spack/libexec/spack</annotate> - <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> + <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/env</annotate> </action> </policyconfig> @@ -1,3 +1,2 @@ export SPACK_ROOT=/opt/spack -export PATH=/opt/spack/bin:${PATH} export MODULEPATH=/var/lib/spack/modules/tcl/:${MODULEPATH} diff --git a/spack.tmpfiles b/spack.tmpfiles index 3b4feb7e561f..c74a9ca15e7a 100644 --- a/spack.tmpfiles +++ b/spack.tmpfiles @@ -5,3 +5,6 @@ d /opt/spack/var/spack/junit-report 0755 spack spack d /opt/spack/var/spack/stage 0755 spack spack d /opt/spack/var/spack/repos 0755 spack spack d /opt/spack/var/spack/environments 0755 spack spack +d /opt/spack/opt 0755 spack spack +d /opt/spack/opt/spack/ 0755 spack spack +d /opt/spack/opt/spack/indices 0755 spack spack |