xfce-base/exo: Disable GTK+2 support in -r100
[gentoo.git] / app-admin / lastpass-binary-component / lastpass-binary-component-4.19.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 DESCRIPTION="Binary component required by the LastPass Password Manager browser extension"
7 HOMEPAGE="https://helpdesk.lastpass.com/downloading-and-installing/#h5"
8 # sadly, upstream has no versioned distfiles
9 SRC_URI="https://download.cloud.lastpass.com/linux/lplinux.tar.bz2 -> ${P}.tar.bz2"
10
11 LICENSE="LastPass"
12 SLOT="0"
13 KEYWORDS="-* ~amd64 ~x86"
14 RESTRICT="strip mirror" # We can't mirror it, but we can fetch it
15
16 LASTPASS_EXEDIR=/opt/lastpass/
17
18 QA_PREBUILT="
19         ${LASTPASS_EXEDIR}nplastpass*
20 "
21
22 S="${WORKDIR}"
23
24 src_install() {
25         # This is based on the upstream installer script that's in the tarball
26         bin=nplastpass
27         use amd64 && bin="${bin}64"
28         exeinto ${LASTPASS_EXEDIR}
29         doexe "${S}"/${bin}
30
31         # Generate the policy file for Chrome/Chromium/Opera
32         cat >"${T}"/lastpass_policy.json <<-EOF || die
33         {
34                 "ExtensionInstallSources": [
35                         "https://lastpass.com/*",
36                         "https://*.lastpass.com/*",
37                         "https://d1jxck0p3rkj0.cloudfront.net/lastpass/*"
38                 ]
39         }
40         EOF
41         # Install the policy file for Chrome/Chromium/Opera
42         for d in /etc/chromium /etc/opt/chrome; do
43                 insinto ${d}/policies/managed
44                 doins "${T}"/lastpass_policy.json
45         done
46
47         # Generate the app manifest for Chrome/Opera
48         cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
49         {
50                 "name": "com.lastpass.nplastpass",
51                 "description": "LastPass",
52                 "path": "${LASTPASS_EXEDIR}${bin}",
53                 "type": "stdio",
54                 "allowed_origins": [
55                         "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
56                         "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
57                         "chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/",
58                         "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
59                 ]
60         }
61         EOF
62         # Install the app manifest for Chrome/Opera
63         # https://developer.chrome.com/apps/nativeMessaging
64         # https://dev.opera.com/extensions/message-passing/
65         insinto /etc/opt/chrome/native-messaging-hosts
66         doins "${T}"/com.lastpass.nplastpass.json
67
68         # Generate the app manifest for Chromium
69         cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
70         {
71                 "name": "com.lastpass.nplastpass",
72                 "description": "LastPass",
73                 "path": "${LASTPASS_EXEDIR}${bin}",
74                 "type": "stdio",
75                 "allowed_origins": [
76                         "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
77                         "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
78                         "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
79                 ]
80         }
81         EOF
82         # Install the app manifest for Chromium
83         # https://developer.chrome.com/apps/nativeMessaging
84         insinto /etc/chromium/native-messaging-hosts/
85         doins "${T}"/com.lastpass.nplastpass.json
86
87         # Generate the app manifest for Firefox
88         cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
89         {
90                 "name": "com.lastpass.nplastpass",
91                 "description": "LastPass",
92                 "path": "${LASTPASS_EXEDIR}${bin}",
93                 "type": "stdio",
94                 "allowed_extensions": [
95                         "support@lastpass.com"
96                 ]
97         }
98         EOF
99         # Install the app manifest for Firefox
100         # https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Manifest_location
101         insinto /usr/lib/mozilla/native-messaging-hosts/
102         doins "${T}"/com.lastpass.nplastpass.json
103 }
104
105 pkg_postinst() {
106         einfo "This package only installs the components required by the browser extension."
107         einfo "Visit the links below for your browser to install the extension itself:"
108         einfo "Chrome/Chromium: https://lastpass.com/dl/inline/?full=1"
109         einfo "Firefox: https://lastpass.com/lastpassffx/"
110         einfo "Opera: https://lastpass.com/dl/"
111         einfo
112         einfo "Chrome, Chromium and Opera users need to manually enable the binary component."
113         einfo "For more info, visit: https://lastpass.com/support.php?cmd=showfaq&id=5576"
114 }