app-crypt/xul-ext-monkeysphere: use
[portage-overlay.git] / app-crypt / xul-ext-monkeysphere / xul-ext-monkeysphere-0.8.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6
7 inherit eutils
8
9 DESCRIPTION="Iceweasel/Firefox extension for using Monkeysphere on the web"
10 HOMEPAGE="http://web.monkeysphere.info/"
11
12 SRC_URI="http://archive.monkeysphere.info/debian/pool/monkeysphere/x/xul-ext-monkeysphere/xul-ext-monkeysphere_${PV}.orig.tar.gz"
13
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE=""
18
19 BDEPEND="media-gfx/inkscape"
20 RDEPEND="app-crypt/msva-perl"
21 DEPEND="|| ( www-client/firefox-bin www-client/firefox )"
22
23 src_install(){
24         local emid=$(sed -n 's/.*<em:id>\(.*\)<\/em:id>.*/\1/p' ${S}/install.rdf | head -1)
25         local cleanup=( NOTES Changelog Makefile install.rdf.template monkeysphere.xpi chrome/content/bad.svg  chrome/content/broken.svg  chrome/content/error.svg )
26
27         # Delete files not to be installed from $S
28         for i in "${cleanup[@]}"; do rm "${S}/$i"; done;
29
30         local extinstalldir=()
31
32         if has_version '>=www-client/firefox-bin-1.0'; then
33                 einfo "Binary version of Firefox found"
34                 extinstalldir+=/$(get_libdir)/firefox/extensions/${emid}
35         fi
36
37         if has_version '>=www-client/firefox-1.0'; then
38                 einfo "Source version of Firefox found"
39                 extinstalldir+=/usr/$(get_libdir)/firefox/browser/extensions/${emid}
40         fi
41
42         for i in "${extinstalldir[@]}"; do
43                 dodir "${i}"
44                 insinto "${i}"
45                 doins -r "${S}"/*
46         done;
47 }