mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-11 14:26:38 +02:00
83 lines
2.2 KiB
Text
83 lines
2.2 KiB
Text
# Contributor: Dennis Przytarski <dennis@przytarski.com>
|
|
# Maintainer: Dennis Przytarski <dennis@przytarski.com>
|
|
pkgname=firecracker
|
|
pkgver=1.9.0
|
|
pkgrel=0
|
|
pkgdesc="Secure and fast microVMs for serverless computing"
|
|
url="https://github.com/firecracker-microvm/firecracker"
|
|
arch="aarch64 x86_64"
|
|
license="Apache-2.0"
|
|
makedepends="rust cargo clang-dev cmake linux-headers cargo-auditable"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-seccompiler
|
|
$pkgname-rebase-snap:rebase_snap
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/firecracker-microvm/firecracker/archive/v$pkgver.tar.gz"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
cargo fetch --locked --target "$CTARGET"
|
|
|
|
# Change the seccomp filters' names so they get embedded into the binary
|
|
for a in $arch; do
|
|
mv -v resources/seccomp/"$a-unknown-linux-musl.json" resources/seccomp/"$a-alpine-linux-musl.json"
|
|
done
|
|
}
|
|
|
|
build() {
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
|
cargo auditable build \
|
|
--package firecracker \
|
|
--package jailer \
|
|
--package seccompiler \
|
|
--package rebase-snap \
|
|
--target "$CTARGET" \
|
|
--all-features \
|
|
--frozen \
|
|
--release
|
|
}
|
|
|
|
check() {
|
|
# jailer: tests failed testing functionality of cgroups
|
|
# seccompiler: tests failed spawning a thread
|
|
cargo test \
|
|
--package firecracker \
|
|
--package rebase-snap \
|
|
--target "$CTARGET" \
|
|
--frozen
|
|
|
|
# Other integration tests need pytest and docker
|
|
}
|
|
|
|
package() {
|
|
install -Dm0755 build/cargo_target/"$CTARGET"/release/firecracker \
|
|
-t "$pkgdir"/usr/bin
|
|
install -Dm0755 build/cargo_target/"$CTARGET"/release/jailer \
|
|
-t "$pkgdir"/usr/bin
|
|
install -Dm0755 build/cargo_target/"$CTARGET"/release/rebase-snap \
|
|
-t "$pkgdir"/usr/bin
|
|
install -Dm0755 build/cargo_target/"$CTARGET"/release/seccompiler-bin \
|
|
-t "$pkgdir"/usr/bin
|
|
|
|
rm docs/images/*logo*.png
|
|
install -dm0755 "$pkgdir"/usr/share/doc/"$pkgname"/
|
|
mv docs/* "$pkgdir"/usr/share/doc/"$pkgname"/
|
|
}
|
|
|
|
seccompiler() {
|
|
pkgdesc="$pkgdesc - seccompiler"
|
|
|
|
amove usr/bin/seccompiler-bin
|
|
}
|
|
|
|
rebase_snap() {
|
|
pkgdesc="$pkgdesc - rebasing diff snapshot tool"
|
|
|
|
amove usr/bin/rebase-snap
|
|
}
|
|
|
|
sha512sums="
|
|
9fe1e53e8b4a29b92182df0efe60c6b539969d8c3827c2e0375dc8302b84e41d35527c5d9d6253c0c90bd6329e28beb28208e5705141270a67b3a218beb6b243 firecracker-1.9.0.tar.gz
|
|
"
|