app-crypt/xul-ext-monkeysphere: make cleanup an array
[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 DEPEND="|| ( www-client/firefox-bin www-client/firefox ) "
21
22 RDEPEND="app-crypt/msva-perl ${DEPEND}"
23
24 src_install(){
25         local emid=$(sed -n 's/.*<em:id>\(.*\)<\/em:id>.*/\1/p' ${S}/install.rdf | head -1)
26         local cleanup=( NOTES Makefile install.rdf.template monkeysphere.xpi chrome/content/*.svg )
27         local edir=""
28         for i in "${cleanup[@]}"; do rm "${S}/$i"; done;
29         local extinstalldir=""
30
31         if has_version '>=www-client/firefox-bin-1.0'; then
32                 einfo "Binary version of Firefox found"
33                 extinstalldir="/opt/firefox/extensions/${emid}  $extinstalldir"
34         fi
35
36         if has_version '>=www-client/firefox-1.0'; then
37                 einfo "Source version of Firefox found"
38                 extinstalldir="/usr/lib/firefox/browser/extensions/${emid}  $extinstalldir"
39         fi
40
41         for i in $extinstalldir; do
42                 dodir "${i}"
43                 insinto "${i}"
44                 doins "${S}"/*
45         done;
46 }