aboutsummaryrefslogtreecommitdiffstats
path: root/community/lab/APKBUILD
blob: 825e133adc5894b1ea413dff4330fd05220ba807 (plain) (blame)
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
40
41
42
43
44
45
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=lab
pkgver=0.18.0
pkgrel=0
pkgdesc="A Git Wrapper for GitLab"
url="https://zaquestion.github.io/lab/"
arch="all !mips64" # limited by go
license="CC0-1.0"
depends="git"
makedepends="go"
checkdepends="bash"
subpackages="
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="lab-$pkgver.tar.gz::https://github.com/zaquestion/lab/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/zaquestion/$pkgname"
options="net !check chmod-clean" # Tests require configured GitLab account with SSH keys

export GOPATH="$srcdir"
export CGO_ENABLED=0

prepare() {
	mkdir -p ${builddir%/*}
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/
	default_prepare
}

build() {
	GO111MODULE=on go build -ldflags "-X main.version=$pkgver" -o bin/$pkgname
	./bin/lab completion bash > lab.bash
	./bin/lab completion zsh > _lab.zsh
}

package() {
	install -Dm755 "$builddir"/bin/$pkgname \
		"$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$builddir"/lab.bash \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm644 "$builddir"/_lab.zsh \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="1559cde46144a830d2b3b30ee9e334d387112ca4a9aa50faf6de01099705c02da87197355184dc5d520360b2fc9f6e3d297a094f6befc0cc2505b904b9291773  lab-0.18.0.tar.gz"