summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef9d90d6ce10f0bd7353e04ecb85e5be909fb51c (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
# Maintainer: Rainu <mqtt-shell@raysha.de>
pkgname=mqtt-shell
pkgver=2.1.0
pkgrel=1
pkgdesc='A shell like command line interface for MQTT written in go.'
arch=('x86_64' 'i686')
url="https://github.com/rainu/mqtt-shell"
license=('MIT')
makedepends=('git' 'go>=1.14')
source=("git+$url.git#tag=v$pkgver")
sha256sums=("SKIP")

prepare(){
  cd "$srcdir/$pkgname"
  mkdir -p build/
}

build() {
  cd "$srcdir/$pkgname"
  CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -w" -o build ./cmd/...
}

check() {
  cd "$srcdir/$pkgname"
  go test ./...
}

package() {
  cd "$srcdir/$pkgname"
  install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}