lastpass-binary-component-4.1.2.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. DESCRIPTION="Binary component required by the LastPass Password Manager browser extension"
  5. HOMEPAGE="https://helpdesk.lastpass.com/downloading-and-installing/#h5"
  6. # sadly, upstream has no versioned distfiles
  7. SRC_URI="https://lastpass.com/lplinux.tar.bz2 -> ${P}.tar.bz2"
  8. LICENSE="LastPass"
  9. SLOT="0"
  10. KEYWORDS="-* ~x86 ~amd64"
  11. RESTRICT="strip mirror" # We can't mirror it, but we can fetch it
  12. RDEPEND="
  13. !!app-admin/lastpass
  14. "
  15. LASTPASS_EXEDIR=/opt/lastpass/
  16. QA_PREBUILT="
  17. ${LASTPASS_EXEDIR}nplastpass*
  18. "
  19. S="${WORKDIR}/lplinux"
  20. src_install() {
  21. # This is based on the upstream installer script that's in the tarball
  22. bin=nplastpass
  23. use amd64 && bin="${bin}64"
  24. exeinto ${LASTPASS_EXEDIR}
  25. doexe "${S}"/${bin}
  26. cat >"${T}"/lastpass_policy.json <<-EOF || die
  27. {
  28. "ExtensionInstallSources": [
  29. "https://lastpass.com/*",
  30. "https://*.lastpass.com/*",
  31. "https://d1jxck0p3rkj0.cloudfront.net/lastpass/*"
  32. ]
  33. }
  34. EOF
  35. cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
  36. {
  37. "name": "com.lastpass.nplastpass",
  38. "description": "LastPass",
  39. "path": "${LASTPASS_EXEDIR}${bin}",
  40. "type": "stdio",
  41. "allowed_origins": [
  42. "chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
  43. "chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
  44. "chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/",
  45. "chrome-extension://hgnkdfamjgnljokmokheijphenjjhkjc/"
  46. ]
  47. }
  48. EOF
  49. for d in /etc/chromium /etc/opt/chrome; do
  50. insinto ${d}/policies/managed
  51. doins "${T}"/lastpass_policy.json
  52. insinto ${d}/native-messaging-hosts
  53. doins "${T}"/com.lastpass.nplastpass.json
  54. done
  55. }
  56. pkg_postinst() {
  57. einfo "This package only installs the components required by the browser extension."
  58. einfo "Visit the links below for your browser to install the extension itself:"
  59. einfo "Chrome/Chromium: https://lastpass.com/dl/inline/?full=1"
  60. einfo "Opera: https://lastpass.com/dl/"
  61. }