summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a86c249c77bd3563a7c86f54f7f489424ce2b89 (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
# Maintainer: Parham Alvani <parham.alvani@gmail.com>

pkgname=natscli-git
pkgver="r1889.118da2e"
pkgrel=1
pkgdesc="The NATS Command Line Interface"
arch=(x86_64)
url="https://github.com/nats-io/natscli"
license=('Apache')
makedepends=("go")
conflicts=('natscli-bin' 'natscli')
provides=('nats')

source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/$pkgname" || exit
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd "${srcdir}/${pkgname}/nats"
	go build \
		-trimpath \
		-buildmode=pie \
		-mod=readonly \
		-modcacherw \
		-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
		.
}

package() {
	cd "${srcdir}/${pkgname}/nats"
	install -D -m755 nats ${pkgdir}/usr/bin/nats
}