archrelease: copy trunk to community-any
[ArchLinux/community.git] / influx-cli / trunk / PKGBUILD
blob068bc7a71aa21339db862756b3a5836088a7b51f
1 # Maintainer: Morten Linderud <foxboron@archlinux.org>
2 # Contributor: Nicolas Leclercq <nicolas.private@gmail.com>
3 # Contributor: Adam S Levy <adam@aslevy.com>
4 # Contributor: Charles B. Johnson <mail@cbjohnson.info>
5 # Contributor: Daichi Shinozaki <dsdseg@gmail.com>
6 # Contributor: Ben Alex <ben.alex@acegi.com.au>
8 pkgname=influx-cli
9 pkgver=2.7.3
10 _commit_sha=8b962c7
11 pkgrel=1
12 pkgdesc='CLI for managing resources in InfluxDB'
13 arch=('x86_64')
14 url='https://github.com/InfluxData/influx-cli'
15 license=('MIT')
16 makedepends=('go' 'go-tools' 'git')
17 options=('!lto')
18 backup=('etc/influxdb/influxdb.conf')
19 source=("git+https://github.com/influxdata/influx-cli.git#tag=v${pkgver}")
20 sha256sums=('SKIP')
22 build(){
23   cd "$pkgname"
24   export CGO_CPPFLAGS="${CPPFLAGS}"
25   export CGO_CFLAGS="${CFLAGS}"
26   export CGO_CXXFLAGS="${CXXFLAGS}"
27   export CGO_LDFLAGS="${LDFLAGS}"
28   export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
29   export LDFLAGS="-linkmode external"
30   PATH="$(go env GOPATH)/bin:$PATH" make VERSION=$pkgver COMMIT=$_commit_sha
33 check(){
34   cd "$pkgname"
35   PATH="$(go env GOPATH)/bin:$PATH" make test
38 package(){
39   cd "$pkgname"
40   install -Dm755 bin/linux/amd64/influx -t "$pkgdir/usr/bin"
41   install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/${pkgname}"
42   bin/linux/influx completion bash | install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/influx-cli"
43   bin/linux/influx completion zsh | install -Dm644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_influx-cli"
44   #bin/linux/influx completion fish | install -Dm644 /dev/stdin "$pkgdir/usr/share/fish/vendor_completions.d/influx-cli.fish"