summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorKyle Manna2020-05-23 19:51:27 -0700
committerKyle Manna2020-05-23 19:52:24 -0700
commit6a1e8ba70aae6f13b5996dcdd1b1ee0973998254 (patch)
tree6c4234ad1154ed630ca7885c9675c6cd0fa16c5b /PKGBUILD
parent0957f2eb71ec8bb98bb17489c9cd9c7915e0cd65 (diff)
downloadaur-do-agent.tar.gz
pkgrel: Build without Docker
* Thanks to @z3ntu from AUR.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD22
1 files changed, 12 insertions, 10 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e7d1ef03aeb..d39afc7770d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,11 +2,11 @@
pkgname=do-agent
pkgver=3.5.6
-pkgrel=1
+pkgrel=2
pkgdesc='DigitalOcean Agent for Enhanced Droplet Graphs'
url='https://github.com/digitalocean/do-agent'
arch=('x86_64')
-makedepends=('docker')
+makedepends=('go')
depends=()
license=('Apache')
@@ -18,20 +18,22 @@ sha512sums=('e0007dcc8df3eb5f217e8db0b8dc9696c5b8557090712254f2b91e6d7e9c9432114
'19d040ae8a75a73a86c1b473983ecf84410fc6a24a7f9142e98dc00c6dbda1ff1f2e2caec0d37bb3c6f557133644ea91f49a75697f5c4bdc23af56407d1fbcaa')
prepare() {
- cd "$srcdir"
- mkdir -p go/src/github.com/digitalocean
- mv "$srcdir/$pkgname-$pkgver" "$srcdir/go/src/github.com/digitalocean/$pkgname"
- ln -s "$srcdir/go/src/github.com/digitalocean/$pkgname" "$srcdir/$pkgname-$pkgver"
+ cd "$pkgname-$pkgver"
+ mkdir -p build/
}
build() {
- cd "$srcdir/go/src/github.com/digitalocean/$pkgname"
- export GOPATH=$srcdir/go
- make VERSION=${pkgver} build
+ cd "$pkgname-$pkgver"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+ go build -ldflags "-s -w -X \"main.version=3.5.6\" -X \"main.buildDate=$(date -u)\"" -o build ./cmd/do-agent
}
package() {
install -d $pkgdir/usr/{bin,lib/systemd/system}
- install -Dm755 "$srcdir/$pkgname-$pkgver/target/do-agent-linux-amd64" "$pkgdir/usr/bin/do-agent"
+ install -Dm755 "$srcdir/$pkgname-$pkgver/build/do-agent" "$pkgdir/usr/bin/do-agent"
install -Dm644 "$srcdir/do-agent.service" "$pkgdir/usr/lib/systemd/system/do-agent.service"
}