From eb7b29b8c17d5280a90c9fbfd6f57a4fc85f9361 Mon Sep 17 00:00:00 2001 From: Ian Dunbar-Hall Date: Tue, 4 Jun 2024 22:33:15 -0700 Subject: [PATCH] testing/bomctl: new aport Signed-off-by: Ian Dunbar-Hall --- testing/bomctl/APKBUILD | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 testing/bomctl/APKBUILD diff --git a/testing/bomctl/APKBUILD b/testing/bomctl/APKBUILD new file mode 100644 index 00000000000..516f3cc5274 --- /dev/null +++ b/testing/bomctl/APKBUILD @@ -0,0 +1,56 @@ +# Maintainer: Ian Dunbar-Hall +pkgname=bomctl +pkgver=0.1.9 +pkgrel=0 +pkgdesc="Format agnostic SBOM tooling" +url="https://github.com/bomctl/bomctl" +arch="all" +license="Apache-2.0" +makedepends="go" +subpackages=" + $pkgname-bash-completion + $pkgname-fish-completion + $pkgname-zsh-completion + " +source="$pkgname-$pkgver.tar.gz::https://github.com/bomctl/bomctl/archive/refs/tags/v$pkgver.tar.gz" +options="chmod-clean net" + +export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" +export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" +export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" + +build() { + export major_minor_patch=$(echo $pkgver | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | head -n 1) + export major=$(echo $major_minor_patch | cut -d'.' -f1) + export minor=$(echo $major_minor_patch | cut -d'.' -f2) + export patch=$(echo $major_minor_patch | cut -d'.' -f3) + + mkdir build + go build -o build/ \ + -trimpath \ + -ldflags="-s -w + -X=github.com/bomctl/bomctl/cmd.VersionMajor=$major + -X=github.com/bomctl/bomctl/cmd.VersionMinor=$minor + -X=github.com/bomctl/bomctl/cmd.VersionPatch=$patch + -X=github.com/bomctl/bomctl/cmd.BuildDate=alpine" + + for i in bash fish zsh; do + "$builddir"/build/bomctl completion $i > "$builddir"/bomctl.$i + done +} + +check() { + "$builddir"/build/bomctl --version +} + +package() { + install -Dm755 "$builddir"/build/bomctl "$pkgdir"/usr/bin/bomctl + install -Dm644 "$builddir"/bomctl.bash "$pkgdir"/usr/share/bash-completion/completions/bomctl + install -Dm644 "$builddir"/bomctl.fish "$pkgdir"/usr/share/fish/vendor_completions.d/bomctl.fish + install -Dm644 "$builddir"/bomctl.zsh "$pkgdir"/usr/share/zsh/site-functions/_bomctl + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +} + +sha512sums=" +7870d422869c494303bbcb6f1a930945e2abdd07e38222201d0e0484729edcc4f291e65264e6ee8d94b57a10e0b8c721a8100bd669e4fff9721042033d3518b9 bomctl-0.1.9.tar.gz +"