jobextra/booster/PKGBUILD

80 lines
2.8 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=booster
pkgver=0.11
pkgrel=01
pkgdesc='Fast and secure initramfs generator'
url='https://github.com/anatol/booster'
depends=(bash)
makedepends=(go ruby-ronn-ng)
#checkdepends=(qemu-headless linux tang)
optdepends=(
'busybox: to enable emergency shell at the boot time'
'yubikey-personalization: for clevis Yubikey challenge-response support'
'libfido2: for systemd-enroll with FIDO2'
)
backup=(etc/booster.yaml)
provides=(initramfs)
source=(booster-$pkgver.zip::https://github.com/anatol/booster/archive/$pkgver.zip)
build() {
cd booster-$pkgver
cd generator
CGO_CPPFLAGS="${CPPFLAGS}" CGO_CFLAGS="${CFLAGS}" CGO_CXXFLAGS="${CXXFLAGS}" CGO_LDFLAGS="${LDFLAGS}" \
go build -trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
cd ../init
CGO_ENABLED=0 go build -trimpath -mod=readonly -modcacherw
cd ..
ronn docs/manpage.md
}
check() {
cd booster-$pkgver
# (cd init; go test)
# (cd generator; go test)
# arch chroot does not allow access to KVM
# TEST_DISABLE_KVM=1 go test -v # disable integration tests for now as it require a lot of time and space to build 10G images
}
package() {
cd booster-$pkgver
mkdir "$pkgdir/etc/"
touch "$pkgdir/etc/booster.yaml"
install -Dp -m755 generator/generator "$pkgdir/usr/bin/booster"
install -Dp -m644 docs/manpage.1 "$pkgdir/usr/share/man/man1/booster.1"
install -Dp -m755 init/init "$pkgdir/usr/lib/booster/init"
install -Dp -m755 packaging/arch/regenerate_images "$pkgdir/usr/lib/booster/regenerate_images"
install -Dp -m644 packaging/arch/90-booster-install.hook "$pkgdir/usr/share/libalpm/hooks/90-booster-install.hook"
install -Dp -m755 packaging/arch/booster-install "$pkgdir/usr/share/libalpm/scripts/booster-install"
install -Dp -m644 packaging/arch/60-booster-remove.hook "$pkgdir/usr/share/libalpm/hooks/60-booster-remove.hook"
install -Dp -m755 packaging/arch/booster-remove "$pkgdir/usr/share/libalpm/scripts/booster-remove"
install -Dp -m755 contrib/completion/bash "$pkgdir/usr/share/bash-completion/completions/booster"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(MIT)
sha512sums=('66443568c504d563d5a774dd25d47d72ec745cad2b77fea3cbf881b51ed1ecfa093b2f2eeafca10b14ab80ff8125ec865646d1691b419a39b60858e2d4efa5d5')
sha256sums=(82fb76c63c609eca6390d6b5d02a91839924083294b2b8f63e06b1ec61d71625) # booster-0.11.zip
## f9b2421e80587c29e0a257faabeb05cc7355d42e31e4b2b8ee83d1d6d913a427 booster-0.11-01-x86_64.pkg.tar.lz