50 lines
1.3 KiB
Bash
50 lines
1.3 KiB
Bash
# Maintainer: Giovanni Harting <539@idlegandalf.com>
|
|
# Contributor: ny-a <nyaarch64@gmail..com>
|
|
# Contributor: Jean Lucas <jean@4ray.co>
|
|
# Contributor: Sam Whited <sam@samwhited.com>
|
|
|
|
pkgname=stripe-cli
|
|
pkgver=1.12.4
|
|
pkgrel=1
|
|
pkgdesc='CLI for Stripe'
|
|
arch=(x86_64)
|
|
url=https://github.com/stripe/stripe-cli
|
|
license=(Apache)
|
|
depends=(glibc)
|
|
makedepends=(go git)
|
|
source=($pkgname-$pkgver.tar.gz::https://github.com/stripe/stripe-cli/archive/v$pkgver.tar.gz)
|
|
b2sums=('e9180586efe6a80cb233346c2f37a65cdd8412ac81c4136ce5c0c532b9ea7e250dd84843a563070fb60289ed894bb917afc37062467c0b1e6419405fd5777703')
|
|
|
|
prepare() {
|
|
cd $pkgname-$pkgver
|
|
go mod download
|
|
}
|
|
|
|
build() {
|
|
cd $pkgname-$pkgver
|
|
|
|
go generate ./...
|
|
|
|
go build \
|
|
-trimpath \
|
|
-buildmode=pie \
|
|
-mod=readonly \
|
|
-modcacherw \
|
|
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
|
|
-o stripe \
|
|
cmd/stripe/main.go
|
|
}
|
|
|
|
check() {
|
|
cd $pkgname-$pkgver
|
|
go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -run . -timeout=2m
|
|
}
|
|
|
|
package() {
|
|
cd $pkgname-$pkgver
|
|
install -D stripe -t "$pkgdir"/usr/bin
|
|
install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
|
|
install -Dm644 stripe-completion.bash "$pkgdir"/usr/share/bash-completion/completions/stripe
|
|
cp -a docs "$pkgdir"/usr/share/doc/$pkgname
|
|
}
|