From 60b7c61f2ff21ed68023c594ed87fd7e5cbda835 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Sun, 5 Sep 2021 19:05:16 +0000 Subject: [PATCH] addpkg: drone-cli 1.3.3-1 --- drone-cli/PKGBUILD | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 drone-cli/PKGBUILD diff --git a/drone-cli/PKGBUILD b/drone-cli/PKGBUILD new file mode 100644 index 0000000..ddaa491 --- /dev/null +++ b/drone-cli/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: George Rawlinson + +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 +}