# Maintainer: Det pkgname=lastpass pkgver=2.0.25 _chromver=2.0.25-1 # The actual extensions' versions _ffver=2.0.26-1 _opver=2.0.25-1 pkgrel=1 pkgdesc="The Universal LastPass installer for Firefox, Chrome, and Opera" arch=('any') url="https://lastpass.com" license=('custom') makedepends=('unzip') optdepends=('chromium: for Chromium' 'chromium-dev: for Chromium (Dev Channel) (AUR)' 'firefox: for Mozilla Firefox' 'firefox-beta-bin: for Mozilla Firefox (Beta) (AUR)' 'firefox-nightly: for Mozilla Firefox (Nightly) (AUR)' 'google-chrome: for Google Chrome (AUR)' 'google-chrome-beta: for Google Chrome (Beta Channel) (AUR)' 'google-chrome-dev: for Google Chrome (Dev Channel) (AUR)' 'opera: for Opera' 'opera-next: for Opera Next (AUR)') conflicts=('lastpass-plugin-opera' 'lastpass-universal') provides=('lastpass-universal') install=${pkgname}.install #source=("$url/lplinux.tar.bz2") # Let's do this a bit more efficiently for now source=(# Chrome "lpchrome_linux_${_chromver}.crx::$url/lpchrome_linux.crx" # Firefox "lp_linux_${_ffver}.xpi::$url/lp_linux.xpi" 'profiles.ini' # Opera "lastpass-${_opver}.oex::$url/lpopera.oex" 'prefs.dat' 'widgets.dat') noextract=("lp_linux_${_ffver}.xpi" "lastpass-${_opver}.oex") md5sums=('132ed9bd99ed5720f17720bec8282368' # lpchrome_linux_${_chromver}.crx '00c0554e3852062d4bb03a4b6868c7ee' # lp_linux_${_ffver}.xpi '08f0ef46608ca1811029e43ef0650790' # profiles.ini 'e7c7f3f54ecfc96ca874e78f33fb62b3' # lastpass-${_opver}.oex '45733a855b9d2f0b507d6ed67b79d395' # prefs.dat '92a87534f8c36a3e21ed128163b98945') # widgets.dat sha256sums=('1b69e71caef9f6a6dc23d05ba8534b0454044a6596190fec56751541800a31e2' # lpchrome_linux_${_chromver}.crx '7594883f23ba97f4c10bc8eadfa122412ac1558d0c6535fe5103285bc1f33d07' # lp_linux_${_ffver}.xpi '5c93d69fe5910338648cfa397e2bf66d189d3fbc1aad06a4374311152312720d' # profiles.ini 'c117c0c8e7a1e8154088f65564d62d245e960a98e475cb14f2431dd6a75aa73a' # lastpass-${_opver}.oex 'a583240d5d337ddd89e20218d0b871f48e7d845926621e2d46fa9dce351e84e5' # prefs.dat 'e651c4aecf834b4db60b103cf2810c22296fd10da3b8eaae3dea064e8a91dd7c') # widgets.dat prepare() { # Since we're installing to $HOME in .install, we need checks such as this to # see whether some clever guy is building with --asroot if [ $USER = root ]; then msg2 "NOTE: Makepkg is running as root. Most files will be installed to /root." read -p "$(tput bold)$(tput setaf 4) ->$(tput sgr0)$(tput bold) Continue? (Y/n) $(tput sgr0)" [[ $REPLY != [yY] ]] && error "Aborted by user! Exiting..." && echo && exit 1 fi # Write the extension versions and the $USER to the .install sed -e "s/_ffver= *[^ ]*/_ffver=${_ffver}/" \ -e "s/_opver=2.0.25-1/_opver=${_opver}/" \ -e "s/_user= *[^ ]*/_user=$USER/" \ -i ${startdir}/${pkgname}.install } _chrome_package() { # This returns a warning about the extra bytes so redirect to /dev/null instead and use the || operator unzip -o lpchrome_linux_$_chromver.crx -d lpchrome &>/dev/null || true # Install to a single place and just link it for everybody else CRX=/usr/share/lastpass/lpchrome.crx JSON=hdokiejnpimakedhajhdlcegeplioahd.json echo "{ \"external_crx\": \"$CRX\", \"external_version\": \"${_chromver/-*}\" }" > $JSON for i in opt/google/chrome usr/share/chromium usr/share/chromium-dev; do install -Dm644 $JSON "$pkgdir"/$i/extensions/$JSON done install -Dm644 lpchrome_linux_$_chromver.crx "$pkgdir"/$CRX # Allow silent installation since Chrome 21: http://www.chromium.org/administrators/policy-list-3#ExtensionInstallSources echo "{ \"ExtensionInstallSources\": [\"$url/*\", \"https://*.lastpass.com/*\"] }" > lastpass_policy.json for i in opt/chrome chromium chromium-dev; do install -Dm644 lastpass_policy.json "$pkgdir"/etc/$i/policies/managed/lastpass_policy.json done } _firefox_package() { # The extension and the profiles.ini go to $HOME so do this in the .install for i in lp_linux_$_ffver.xpi profiles.ini; do install -Dm644 $i "$pkgdir"/usr/share/lastpass/$i done } _opera_package() { # Same for Operas and their settings install -m644 lastpass-$_opver.oex {pref,widget}s.dat "$pkgdir"/usr/share/lastpass/ # The binary plugin [ "$CARCH" = 'x86_64' ] && _64=64 for i in opera opera-next; do install -Dm644 lpchrome/libnplastpass$_64.so "$pkgdir"/usr/lib/$i/plugins/libnplastpass$_64.so done } package() { msg2 "Installing for Google Chromes/Chromiums" _chrome_package msg2 "Installing for Mozilla Firefoxes" _firefox_package msg2 "Installing for Operas" _opera_package } # vim:set ts=2 sw=2 et: