summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD22
2 files changed, 14 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8be489c1912..47a21b6525b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,11 @@
pkgbase = do-agent
pkgdesc = DigitalOcean Agent for Enhanced Droplet Graphs
pkgver = 3.5.6
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/digitalocean/do-agent
arch = x86_64
license = Apache
- makedepends = docker
+ makedepends = go
source = https://github.com/digitalocean/do-agent/archive/3.5.6.tar.gz
source = do-agent.service
sha512sums = e0007dcc8df3eb5f217e8db0b8dc9696c5b8557090712254f2b91e6d7e9c94321141d2fcc9cd13dc0153d3f76c966b968818a1ff01130a561cb97765edf840a5
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"
}