Commits

offbyone committed 0da41a5

Makefile added

Comments (0)

Files changed (3)

+SED = gsed
+CHROME = /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
+VERSION = 1.0.2
+
+APPLICATION_NAME=mefi-navigator
+
+all: $(APPLICATION_NAME)-$(VERSION).crx updates.xml
+
+
+
+$(APPLICATION_NAME)-$(VERSION).crx: script.js manifest.json
+	[ -d $(APPLICATION_NAME) ] && rm -rf $(APPLICATION_NAME) || true
+	mkdir $(APPLICATION_NAME)
+	cp manifest.json $$($(SED) -n -e 's/.*: [[ ]*"\([^ ]*\.\(png\|html\|js\)\)".*$$/\1/p' manifest.json) $(APPLICATION_NAME)
+	$(CHROME) --pack-extension=$(APPLICATION_NAME) --pack-extension-key=$(APPLICATION_NAME).pem
+	rm -Rf $(APPLICATION_NAME)
+	cp $(APPLICATION_NAME).crx $@
+
+updates.xml: Makefile
+	$(SED) -n -e 's/@VERSION@/$(VERSION)/g' -e 's/^##UP //p' $< > $@
+##UP <?xml version='1.0' encoding='UTF-8'?>
+##UP <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
+##UP   <app appid='anadfmbemnidomdljfcdgdoomhghoclk'>
+##UP      <updatecheck
+##UP         codebase='http://cdn.bitbucket.org/m.23/flv_download/downloads/flv_download_@VERSION@.crx' version='@VERSION@' />
+##UP   </app>
+##UP </gupdate>
+
+manifest.json: manifest.json.in Makefile
+	$(SED) -e 's/@VERSION@/$(VERSION)/g' $< > $@
+
+clean:
+	rm -f *.log *.aux

manifest.json

-{
-   "content_scripts": [ {
-      "exclude_globs": [  ],
-      "include_globs": [ "http://*.metafilter.com/*", "http://metafilter.com/*" ],
-      "js": [ "script.js" ],
-      "matches": [ "http://*/*", "https://*/*" ]
-   } ],
-   "converted_from_user_script": true,
-   "description": "Navigate users' comments in Metafilter threads.",
-   "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrDGYnlMRmIXKM/pXltEIVm5u+uToRY4TkPeZ5NUTO7EWMVhAQPnSOeRS22xZ5ueR06QDNIMZcNrqok16Bf4J/3k7rTWaGSOXzCHjEBB+Qft2pdu2senVSmFPRtb+b+NFolO1O9IPGDQF+Ip0SFc1oNUIak82Gzv450iUEylcopQIDAQAB",
-   "name": "MeFi Navigator",
-   "version": "1.0.2"
-}
+{
+   "content_scripts": [ {
+      "exclude_globs": [  ],
+      "include_globs": [ "http://*.metafilter.com/*", "http://metafilter.com/*" ],
+      "js": [ "script.js" ],
+      "matches": [ "http://*/*", "https://*/*" ]
+   } ],
+   "converted_from_user_script": true,
+   "description": "Navigate users' comments in Metafilter threads.",
+   "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrDGYnlMRmIXKM/pXltEIVm5u+uToRY4TkPeZ5NUTO7EWMVhAQPnSOeRS22xZ5ueR06QDNIMZcNrqok16Bf4J/3k7rTWaGSOXzCHjEBB+Qft2pdu2senVSmFPRtb+b+NFolO1O9IPGDQF+Ip0SFc1oNUIak82Gzv450iUEylcopQIDAQAB",
+   "name": "MeFi Navigator",
+   "version": "@VERSION@"
+}