Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2016 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
inherit eutils |
7 |
|
8 |
DESCRIPTION="Online password manager and form filler that makes web browsing easier and more secure" |
9 |
HOMEPAGE="https://lastpass.com/misc_download2.php" |
10 |
# sadly, upstream has no versioned distfiles |
11 |
DIST_MAIN=lplinux-${PV}.tar.bz2 |
12 |
SRC_URI="https://lastpass.com/lplinux.tar.bz2 -> ${DIST_MAIN}" |
13 |
|
14 |
LICENSE="LastPass" |
15 |
SLOT="0" |
16 |
KEYWORDS="-* ~x86 ~amd64" |
17 |
IUSE="+chromium +chrome +opera" |
18 |
RESTRICT="strip mirror" # We can't mirror it, but we can fetch it |
19 |
|
20 |
DEPEND="app-arch/unzip" |
21 |
RDEPEND=" |
22 |
chrome? ( || ( |
23 |
www-client/google-chrome |
24 |
www-client/google-chrome-beta |
25 |
www-client/google-chrome-unstable |
26 |
) ) |
27 |
chromium? ( >=www-client/chromium-32.0.1700.102 ) |
28 |
opera? ( || ( |
29 |
>=www-client/opera-35.0.2066.68 |
30 |
www-client/opera-beta |
31 |
www-client/opera-developer |
32 |
) ) |
33 |
" |
34 |
REQUIRED_USE="|| ( chrome chromium opera )" |
35 |
|
36 |
LASTPASS_EXEDIR=/opt/lastpass/ |
37 |
|
38 |
QA_PREBUILT=" |
39 |
${LASTPASS_EXEDIR}nplastpass* |
40 |
" |
41 |
|
42 |
S="${WORKDIR}/lplinux" |
43 |
|
44 |
src_install() { |
45 |
# This is based on the upstream installer script that's in the tarball |
46 |
bin=nplastpass |
47 |
use amd64 && bin="${bin}64" |
48 |
exeinto ${LASTPASS_EXEDIR} |
49 |
doexe "${S}"/$bin |
50 |
|
51 |
cat >"${T}"/lastpass_policy.json <<-EOF || die |
52 |
{ |
53 |
"ExtensionInstallSources": [ |
54 |
"https://lastpass.com/*", |
55 |
"https://*.lastpass.com/*", |
56 |
"https://d1jxck0p3rkj0.cloudfront.net/lastpass/*" |
57 |
] |
58 |
} |
59 |
EOF |
60 |
cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die |
61 |
{ |
62 |
"name": "com.lastpass.nplastpass", |
63 |
"description": "LastPass", |
64 |
"path": "${LASTPASS_EXEDIR}/$bin", |
65 |
"type": "stdio", |
66 |
"allowed_origins": [ |
67 |
"chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/", |
68 |
"chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/", |
69 |
"chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/", |
70 |
"chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/" |
71 |
] |
72 |
} |
73 |
EOF |
74 |
|
75 |
local mydirs=( ) |
76 |
use chromium && mydirs+=( /etc/chromium ) |
77 |
use chrome || use opera && mydirs+=( /etc/opt/chrome ) |
78 |
for d in ${mydirs[@]}; do |
79 |
insinto ${d}/policies/managed |
80 |
doins "${T}"/lastpass_policy.json |
81 |
insinto ${d}/native-messaging-hosts |
82 |
doins "${T}"/com.lastpass.nplastpass.json |
83 |
done |
84 |
|
85 |
} |
86 |
|
87 |
pkg_postinst() { |
88 |
einfo "This package only installs the binary plugins needed by the extension." |
89 |
einfo "Visit the link(s) below for your browser to install the extension itself:" |
90 |
use chrome || use chromium && einfo $'\t'"Chrome/Chromium: https://lastpass.com/dl/inline/?full=1" |
91 |
use opera && einfo $'\t'"Opera: https://lastpass.com/dl/" |
92 |
} |