From c4f6c3f16c6cf92574fc12e8d179b2b69b25f3c5 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Fri, 3 Nov 2023 00:54:06 +0000 Subject: user/spack: relocate to '/opt/spack'. Additional changes: * add 'linux-headers' to makedepends; required by openssl during clingo bootstrap * add .post-install file to inform admins about usage --- user/spack/APKBUILD | 34 ++++++++++++++++++---------------- user/spack/spack.post-install | 28 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 user/spack/spack.post-install diff --git a/user/spack/APKBUILD b/user/spack/APKBUILD index ef1b8250f..1ffc6ab79 100644 --- a/user/spack/APKBUILD +++ b/user/spack/APKBUILD @@ -2,16 +2,17 @@ # Maintainer: Zach van Rijn pkgname=spack pkgver=0.20.3_p1 -pkgrel=1 +pkgrel=2 pkgdesc="A flexible package manager for supercomputers." url="https://spack.io/" arch="all" license="Apache-2.0 OR MIT" -options="!dbg !strip" +options="!dbg !strip !fhs" makedepends="python3-dev" depends="$makedepends gcc g++ gfortran bzip2 file git gnupg gzip libarchive-tools make patch unzip xz + linux-headers " subpackages="" # https://git.adelielinux.org/adelie/docs/-/wikis/Developer-Resources/Maintaining-Spack @@ -22,15 +23,18 @@ source="https://git.adelielinux.org/adelie/$pkgname/-/archive/adelie-v$pkgver/$p default-no-buildcache.patch " -builddir="$srcdir/$pkgname-adelie-v$pkgver" +install="$pkgname.post-install" +builddir="${srcdir}/${pkgname}-adelie-v${pkgver}" prepare() { default_prepare - sed -i etc/spack/defaults/bootstrap.yaml \ - -e '/github-actions/d' \ - ; + # disable binary bootstrap + sed -i etc/spack/defaults/bootstrap.yaml -e '/github-actions/d'; + + # delete windows files + find bin \( -name '*.ps1' -o -name '*.py' -o -name '*.bat' \) -delete; } check() { @@ -39,24 +43,22 @@ check() { # Spack's new "concretizer". The output from this process # is not kept, however it demonstrates Spack's functionality. export SPACK_DISABLE_LOCAL_CONFIG=true - export SPACK_USER_CONFIG_PATH=$builddir/tmp - export SPACK_USER_CACHE_PATH=$builddir/tmp + export SPACK_USER_CONFIG_PATH=${builddir}/tmp + export SPACK_USER_CACHE_PATH=${builddir}/tmp bin/spack --debug install zlib + rm -fr var/spack/cache rm -fr etc/spack/linux # caches compilers.yaml } package() { - find bin \( -name '*.ps1' -o -name '*.py' -o -name '*.bat' \) -delete; - - install -m755 -d "$pkgdir"/usr; - for k in bin share lib; do - mv ${k} "$pkgdir"/usr/${k}; + install -m755 -d "${pkgdir}"/opt/spack; + for k in bin etc lib share var; do + mv "${k}" "${pkgdir}"/opt/spack; done - for k in etc var; do - install -m755 -d "$pkgdir"/${k}; - mv ${k}/spack "$pkgdir"/${k}; + for k in LICENSE-APACHE LICENSE-MIT NOTICE; do + install -Dm644 ${k} "${pkgdir}"/usr/share/licenses/${pkgname}/${k}; done } diff --git a/user/spack/spack.post-install b/user/spack/spack.post-install new file mode 100644 index 000000000..03e76cde4 --- /dev/null +++ b/user/spack/spack.post-install @@ -0,0 +1,28 @@ +#!/bin/sh -e + +cat <