aboutsummaryrefslogtreecommitdiffstats
path: root/testing/gopass/APKBUILD
blob: 57146a8d71acfd1de69fde698df78f3987a90031 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Claas Störtenbecker <claas.stoertenbecker@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=gopass
pkgver=1.8.5
pkgrel=1
pkgdesc="The slightly more awesome Standard Unix Password Manager for Teams. Written in Go."
url="https://www.gopass.pw"
arch="all"
license="MIT"
depends="gnupg git"
makedepends="go ncurses"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/gopasspw/gopass/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/gopasspw/$pkgname"
subpackages="
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch"
# test suite exists but fails for reasons i don't know yet, will talk with gopass developer
options="!check"

prepare() {
	mkdir -p "$srcdir/src/github.com/gopasspw"
	mv "$srcdir/$pkgname-$pkgver" "$srcdir/src/github.com/gopasspw/gopass"
}

build() {
	GOPATH="$srcdir" make build

	for completion in bash zsh fish; do
		./gopass completion $completion > ${completion}.completion;
	done
}

package() {
	install -Dm755 "$builddir/$pkgname" -t "$pkgdir/usr/bin"
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm0644 "$builddir"/bash.completion "$subpkgdir"/usr/share/bash-completion/completions/gopass
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -Dm0644 "$builddir"/zsh.completion "$subpkgdir"/usr/share/zsh/site-functions/_gopass
}

fishcomp() {
	depends=""
	pkgdesc="Fish completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	install -Dm0644 "$builddir"/fish.completion "$subpkgdir"/usr/share/fish/completions/gopass.fish
}
sha512sums="1f451b10aa87141de635650489bf7227c252e10e5139dad274c95d5625db74fec0b8892a468800d3d3c5dd8b3d64f1c93bd6c75a0ba54fe5f6e630c77b2c6c71  gopass-1.8.5.tar.gz"