blob: ca9d07bcd90d67ba7ff3b13c6ab0062dd408fa6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# Maintainer: Mario Finelli <mario at finel dot li>
pkgname=newrelic-cli
pkgver=0.97.13
pkgrel=1
pkgdesc="The New Relic Command Line Interface"
arch=(x86_64)
url=https://github.com/newrelic/newrelic-cli
license=(Apache-2.0)
depends=(glibc)
makedepends=(go)
source=(${url}/archive/v${pkgver}/$pkgname-$pkgver.tar.gz)
sha256sums=('c145df56cab8ed03d86714dc0dd8200b344f97b54ca1a6f72b64240593372892')
prepare() {
cd $pkgname-$pkgver
export GOPATH="${srcdir}/gopath"
go mod download
}
build() {
cd $pkgname-$pkgver
export CGO_LDFLAGS="$LDFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export GOPATH="${srcdir}/gopath"
go build \
-o bin/newrelic \
-trimpath \
-buildmode=pie \
-mod=readonly \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\" \
-X main.appName=newrelic-cli \
-X github.com/newrelic/newrelic-vli/internal/cli.version=${pkgver}" \
cmd/newrelic/*
}
package() {
cd $pkgname-$pkgver
install -Dm0755 bin/newrelic "$pkgdir/usr/bin/newrelic"
"${pkgdir}/usr/bin/newrelic" completion --shell bash | install -Dm0644 \
/dev/stdin "${pkgdir}/usr/share/bash-completion/completions/newrelic"
"${pkgdir}/usr/bin/newrelic" completion --shell zsh | install -Dm0644 \
/dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_newrelic"
"${pkgdir}/usr/bin/newrelic" completion --shell fish | install -Dm0644 \
/dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/newrelic.fish"
}
# vim: set ts=2 sw=2 et:
|