Clean up xul-ext-monkeysphere extension and add support for source build of firefox
[portage-overlay.git] / app-crypt / xul-ext-monkeysphere / xul-ext-monkeysphere-0.8.ebuild
1 EAPI=5
2
3 inherit base eutils
4
5 DESCRIPTION="Iceweasel/Firefox extension for using Monkeysphere on the web"
6 HOMEPAGE="http://web.monkeysphere.info/"
7
8 if [[ ${PV} == "9999" ]] ; then
9     inherit git-2
10     EGIT_BRANCH="master"
11     EGIT_REPO_URI="git://git.monkeysphere.info/${PN}"
12     SRC_URI=""
13 else
14     SRC_URI="http://archive.monkeysphere.info/debian/pool/monkeysphere/x/xul-ext-monkeysphere/${PN}_${PV}.orig.tar.gz"
15 fi
16
17
18 LICENSE="GPL-3"
19 SLOT="0"
20 KEYWORDS="~amd64 ~x86"
21 IUSE=""
22
23 RDEPEND="app-crypt/msva-perl"
24 DEPEND="|| ( www-client/firefox-bin www-client/firefox ) app-arch/unzip media-gfx/inkscape"
25
26 src_install(){
27         local emid=$(sed -n 's/.*<em:id>\(.*\)<\/em:id>.*/\1/p' ${S}/install.rdf | head -1)
28         local cleanup="NOTES Makefile install.rdf.template monkeysphere.xpi chrome/content/*.svg"
29         local edir=""
30         for i in $cleanup; do rm ${S}/$i; done;
31         local extinstalldir=""
32
33         if has_version '>=www-client/firefox-bin-1.0'; then
34                 einfo "Binary version of Firefox found"
35                 extinstalldir="${D}/opt/firefox/extensions/${emid}  $extinstalldir"
36         fi
37
38         if has_version '>=www-client/firefox-1.0'; then
39         einfo "Source version of Firefox found"
40         extinstalldir="${D}/usr/lib64/firefox/browser/extensions/${emid}  $extinstalldir"
41     fi
42
43         
44         for i in $extinstalldir; do
45                 mkdir -p "${i}"
46                 cp -r ${S}/* "${i}"
47         done;
48 }