Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/lastpass-binary-component/
Date: Wed, 12 Feb 2020 17:38:42
Message-Id: 1581529037.e536cb3322bc9fd988349e8f1dcf169b3160c85b.gokturk@gentoo
1 commit: e536cb3322bc9fd988349e8f1dcf169b3160c85b
2 Author: Lucian Poston <lucianposton <AT> pm <DOT> me>
3 AuthorDate: Wed Feb 12 10:51:41 2020 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 12 17:37:17 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e536cb33
7
8 app-admin/lastpass-binary-component: Install to both firefox dirs
9
10 Firefox's directory for native messaging hosts is a compile-time
11 variable. www-client/firefox-bin is set to a directory under /usr/lib/,
12 while www-client/firefox varies. This -r1 bump will install to both
13 locations so that both firefox and firefox-bin are able to locate the
14 plugin.
15
16 Closes: https://bugs.gentoo.org/688104
17 Closes: https://github.com/gentoo/gentoo/pull/14636
18 Bug: https://bugs.gentoo.org/687746
19 Package-Manager: Portage-2.3.84, Repoman-2.3.20
20 Signed-off-by: Lucian Poston <lucianposton <AT> pm.me>
21 Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
22
23 .../lastpass-binary-component-4.19.0-r1.ebuild | 116 +++++++++++++++++++++
24 1 file changed, 116 insertions(+)
25
26 diff --git a/app-admin/lastpass-binary-component/lastpass-binary-component-4.19.0-r1.ebuild b/app-admin/lastpass-binary-component/lastpass-binary-component-4.19.0-r1.ebuild
27 new file mode 100644
28 index 00000000000..0913632e723
29 --- /dev/null
30 +++ b/app-admin/lastpass-binary-component/lastpass-binary-component-4.19.0-r1.ebuild
31 @@ -0,0 +1,116 @@
32 +# Copyright 1999-2020 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +DESCRIPTION="Binary component required by the LastPass Password Manager browser extension"
38 +HOMEPAGE="https://helpdesk.lastpass.com/downloading-and-installing/#h5"
39 +# sadly, upstream has no versioned distfiles
40 +SRC_URI="https://download.cloud.lastpass.com/linux/lplinux.tar.bz2 -> ${P}.tar.bz2"
41 +
42 +LICENSE="LastPass"
43 +SLOT="0"
44 +KEYWORDS="-* ~amd64 ~x86"
45 +RESTRICT="bindist strip mirror" # We can't mirror it, but we can fetch it
46 +
47 +LASTPASS_EXEDIR=/opt/lastpass/
48 +
49 +QA_PREBUILT="
50 + ${LASTPASS_EXEDIR}nplastpass*
51 +"
52 +
53 +S="${WORKDIR}"
54 +
55 +src_install() {
56 + # This is based on the upstream installer script that's in the tarball
57 + bin=nplastpass
58 + use amd64 && bin="${bin}64"
59 + exeinto ${LASTPASS_EXEDIR}
60 + doexe "${S}"/${bin}
61 +
62 + # Generate the policy file for Chrome/Chromium/Opera
63 + cat >"${T}"/lastpass_policy.json <<-EOF || die
64 + {
65 + "ExtensionInstallSources": [
66 + "https://lastpass.com/*",
67 + "https://*.lastpass.com/*",
68 + "https://d1jxck0p3rkj0.cloudfront.net/lastpass/*"
69 + ]
70 + }
71 + EOF
72 + # Install the policy file for Chrome/Chromium/Opera
73 + for d in /etc/chromium /etc/opt/chrome; do
74 + insinto ${d}/policies/managed
75 + doins "${T}"/lastpass_policy.json
76 + done
77 +
78 + # Generate the app manifest for Chrome/Opera
79 + cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
80 + {
81 + "name": "com.lastpass.nplastpass",
82 + "description": "LastPass",
83 + "path": "${LASTPASS_EXEDIR}${bin}",
84 + "type": "stdio",
85 + "allowed_origins": [
86 + "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
87 + "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
88 + "chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/",
89 + "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
90 + ]
91 + }
92 + EOF
93 + # Install the app manifest for Chrome/Opera
94 + # https://developer.chrome.com/apps/nativeMessaging
95 + # https://dev.opera.com/extensions/message-passing/
96 + insinto /etc/opt/chrome/native-messaging-hosts
97 + doins "${T}"/com.lastpass.nplastpass.json
98 +
99 + # Generate the app manifest for Chromium
100 + cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
101 + {
102 + "name": "com.lastpass.nplastpass",
103 + "description": "LastPass",
104 + "path": "${LASTPASS_EXEDIR}${bin}",
105 + "type": "stdio",
106 + "allowed_origins": [
107 + "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
108 + "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
109 + "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
110 + ]
111 + }
112 + EOF
113 + # Install the app manifest for Chromium
114 + # https://developer.chrome.com/apps/nativeMessaging
115 + insinto /etc/chromium/native-messaging-hosts/
116 + doins "${T}"/com.lastpass.nplastpass.json
117 +
118 + # Generate the app manifest for Firefox
119 + cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
120 + {
121 + "name": "com.lastpass.nplastpass",
122 + "description": "LastPass",
123 + "path": "${LASTPASS_EXEDIR}${bin}",
124 + "type": "stdio",
125 + "allowed_extensions": [
126 + "support@××××××××.com"
127 + ]
128 + }
129 + EOF
130 + # Install the app manifest for both firefox and firefox-bin
131 + # https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Manifest_location
132 + insinto /usr/lib/mozilla/native-messaging-hosts/
133 + doins "${T}"/com.lastpass.nplastpass.json
134 + insinto /usr/lib64/mozilla/native-messaging-hosts/
135 + doins "${T}"/com.lastpass.nplastpass.json
136 +}
137 +
138 +pkg_postinst() {
139 + einfo "This package only installs the components required by the browser extension."
140 + einfo "Visit the links below for your browser to install the extension itself:"
141 + einfo "Chrome/Chromium: https://lastpass.com/dl/inline/?full=1"
142 + einfo "Firefox: https://lastpass.com/lastpassffx/"
143 + einfo "Opera: https://lastpass.com/dl/"
144 + einfo
145 + einfo "Chrome, Chromium and Opera users need to manually enable the binary component."
146 + einfo "For more info, visit: https://lastpass.com/support.php?cmd=showfaq&id=5576"
147 +}