summaryrefslogtreecommitdiff
blob: 9792a5fd8f332129a49a1c97c766f82e5426c868 (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

MY_PN=browserpass-native
EGO_PN=github.com/browserpass/${MY_PN}

if [[ ${PV} == 9999 ]]; then
	inherit golang-vcs
else
	KEYWORDS="~amd64"
#	MY_P="${MY_PN}-${PV}"
#	S="${WORKDIR}/${MY_P}"
	SRC_URI="https://github.com/browserpass/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
	inherit golang-vcs-snapshot
fi
inherit golang-build

DESCRIPTION="WebExtension host binary for pass, a UNIX password manager"
HOMEPAGE="https://github.com/browserpass/browserpass-native"
LICENSE="ISC"
SLOT="0"
RDEPEND="app-crypt/gnupg"
DEPEND="${RDEPEND}
	dev-go/logrus:=
	dev-go/zglob:="

src_compile() {
	golang-build_src_compile

	pushd "src/${EGO_PN}" >/dev/null || die
	sed -e 's|%%replace%%|'${EPREFIX}'/usr/libexec/browserpass-native|' \
		-i browser-files/firefox-host.json browser-files/chromium-host.json || die
	popd >/dev/null || die
}

src_install() {
	exeinto /usr/libexec
	doexe browserpass-native

	pushd "src/${EGO_PN}" >/dev/null || die
	insinto /usr/$(get_libdir)/mozilla/native-messaging-hosts
	newins browser-files/firefox-host.json com.github.browserpass.native.json

	insinto /etc/chromium/native-messaging-hosts
	newins browser-files/chromium-host.json com.github.browserpass.native.json

	insinto /etc/opt/chrome/native-messaging-hosts
	newins browser-files/chromium-host.json com.github.browserpass.native.json

	popd >/dev/null || die
}