Advertisement
Guest User

Lastpass 3.1.95 PKGBUILD

a guest
Jun 2nd, 2015
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.14 KB | None | 0 0
  1. # Maintainer: Det <nimetonmaili g-mail>
  2.  
  3. pkgname=lastpass
  4. pkgver=3.1.95
  5. _universal=$pkgver-2 # Version of the universal installer: https://lastpass.com/misc_download2.php
  6. _chromver=3.2.7-1    # The actual extensions' versions
  7. _ffver=3.1.95-2
  8. pkgrel=7
  9. pkgdesc="The Universal LastPass installer for Firefox, Chrome, and Opera"
  10. arch=('i686' 'x86_64')
  11. url="https://lastpass.com"
  12. license=('custom')
  13. depends=('libxcb')
  14. optdepends=('chromium: for Chromium'
  15.             'chromium-dev: for Chromium (Dev Channel) (AUR)'
  16.             'firefox: for Mozilla Firefox'
  17.             'firefox-beta-bin: for Mozilla Firefox (Beta) (AUR)'
  18.             'firefox-nightly: for Mozilla Firefox (Nightly) (AUR)'
  19.             'google-chrome: for Google Chrome (AUR)'
  20.             'google-chrome-beta: for Google Chrome (Beta Channel) (AUR)'
  21.             'google-chrome-dev: for Google Chrome (Dev Channel) (AUR)'
  22.             'opera: for Opera'
  23.             'opera-beta: for Opera Beta (AUR)'
  24.             'opera-developer: for Opera Developer (AUR)')
  25. install=$pkgname.install
  26. source=(# Chrome
  27.         "lpchrome_linux_$_chromver.crx::$url/lpchrome_linux.crx"
  28.         "lplinux_$_universal.tar.bz2::$url/lplinux.tar.bz2"
  29.         'com.lastpass.nplastpass.json'
  30.         'lastpass_policy.json'
  31.         # Firefox
  32.         "lp_linux_$_ffver.xpi::$url/lp_linux.xpi"
  33.         'profiles.ini')
  34. noextract=("lp_linux_$_ffver.xpi")
  35. md5sums=('3b35243135d97f559df33ff291578e7a'
  36.          '560746ff6a325200de014a0a599a69bb'
  37.          '151251e415bccdffc1dc0df592d1d7e1'
  38.          '9af777d2eea8e67ad332235718a7653d'
  39.          'c3a18d917ce157ee0d0932c2acccaf7d'
  40.          'd0f555a644484baccf649f7969794ece')
  41.  
  42. # 64-bit?
  43. if [[ $CARCH = x86_64 ]]; then
  44.     _64=64
  45. fi
  46.  
  47. prepare() {
  48.     # Write user var to .install
  49.     sed -i "s/_user=[^ ]*/_user=$USER/" "$startdir"/$pkgname.install
  50. }
  51.  
  52. _chrome_package() {
  53.     # Install to single place for linking
  54.     install -Dm644 lpchrome_linux_$_chromver.crx "$pkgdir"/usr/share/lastpass/lpchrome_linux_$_chromver.crx
  55.     install -Dm755 nplastpass$_64 "$pkgdir"/etc/opt/chrome/native-messaging-hosts/nplastpass$_64
  56.  
  57.     # 64-bit?
  58.     sed "s|/nplastpass|/nplastpass$_64|" \
  59.         -i com.lastpass.nplastpass.json
  60.  
  61.     # JSONs
  62.     for i in opt/chrome chromium chromium-dev; do
  63.         # Messaging host
  64.         install -Dm644 com.lastpass.nplastpass.json "$pkgdir"/etc/$i/native-messaging-hosts/com.lastpass.nplastpass.json
  65.  
  66.         # Allow silent installation since Chrome v21: http://www.chromium.org/administrators/policy-list-3#ExtensionInstallSources
  67.         install -Dm644 lastpass_policy.json "$pkgdir"/etc/$i/policies/managed/lastpass_policy.json
  68.     done
  69. }
  70.  
  71. _firefox_package() {
  72.     # Extension + profiles.ini go to $HOME, so do this in .install
  73.     for i in lp_linux_$_ffver.xpi profiles.ini; do
  74.         install -Dm644 $i "$pkgdir"/usr/share/lastpass/$i
  75.     done
  76.  
  77.     # Binary plugin
  78.     install -Dm755 libnplastpass$_64.so "$pkgdir"/usr/lib/mozilla/plugins/libnplastpass$_64.so
  79. }
  80.  
  81. package() {
  82.     msg2 "Installing for Google Chromes/Chromiums..."
  83.     _chrome_package
  84.  
  85.     msg2 "Installing for Mozilla Firefoxes..."
  86.     _firefox_package
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement