mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-13 00:16:45 +02:00
58 lines
1.7 KiB
Text
58 lines
1.7 KiB
Text
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=virter
|
|
pkgver=0.28.1
|
|
pkgrel=4
|
|
pkgdesc="CLI tool for simple creation and cloning of libvirt virtual machines"
|
|
url="https://github.com/LINBIT/virter"
|
|
arch="all"
|
|
license="Apache-2.0"
|
|
depends="libvirt dnsmasq-utils"
|
|
makedepends="go"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/LINBIT/virter/archive/refs/tags/v$pkgver.tar.gz
|
|
update-mockery.patch
|
|
"
|
|
|
|
build() {
|
|
local _goldflags="
|
|
-X github.com/LINBIT/virter/cmd.version=v$pkgver
|
|
-X github.com/LINBIT/virter/cmd.builddate=$(date -u "+%Y-%m-%dT%H:%M:%S%z" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
|
|
-X github.com/LINBIT/virter/cmd.githash=AlpineLinux
|
|
"
|
|
go build -v -ldflags "$_goldflags"
|
|
|
|
for shell in bash fish zsh; do
|
|
./virter completion $shell > virter.$shell
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# Create mock files with mockery
|
|
go generate internal/virter/virter_test.go
|
|
|
|
go test ./...
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 virter -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 doc/*.md -t "$pkgdir"/usr/share/doc/"$pkgname"/
|
|
cp -r examples "$pkgdir"/usr/share/doc/"$pkgname"/
|
|
|
|
install -Dm644 virter.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/virter
|
|
install -Dm644 virter.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/virter.fish
|
|
install -Dm644 virter.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_virter
|
|
}
|
|
|
|
sha512sums="
|
|
e321473827efb0edebb527e013796869d960256351fd7bb89d7479fdf8e4e409b877e2d5fdd7075e4c9ab6cb253fdeee4a691d48060027d73f41243128d963ca virter-0.28.1.tar.gz
|
|
d50cb52b4af218310f8faeb7a1ebd528b7ca7f97dc85f0babf5b6cbdfca32f6abef2780d1440d982209bce8d991f21efaa0681f1962beab8c47b19071c8d1b82 update-mockery.patch
|
|
"
|