arch-pkgs/drone-cli/PKGBUILD

56 lines
1.2 KiB
Text
Raw Normal View History

2021-09-05 19:05:16 +00:00
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=drone-cli
pkgver=1.4.0
pkgrel=1
2021-09-05 19:05:16 +00:00
pkgdesc="Command line interface for Drone CI"
arch=('x86_64')
url="https://docs.drone.io/cli"
license=('Apache')
makedepends=('go' 'git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/drone/drone-cli/archive/v$pkgver.tar.gz")
b2sums=('a894c14c011374df5498bace23d40e7376b112250cbf901419f26eb6434fae12a6c325fde907adc25049c3c712574fa41a34984fd8467417134b755a06bde64e')
2021-09-05 19:05:16 +00:00
prepare() {
cd "$pkgname-$pkgver"
# create directory for build output
mkdir build
# download dependencies
go mod vendor
}
build() {
cd "$pkgname-$pkgver"
# set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
go build -v \
-trimpath \
-buildmode=pie \
-mod=vendor \
-modcacherw \
-ldflags "-linkmode external -extldflags ${LDFLAGS} -X main.version=$pkgver" \
2021-09-05 19:05:16 +00:00
-o build \
./...
}
check() {
cd "$pkgname-$pkgver"
go test -v ./...
}
package() {
cd "$pkgname-$pkgver"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/drone
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
}