addpkg: drone-cli 1.3.3-1

This commit is contained in:
George Rawlinson 2021-09-05 19:05:16 +00:00
parent 48f7c3cd2d
commit 60b7c61f2f
Signed by: grawlinson
GPG Key ID: E0959FEA8B550539
1 changed files with 55 additions and 0 deletions

55
drone-cli/PKGBUILD Normal file
View File

@ -0,0 +1,55 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=drone-cli
pkgver=1.3.3
pkgrel=1
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=('de1068f27ae4da7301898375537a91ceb8a338e6e4f2966381b16957c8e724a0a713fd4b8db3c53e5fba8ac608d2ea111f5025cb2d7a561911f7f197e9d7ac2e')
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}\"" \
-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
}