summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6b5c0d25c09ed5f03a3c8be207022044344b104 (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
37
38
39
# Maintainer: Jiachen YANG <farseerfc@gmail.com>
_pkgname=conoha-iso
pkgname=${_pkgname}-git
pkgver=0.4.3.r77.gb418bc8
pkgrel=1.1
pkgdesc="ISO image management tool for ConoHa"
arch=(x86_64)
url="https://github.com/hironobu-s/conoha-iso"
license=('MIT')
makedepends=(go git dep)
source=("git+https://github.com/hironobu-s/conoha-iso.git")
md5sums=('SKIP')

pkgver() {
	cd "$_pkgname"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed "s/current/$(grep -oP 'APP_VERSION.*"\K([.0-9]*)(?=")' app.go)/g"
#	printf "0.4.3.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	mkdir -p gopath/src/github.com/$_pkgname
	ln -rTsf $_pkgname gopath/src/github.com/$_pkgname/$_pkgname
	export GOPATH="$srcdir"/gopath
	cd gopath/src/github.com/$_pkgname/$_pkgname
        dep init
	dep ensure
}

build() {
	export GOPATH="$srcdir"/gopath
	cd gopath/src/github.com/$_pkgname/$_pkgname
	make linux
}

package() {
	cd gopath/src/github.com/$_pkgname/$_pkgname
	install -Dm755 bin/linux/conoha-iso $pkgdir/usr/bin/conoha-iso
	install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}