${LASTPASS_EXEDIR}nplastpass*
"
-S="${WORKDIR}/lplinux"
+S="${WORKDIR}"
src_install() {
# This is based on the upstream installer script that's in the tarball
exeinto ${LASTPASS_EXEDIR}
doexe "${S}"/${bin}
+ # Generate the policy file for Chrome/Chromium/Opera
cat >"${T}"/lastpass_policy.json <<-EOF || die
{
"ExtensionInstallSources": [
]
}
EOF
+ # Install the policy file for Chrome/Chromium/Opera
+ for d in /etc/chromium /etc/opt/chrome; do
+ insinto ${d}/policies/managed
+ doins "${T}"/lastpass_policy.json
+ done
+
+ # Generate the app manifest for Chrome/Opera
cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
{
"name": "com.lastpass.nplastpass",
]
}
EOF
+ # Install the app manifest for Chrome/Opera
+ # https://developer.chrome.com/apps/nativeMessaging
+ # https://dev.opera.com/extensions/message-passing/
+ insinto /etc/opt/chrome/native-messaging-hosts
+ doins "${T}"/com.lastpass.nplastpass.json
- for d in /etc/chromium /etc/opt/chrome; do
- insinto ${d}/policies/managed
- doins "${T}"/lastpass_policy.json
- insinto ${d}/native-messaging-hosts
- doins "${T}"/com.lastpass.nplastpass.json
- done
+ # Generate the app manifest for Chromium
+ cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
+ {
+ "name": "com.lastpass.nplastpass",
+ "description": "LastPass",
+ "path": "${LASTPASS_EXEDIR}${bin}",
+ "type": "stdio",
+ "allowed_origins": [
+ "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
+ "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
+ "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
+ ]
+ }
+ EOF
+ # Install the app manifest for Chromium
+ # https://developer.chrome.com/apps/nativeMessaging
+ insinto /etc/chromium/native-messaging-hosts/
+ doins "${T}"/com.lastpass.nplastpass.json
+ # Generate the app manifest for Firefox
+ cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
+ {
+ "name": "com.lastpass.nplastpass",
+ "description": "LastPass",
+ "path": "${LASTPASS_EXEDIR}${bin}",
+ "type": "stdio",
+ "allowed_extensions": [
+ "support@lastpass.com"
+ ]
+ }
+ EOF
+ # Install the app manifest for Firefox
+ # https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Manifest_location
+ insinto /usr/lib/mozilla/native-messaging-hosts/
+ doins "${T}"/com.lastpass.nplastpass.json
}
pkg_postinst() {
einfo "This package only installs the components required by the browser extension."
einfo "Visit the links below for your browser to install the extension itself:"
einfo "Chrome/Chromium: https://lastpass.com/dl/inline/?full=1"
+ einfo "Firefox: https://lastpass.com/lastpassffx/"
einfo "Opera: https://lastpass.com/dl/"
+ einfo
+ einfo "Chrome, Chromium and Opera users need to manually enable the binary component."
+ einfo "For more info, visit: https://lastpass.com/support.php?cmd=showfaq&id=5576"
}