Add CCDump to extensions list user/tsbere/ccdump
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 28 Jan 2013 20:10:21 +0000 (15:10 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Mon, 28 Jan 2013 20:10:21 +0000 (15:10 -0500)
This includes tweaking the install.rdf file.

In this case we cheat by hijacking the Firefox entry for the toolkit.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/Makefile.am

index 2e165a6..1664dd6 100644 (file)
@@ -24,6 +24,8 @@ DOMINSPECTOR_URL=https://addons.mozilla.org/firefox/downloads/latest/6622/addon-
 DOMINSPECTOR_ID=inspector@mozilla.org
 VENKMAN_URL=https://addons.mozilla.org/firefox/downloads/latest/216/addon-216-latest.xpi
 VENKMAN_ID={f13b157f-b174-47e7-a34d-4815ddfdfeb8}
+CCDUMP_URL=https://addons.mozilla.org/firefox/downloads/latest/363814/addon-363814-latest.xpi
+CCDUMP_ID=ccdump@getfirebug.com
 
 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
 CHROME_LOCALES = $$(ls -1 chrome/locale)
@@ -242,6 +244,7 @@ client_app: client_dir
 # Note: XULRunner before 4 requires extracted extensions
 # XULRunner after 4 keeps them in XPI form...unless their manifest says to unpack
 # This block is thus structured to make it easy to add the latter kind later.
+# CCDUMP doesn't seem to support earlier versions, so it only gets grabbed for post-4
        @if [ ${XULRUNNER_MAJOR_VERSION} -lt 4 ]; then \
                if [ -f extensions/${DOMINSPECTOR_ID}.xpi ]; then \
                        mkdir -p client/extensions/${DOMINSPECTOR_ID}/; \
@@ -258,6 +261,9 @@ client_app: client_dir
                if [ -f extensions/${VENKMAN_ID}.xpi ]; then \
                        cp extensions/${VENKMAN_ID}.xpi client/extensions/; \
                fi; \
+               if [ -f extensions/${CCDUMP_ID}.xpi ]; then \
+                       cp extensions/${CCDUMP_ID}.xpi client/extensions/; \
+               fi; \
        fi
 
 # If automatic updates are enabled, or the standalone_xul_app.js is present,
@@ -287,7 +293,7 @@ extension: client_ext
 # Fetch extensions to load into the client
 # This could be done in a "if they aren't there" fashion, but these are manually triggered anyway
 # That, and this way you can update the extensions by running this target again
-fetch-extensions: fetch-dom-inspector fetch-venkman
+fetch-extensions: fetch-dom-inspector fetch-venkman fetch-ccdump
 
 fetch-dom-inspector:
        @echo 'Fetching DOM Inspector'
@@ -299,6 +305,20 @@ fetch-venkman:
        @mkdir -p extensions/
        @wget -Oextensions/${VENKMAN_ID}.xpi ${VENKMAN_URL}
 
+fetch-ccdump:
+       @echo 'Fetching CCDump'
+       @mkdir -p extensions/
+       @wget -Oextensions/${CCDUMP_ID}.xpi ${CCDUMP_URL}
+       @echo 'Prepping CCDump'
+       @cd extensions; unzip ${CCDUMP_ID}.xpi install.rdf; \
+       mv install.rdf install.rdf.orig; \
+       sed -e '/Firefox/,/\/em:targetApplication/ s/<em:id>[^<]*<\/em:id>/<em:id>toolkit@mozilla.org<\/em:id>/' \
+               -e '/Firefox/,/\/em:targetApplication/ s/<em:maxVersion>[^<]*<\/em:maxVersion>/<em:maxVersion>${XULRUNNER_VERSION}<\/em:maxVersion>/' \
+               install.rdf.orig > install.rdf; \
+       zip ${CCDUMP_ID}.xpi install.rdf; \
+       rm install.rdf*;
+       @rm -rf ${CCDUMP_ID}*
+
 # Generic client, as an xpi, theoretically suitable for --install-app usage
 
 generic-client: client_app