summaryrefslogtreecommitdiff
blob: 014f26274d7b49a51368d29de5fe68b6e0c81534 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit bash-completion-r1

EGO_PN=github.com/justwatchcom/${PN}

if [[ ${PV} == 9999 ]]; then
	inherit golang-vcs
else
	KEYWORDS="~amd64 ~x86 ~arm"
	EGIT_COMMIT="v${PV}"
	SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
	inherit golang-vcs-snapshot
fi

DESCRIPTION="The team password manager. Written in Go."
HOMEPAGE="https://www.justwatch.com/gopass"
LICENSE="MIT"
SLOT="0"
IUSE="X zsh-completion test"
DEPEND=">=dev-lang/go-1.6:="
RDEPEND="
	app-crypt/gnupg
	X? ( x11-misc/xclip )
	zsh-completion? ( app-shells/gentoo-zsh-completions )
	dev-vcs/git
"

src_compile() {
	cd "${S}"/src/${EGO_PN} || die
	GOPATH="${S}" LDFLAGS="" emake build || die
}

src_install() {
	cd "${S}"/src/${EGO_PN} || die
	emake DESTDIR="${D}" install
	if use zsh-completion; then
		emake zsh.completion || die
		insinto /usr/share/zsh/site-functions
		newins zsh.completion _${PN}
	fi
	emake bash.completion || die
	newbashcomp bash.completion ${PN}
	einstalldocs
}