summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5019f36c0bb0dced4f5e24ad536bee77c40c1caa (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: Per Osbäck <per@osbeck.com>
_gitname="terraform-provider-loopia"
pkgname="${_gitname}-git"
pkgver=r9.5493abf
pkgrel=1
arch=("x86_64")
url="https://github.com/jonlil/terraform-provider-loopia"
license=("MIT")
depends=()
makedepends=("go" "git")
provides=("${_gitname}")
conflicts=("${_gitname}")
source=("git+https://github.com/jonlil/$_gitname.git")
md5sums=('SKIP')

pkgver() {
  cd "${_gitname}"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "${_gitname}"
  export GOPATH="$srcdir/go" GOBIN="$srcdir/go/bin"
  go get -v
  go build
}
package() {
  cd "${_gitname}"
  install -Dm755 "$srcdir/go/bin/${_gitname}" "$pkgdir/usr/bin/${_gitname}"
}