-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
case "${ACTION}" in | ||
post) | ||
if [ "$(readlink -f . 2>/dev/null || echo .)" != "/" ]; then | ||
exit 1 | ||
else | ||
chown root:_singularity usr/libexec/singularity/bin/starter-suid | ||
chmod 4755 usr/libexec/singularity/bin/starter-suid | ||
fi | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Template file for 'singularity' | ||
pkgname=singularity | ||
version=3.11.0 | ||
revision=1 | ||
build_style=configure | ||
configure_script=./mconfig | ||
configure_args="--prefix=/usr \ | ||
--exec-prefix=/usr \ | ||
--bindir=/usr/bin \ | ||
--libexecdir=/usr/libexec \ | ||
--sysconfdir=/etc \ | ||
--sharedstatedir=/var/lib \ | ||
--mandir=/usr/share/man \ | ||
--localstatedir=/var/lib \ | ||
--without-conmon" | ||
make_dirs="/var/lib/singularity/mnt/session 755 root root" | ||
hostmakedepends="wget pkg-config go cryptsetup" | ||
# makedepends="libseccomp-devel glib-devel squashfs-tools runc" | ||
makedepends="libseccomp-devel squashfs-tools runc" | ||
depends="squashfs-tools cryptsetup conmon" | ||
short_desc="HPC centric container platform" | ||
maintainer="Senwen Deng <void@snwn.de>" | ||
license="BSD-3-Clause-LBNL" | ||
homepage="https://sylabs.io/singularity/" | ||
distfiles="https://github.com/sylabs/${pkgname}/releases/download/v${version}/${pkgname}-ce-${version}.tar.gz" | ||
checksum=45c297f05065c7c920898af37acb781070b2330f141d7a566073197801577753 | ||
|
||
do_configure() { | ||
if ! [[ -z ${CROSS_BUILD} ]]; then | ||
vsed -i \ | ||
-e '/feature: NO_NEW_PRIVS/,/feature: MS_SLAVE/{//!d}' \ | ||
./mlocal/checks/project-post.chk | ||
GOOS=linux GOARCH=amd64 ${configure_script} ${configure_args} -C ${XBPS_CROSS_TRIPLET}-gcc -X ${XBPS_CROSS_TRIPLET}-c++ | ||
else | ||
${configure_script} ${configure_args} | ||
fi | ||
} | ||
|
||
post_configure() { | ||
# Fixup Makefile | ||
# * Force use of vendored packages | ||
# * Don't install bash completions into /etc/bash_completion.d | ||
vsed -i \ | ||
-e 's@^GO_MODFLAGS := .*@GO_MODFLAGS := -mod=vendor@' \ | ||
-e 's@INSTALLFILES += $(bash_completion_INSTALL)@@' \ | ||
builddir/Makefile | ||
} | ||
|
||
do_build() { | ||
if ! [[ -z ${CROSS_BUILD} ]]; then | ||
GOOS=linux GOARCH=amd64 srcdir=$PWD make -C builddir old_config= | ||
fi | ||
srcdir=$PWD make -C builddir old_config= | ||
} | ||
|
||
do_install() { | ||
make DESTDIR="${DESTDIR}" -C builddir install all | ||
chmod 0750 $DESTDIR/usr/libexec/singularity/bin/starter-suid | ||
vlicense LICENSE.md | ||
vcompletion builddir/etc/bash_completion.d/singularity bash | ||
} | ||
|
||
do_check() { | ||
# XXX: tests require sudo, so skip for now. | ||
# make -C builddir unit-test integration-test e2e-test | ||
: "Pass" | ||
} |