summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6aea0666c2716b007e5945b8fde998bea74f0a76 (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
# Maintainer: Jean-Francois Chevrette <jfchevrette@gmail.com>
_pkgname=gojsontoyaml
pkgname=${_pkgname}-git
pkgver=r3.6337f37
pkgrel=1
pkgdesc="Simple tool to convert json to yaml written in Go."
url="https://github.com/brancz/gojsontoyaml"
license=('MIT')
arch=('i686' 'x86_64')
optdepends=()
makedepends=('git' 'go')
source=("git+https://github.com/brancz/gojsontoyaml.git")
md5sums=('SKIP')

pkgver() {
	cd "$srcdir/src/github.com/brancz/gojsontoyaml"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	rm -rf "$srcdir/src"
	mkdir -p "$srcdir/src/github.com/brancz"
	mv -T "$srcdir/gojsontoyaml" "$srcdir/src/github.com/brancz/gojsontoyaml"
}

build() {
	export GOPATH="$srcdir"
	cd "$GOPATH/src/github.com/brancz/gojsontoyaml"
	go build -o gojsontoyaml
}

package() {
	install -Dm755 "$GOPATH/src/github.com/brancz/gojsontoyaml/gojsontoyaml" -t "$pkgdir/usr/bin"
}