# Maintainer: Patrik Cyvoct # Contributor: Mikkel Oscar Lyderik pkgname=scaleway-cli pkgver=2.5.1 pkgrel=1 pkgdesc="Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal." arch=('x86_64') url="https://scaleway.com" license=('Apache') makedepends=('go' 'git') optdepends=( 'bash-completion: Bash completions' 'zsh-completions: ZSH completitons' ) source=("https://github.com/scaleway/$pkgname/archive/v${pkgver}.tar.gz") build() { cd "$pkgname-$pkgver" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" go build -ldflags "-X main.BuildDate=$(date -u '+%Y-%m-%dT%I:%M:%S%p')" \ -o scw ./cmd/scw/main.go } check() { cd "$pkgname-$pkgver" go test ./... } package() { cd "$pkgname-$pkgver" install -Dm755 scw "$pkgdir/usr/bin/scw" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" ./scw autocomplete script shell=zsh | install -Dm644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_scw" ./scw autocomplete script shell=bash | install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/scw" } sha256sums=('af926168122c192b10a19d701f2a03a41f14897b2a6c654499203edd2aafcafe') # vim:set ts=2 sw=2 et: