Skip to content

Instantly share code, notes, and snippets.

@truatpasteurdotfr
Created February 13, 2022 17:51
Show Gist options
  • Save truatpasteurdotfr/c2478c19fea4d130bcb23de35c808536 to your computer and use it in GitHub Desktop.
Save truatpasteurdotfr/c2478c19fea4d130bcb23de35c808536 to your computer and use it in GitHub Desktop.
apptainer 1.0.0rc2 for alpine linux
# Contributor: "Tru Huynh <[email protected]>"
# Maintainer: "Tru Huynh <[email protected]>"
pkgname=apptainer
pkgver=1.0.0_rc2
realpkgver=1.0.0-rc.2
pkgrel=0
pkgdesc="Apptainer: Application containers for Linux"
url="https://github.com/apptainer/apptainer"
arch="x86_64"
# https://raw.githubusercontent.com/apptainer/apptainer/main/LICENSE.md
license="BSD-3-Clause-LBNL"
depends="squashfs-tools cryptsetup"
makedepends="bash gawk go libc-dev linux-headers libressl-dev libuuid util-linux-dev libseccomp-dev"
install=""
subpackages="$pkgname-doc $pkgname-examples"
#source="${pkgname}-${pkgver}.tar.gz::https://github.com/apptainer/apptainer/releases/download/v${pkgver}/${pkgname}-${pkgver/_/-/}.tar.gz
source="${pkgname}-${realpkgver}.tar.gz::https://github.com/apptainer/apptainer/releases/download/v${realpkgver}/${pkgname}-${realpkgver}.tar.gz
singularity-3.8.1-cgo.patch
"
options="suid !check" # no testsuite
builddir="$srcdir/${pkgname}-${realpkgver}"
prepare() {
# mkdir -p "$srcdir/go/src/github.com/sylabs/${pkgname}"
# mv "$srcdir/$pkgname" "$srcdir/go/src/github.com/sylabs"
cd "$builddir"
for i in $source; do
case $i in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || return 1
;;
esac
done
./mconfig \
-b $CBUILD \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--libexecdir=/usr/libexec \
--sysconfdir=/etc \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--localstatedir=/var \
--libdir=/usr/lib \
|| return 1
}
build() {
export GOPATH="$srcdir/go"
cd $CBUILD && \
make -j 1 || return 1
}
package() {
cd "$builddir" && \
cd $CBUILD && \
make -j 1 DESTDIR="$pkgdir" install || return 1
}
doc() {
arch="noarch"
cd "$builddir" && \
mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname" || return 1
# Doc files
_docs="CONTRIBUTING.md CONTRIBUTORS.md COPYRIGHT.md INSTALL.md LICENSE-LBNL.md LICENSE.md README.md VERSION"
_docs="CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTORS.md COPYRIGHT.md DCO.md INSTALL.md LICENSE-APACHE-2.0 LICENSE-LBNL.md LICENSE.md NOTICE-APACHE-2.0 README.md RELEASE_PROCEDURE.md SUPPORT.md VERSION"
for _doc in $_docs; do
install -Dm644 $_doc \
"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
done
mkdir -p "$pkgdir"/usr/share/man/man1/
cd "$builddir" && \
cd $CBUILD && \
make -j 1 DESTDIR="$pkgdir" install man || return 1
gzip "$pkgdir"/usr/share/man/man1/apptainer*.1 || return 1
}
examples() {
arch="noarch"
# Put the examples into a seperate package
cd "$builddir"
mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname"/examples || return 1
mv examples/* "$subpkgdir"/usr/share/doc/"$pkgname"/examples || return 1
}
sha512sums="
d86e236bf57768ac22a203e3d962b961f74358208034b38768bd54760f8c775cf4a9221e1d4abde80b0cb6ff4b8f32992ac054e6b60da5bb167ccc100fa71826 apptainer-1.0.0-rc.2.tar.gz
22d5d006aca1fee4d1679a90ea28c63fd20f2cb1912ad7540497d1b6ca9845185fa8f3a1045f5d42575868a777a5eef74eba1d66c3e279bedbbd79370d4624e9 singularity-3.8.1-cgo.patch
"
# Contributor: "Tru Huynh <[email protected]>"
# Maintainer: "Tru Huynh <[email protected]>"
pkgname=apptainer
pkgver=1.0.0_rc2
realpkgver=1.0.0-rc.2
pkgrel=0
pkgdesc="Apptainer: Application containers for Linux"
url="https://github.com/apptainer/apptainer"
arch="x86_64"
# https://raw.githubusercontent.com/apptainer/apptainer/main/LICENSE.md
license="BSD-3-Clause-LBNL"
depends="squashfs-tools cryptsetup"
makedepends="bash gawk go libc-dev linux-headers libressl-dev libuuid util-linux-dev libseccomp-dev"
install=""
subpackages="$pkgname-doc $pkgname-examples"
#source="${pkgname}-${pkgver}.tar.gz::https://github.com/apptainer/apptainer/releases/download/v${pkgver}/${pkgname}-${pkgver/_/-/}.tar.gz
source="${pkgname}-${realpkgver}.tar.gz::https://github.com/apptainer/apptainer/releases/download/v${realpkgver}/${pkgname}-${realpkgver}.tar.gz
singularity-3.8.1-cgo.patch
"
options="suid !check" # no testsuite
builddir="$srcdir/${pkgname}-${realpkgver}"
prepare() {
# mkdir -p "$srcdir/go/src/github.com/sylabs/${pkgname}"
# mv "$srcdir/$pkgname" "$srcdir/go/src/github.com/sylabs"
cd "$builddir"
for i in $source; do
case $i in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || return 1
;;
esac
done
./mconfig \
-b $CBUILD \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--libexecdir=/usr/libexec \
--sysconfdir=/etc \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--localstatedir=/var \
--libdir=/usr/lib \
|| return 1
}
build() {
export GOPATH="$srcdir/go"
cd $CBUILD && \
make -j 1 || return 1
}
package() {
cd "$builddir" && \
cd $CBUILD && \
make -j 1 DESTDIR="$pkgdir" install || return 1
}
doc() {
arch="noarch"
cd "$builddir" && \
mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname" || return 1
# Doc files
_docs="CONTRIBUTING.md CONTRIBUTORS.md COPYRIGHT.md INSTALL.md LICENSE-LBNL.md LICENSE.md README.md VERSION"
_docs="CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTORS.md COPYRIGHT.md DCO.md INSTALL.md LICENSE-APACHE-2.0 LICENSE-LBNL.md LICENSE.md NOTICE-APACHE-2.0 README.md RELEASE_PROCEDURE.md SUPPORT.md VERSION"
for _doc in $_docs; do
install -Dm644 $_doc \
"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
done
mkdir -p "$pkgdir"/usr/share/man/man1/
cd "$builddir" && \
cd $CBUILD && \
make -j 1 DESTDIR="$pkgdir" install man || return 1
gzip "$pkgdir"/usr/share/man/man1/apptainer*.1 || return 1
}
examples() {
arch="noarch"
# Put the examples into a seperate package
cd "$builddir"
mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname"/examples || return 1
mv examples/* "$subpkgdir"/usr/share/doc/"$pkgname"/examples || return 1
}
sha512sums="
d86e236bf57768ac22a203e3d962b961f74358208034b38768bd54760f8c775cf4a9221e1d4abde80b0cb6ff4b8f32992ac054e6b60da5bb167ccc100fa71826 apptainer-1.0.0-rc.2.tar.gz
22d5d006aca1fee4d1679a90ea28c63fd20f2cb1912ad7540497d1b6ca9845185fa8f3a1045f5d42575868a777a5eef74eba1d66c3e279bedbbd79370d4624e9 singularity-3.8.1-cgo.patch
"
--- singularity-3.8.1.orig/cmd/starter/main_linux.go 2021-08-16 16:43:20.000000000 +0000
+++ singularity-3.8.1/cmd/starter/main_linux.go 2021-08-23 16:47:44.959999999 +0000
@@ -5,8 +5,7 @@
package main
-// #cgo CFLAGS: -I${SRCDIR}/../../builddir
-// #include <config.h>
+// #include "../../x86_64-alpine-linux-musl/config.h"
// #include "c/message.c"
// #include "c/capability.c"
// #include "c/setns.c"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment