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
index fd852fa..cbd8632 100644 (file)
@@ -26,7 +26,23 @@ DEPEND="|| ( www-client/firefox-bin www-client/firefox ) app-arch/unzip media-gf
 src_install(){
        local emid=$(sed -n 's/.*<em:id>\(.*\)<\/em:id>.*/\1/p' ${S}/install.rdf | head -1)
        local cleanup="NOTES Makefile install.rdf.template monkeysphere.xpi chrome/content/*.svg"
-       for i in $cleanup; do rm ${S}/$i; done; 
-       mkdir -p "${D}/opt/firefox/extensions/${emid}"
-       cp -r ${S}/* "${D}/opt/firefox/extensions/${emid}/"
+       local edir=""
+       for i in $cleanup; do rm ${S}/$i; done;
+       local extinstalldir=""
+
+       if has_version '>=www-client/firefox-bin-1.0'; then
+               einfo "Binary version of Firefox found"
+               extinstalldir="${D}/opt/firefox/extensions/${emid}  $extinstalldir"
+       fi
+
+       if has_version '>=www-client/firefox-1.0'; then
+        einfo "Source version of Firefox found"
+        extinstalldir="${D}/usr/lib64/firefox/browser/extensions/${emid}  $extinstalldir"
+    fi
+
+       
+       for i in $extinstalldir; do
+               mkdir -p "${i}"
+               cp -r ${S}/* "${i}"
+       done;
 }