You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.2 KiB
110 lines
3.2 KiB
9 years ago
|
# Copyright 1999-2015 Gentoo Foundation
|
||
10 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
9 years ago
|
# $Id$
|
||
10 years ago
|
|
||
|
EAPI=5
|
||
|
inherit eutils
|
||
|
|
||
|
DESCRIPTION="Online password manager and form filler that makes web browsing easier and more secure"
|
||
|
HOMEPAGE="https://lastpass.com/misc_download2.php"
|
||
|
# sadly, upstream has no versioned distfiles
|
||
9 years ago
|
DIST_MAIN=lplinux-${PV}.tar.bz2
|
||
|
DIST_CRX=lpchrome_linux-${PV}.crx # Use by both firefox+chrome/chromimum code
|
||
|
DIST_XPI=lp_linux-${PV}.xpi
|
||
10 years ago
|
SRC_URI="
|
||
9 years ago
|
https://lastpass.com/lplinux.tar.bz2 -> ${DIST_MAIN}
|
||
|
https://lastpass.com/lpchrome_linux.crx -> ${DIST_CRX}
|
||
|
firefox? ( https://lastpass.com/lp_linux.xpi -> ${DIST_XPI} )"
|
||
10 years ago
|
|
||
|
LICENSE="LastPass"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="-* ~x86 ~amd64"
|
||
|
IUSE="+chromium +firefox +chrome"
|
||
|
RESTRICT="strip mirror" # We can't mirror it, but we can fetch it
|
||
|
|
||
9 years ago
|
DEPEND="app-arch/unzip"
|
||
10 years ago
|
RDEPEND="
|
||
10 years ago
|
chrome? ( || (
|
||
10 years ago
|
www-client/google-chrome
|
||
|
www-client/google-chrome-beta
|
||
10 years ago
|
www-client/google-chrome-unstable
|
||
10 years ago
|
) )
|
||
|
chromium? ( >=www-client/chromium-32.0.1700.102 )
|
||
|
firefox? ( www-client/firefox )"
|
||
|
REQUIRED_USE="|| ( firefox chromium chrome )"
|
||
|
|
||
|
LASTPASS_EXEDIR=/opt/lastpass/
|
||
|
|
||
|
QA_PREBUILT="
|
||
10 years ago
|
${LASTPASS_EXEDIR}nplastpass*
|
||
|
/usr/lib*/nsbrowser/plugins/libnplastpass*.so
|
||
|
/usr/lib*/firefox/browser/extensions/support@lastpass.com/platform/Linux_x86_64-gcc3/components/lpxpcom_x86_64.so
|
||
|
/usr/lib*/firefox/browser/extensions/support@lastpass.com/platform/Linux_x86-gcc3/components/lpxpcom.so
|
||
10 years ago
|
"
|
||
|
|
||
|
S="${WORKDIR}"
|
||
|
|
||
|
src_unpack() {
|
||
9 years ago
|
unpack ${DIST_MAIN}
|
||
10 years ago
|
mkdir -p "${S}"/crx || die
|
||
10 years ago
|
# bug #524864: strip Chrome CRX header
|
||
|
# otherwise the unzip warning can be fatal in some cases
|
||
9 years ago
|
dd bs=306 skip=1 if="${DISTDIR}"/${DIST_CRX} of="${T}"/lpchrome_linux.zip 2>/dev/null || die
|
||
10 years ago
|
unzip -qq -o "${T}"/lpchrome_linux.zip -d "${S}"/crx || die
|
||
10 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
# This is based on the upstream installer script that's in the tarball
|
||
|
bin=nplastpass
|
||
|
use amd64 && bin="${bin}64"
|
||
|
exeinto ${LASTPASS_EXEDIR}
|
||
|
doexe "${S}"/$bin
|
||
|
|
||
|
# despite the name, this piece seems used by both firefox+chrome
|
||
|
exeinto /usr/$(get_libdir)/nsbrowser/plugins
|
||
|
doexe "${S}"/crx/lib${bin}.so
|
||
|
|
||
9 years ago
|
cat >"${T}"/lastpass_policy.json <<-EOF || die
|
||
10 years ago
|
{
|
||
10 years ago
|
"ExtensionInstallSources": [
|
||
10 years ago
|
"https://lastpass.com/*",
|
||
|
"https://*.lastpass.com/*",
|
||
10 years ago
|
"https://*.cloudfront.net/lastpass/*"
|
||
10 years ago
|
]
|
||
10 years ago
|
}
|
||
|
EOF
|
||
9 years ago
|
cat >"${T}"/com.lastpass.nplastpass.json <<-EOF || die
|
||
10 years ago
|
{
|
||
|
"name": "com.lastpass.nplastpass",
|
||
|
"description": "LastPass",
|
||
|
"path": "${LASTPASS_EXEDIR}/$bin",
|
||
|
"type": "stdio",
|
||
|
"allowed_origins": [
|
||
|
"chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/",
|
||
|
"chrome-extension://debgaelkhoipmbjnhpoblmbacnmmgbeg/",
|
||
|
"chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/"
|
||
|
]
|
||
10 years ago
|
}
|
||
|
EOF
|
||
|
|
||
9 years ago
|
for d in \
|
||
|
$(usex chromium /etc/chromium '') \
|
||
|
$(usex chrome /etc/opt/chrome '') \
|
||
|
; do
|
||
|
insinto ${d}/policies/managed
|
||
10 years ago
|
doins "${T}"/lastpass_policy.json
|
||
9 years ago
|
insinto ${d}/native-messaging-hosts
|
||
10 years ago
|
doins "${T}"/com.lastpass.nplastpass.json
|
||
9 years ago
|
done
|
||
10 years ago
|
|
||
|
if use firefox; then
|
||
|
d="$D/usr/$(get_libdir)/firefox/browser/extensions/support@lastpass.com"
|
||
10 years ago
|
mkdir -p $d || die
|
||
9 years ago
|
unzip -qq -o "${DISTDIR}/${DIST_XPI}" -d "$d" || die
|
||
10 years ago
|
fi
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
einfo "Visit https://lastpass.com/dl/inline/?full=1 to finish installing for Chrome/Chromium/Firefox"
|
||
|
}
|