From f927ee03c4f769fcb0b29b011dde168bb17ea06f Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Jun 2011 19:50:31 +0100 Subject: Sort firefox addon, make improvements --- Makefile | 32 +++++++++++++++------- TODO | 16 ----------- chromium/manifest.json | 4 +-- chromium/updates.xml | 2 +- gecko/chrome/content/simplyread.xul | 5 +--- gecko/install.ttl | 6 ++--- gecko/updates.ttl | 4 +-- web/doap-src.ttl | 54 +++++++++++++++++++++++++++++++++++++ web/doap.ttl | 46 ------------------------------- 9 files changed, 85 insertions(+), 84 deletions(-) create mode 100644 web/doap-src.ttl delete mode 100644 web/doap.ttl diff --git a/Makefile b/Makefile index 97657ee..79d6d0a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ NAME = simplyread VERSION = 0.5 -WEBSITE = http://njw.me.uk/software/$(NAME)/ KEYFILE = private.pem -all: dist xpi crx +WEBSITE = http://njw.me.uk/software/$(NAME) +REPOURL = http://git.njw.me.uk/$(NAME).git +AUTHORFOAF = http://njw.me.uk/card#i +AUTHORNAME = Nick White +AUTHORHOME = http://njw.me.uk +GECKOID = simplyread@njw.me.uk + +all: xpi crx web: web/index.html web/gecko-updates.rdf web/chromium-updates.xml @@ -16,20 +22,22 @@ sign: echo $(NAME)-$(VERSION).tar.crx.sig # TODO: test makefile dependency is portable (and correct) -web/gecko-updates.rdf: web/$(NAME)-$(VERSION).xpi +web/gecko-updates.rdf: $(NAME)-$(VERSION).xpi uhura -o $@ -k $(KEYFILE) $(NAME)-$(VERSION).xpi $(WEBSITE)/$(NAME)-$(VERSION).xpi # gensig not working yet #web/gecko-updates.rdf: gecko/updates.ttl # sed -e "s/VERSION/$(VERSION)/g" \ +# -e "s|WEBSITE|$(WEBSITE)|g" \ +# -e "s|GECKOID|$(GECKOID)|g" \ # -e "s/HASH/`sha1sum $(NAME)-$(VERSION).xpi|awk '{print $$1}'`/g" \ # -e "s/SIG/`sh gecko/gensig.sh gecko/updates.ttl $(KEYFILE)`/g" \ # < $< | rapper -i turtle -o rdfxml /dev/stdin 2>/dev/null > $@ web/chromium-updates.xml: chromium/updates.xml - sed "s/VERSION/$(VERSION)/g" < $< > $@ + sed -e "s/VERSION/$(VERSION)/g" -e "s|WEBSITE|$(WEBSITE)|g" < $< > $@ -web/index.html: web/doap.ttl README webheader.html +web/index.html: web/doap-src.ttl README webheader.html echo making webpage cat < webheader.html > $@ smu < README >> $@ @@ -40,7 +48,10 @@ web/index.html: web/doap.ttl README webheader.html echo '

SimplyRead $(VERSION) for Chromium
' >> $@ echo 'GPG signature

' >> $@ echo '
' >> $@ - sh websummary.sh web/doap.ttl | smu >> $@ + sed -e "s|FOAF|$(AUTHORFOAF)|g" -e "s|AUTHORNAME|$(AUTHORNAME)|g" \ + -e "s|AUTHORHOME|$(AUTHORHOME)|g" -e "s|WEBSITE|$(WEBSITE)|g" \ + -e "s|REPOURL|$(REPOURL)|g" < web/doap-src.ttl > web/doap.ttl + sh web/websummary.sh web/doap.ttl | smu >> $@ echo '' >> $@ dist: @@ -53,14 +64,14 @@ dist: xpi: rm -rf $(NAME)-$(VERSION).xpi gecko-build + test -f $(KEYFILE) || openssl genrsa 1024 > $(KEYFILE) mkdir -p gecko-build/chrome/content cp COPYING gecko/chrome.manifest gecko-build/ cp gecko/chrome/content/simplyread.xul gecko-build/chrome/content/ cp simplyread.js gecko-build/chrome/content/ rsvg -w 22 -h 22 icon.svg gecko-build/chrome/content/icon.png - #rsvg -w 64 -h 64 icon.svg gecko-build/icon.png - cp icon.svg gecko-build/icon.svg - sed -e "s/VERSION/$(VERSION)/g" -e "s/PUBKEY/`sh gecko/genpub.sh $(KEYFILE)`/g" \ + rsvg -w 64 -h 64 icon.svg gecko-build/icon.png + sed -e "s/VERSION/$(VERSION)/g" -e "s|WEBSITE|$(WEBSITE)|g" -e "s|GECKOID|$(GECKOID)|g" -e "s/PUBKEY/`sh gecko/genpub.sh $(KEYFILE)`/g" \ < gecko/install.ttl | rapper -i turtle -o rdfxml /dev/stdin 2>/dev/null > gecko-build/install.rdf cd gecko-build; zip -r ../$(NAME)-$(VERSION).xpi . 1>/dev/null rm -rf gecko-build @@ -68,12 +79,13 @@ xpi: crx: rm -rf chromium-build + test -f $(KEYFILE) || openssl genrsa 1024 > $(KEYFILE) mkdir chromium-build cp COPYING simplyread.js keybind.js chromium/viable.js chromium/background.html chromium-build/ rsvg -w 19 -h 19 icon.svg chromium-build/icon.png rsvg -w 48 -h 48 icon.svg chromium-build/icon48.png rsvg -w 128 -h 128 icon.svg chromium-build/icon128.png - sed "s/VERSION/$(VERSION)/g" < chromium/manifest.json > chromium-build/manifest.json + sed -e "s/VERSION/$(VERSION)/g" -e "s|WEBSITE|$(WEBSITE)|g" < chromium/manifest.json > chromium-build/manifest.json sh chromium/makecrx.sh chromium-build $(KEYFILE) > $(NAME)-$(VERSION).crx rm -r chromium-build echo $(NAME)-$(VERSION).crx diff --git a/TODO b/TODO index 1889c04..62722ad 100644 --- a/TODO +++ b/TODO @@ -1,16 +1,4 @@ gecko: - test with firefox 4.0, and update version info - http://blog.mozilla.com/addons/2010/11/11/making-add-on-compatible-firefox-4/ - will have to attach the button to the 'addon bar', rather than the status bar - the addon bar is a standard 'toolbar', so things have to be rewritten accordingly - http://mike.kaply.com/2011/01/25/the-firefox-4-add-on-bar-for-developers/ - https://developer.mozilla.org/en/The_add-on_bar - https://developer.mozilla.org/en/XUL/Toolbars/Creating_toolbar_buttons - this means i'll have to set the icon image using css - note that this can be a svg (see http://blog.mozilla.com/addons/2010/12/02/toolbar-buttons-in-firefox-4/ ) - include a 64x64 icon for the addon manager - hopefully done by just putting in root - needs testing as iconURL vs icon64URL documentation conflicts - do try a straight svg here too (just called icon.svg) (prob won't work) - https://developer.mozilla.org/en/Install_Manifests#iconURL get working with firefox mobile https://wiki.mozilla.org/Mobile/Fennec/Extensions finish update support. this means use tool http://www.softlights.net/projects/mxtools/uhura.html to sign mozilla thing once it's working look into using rapper and bourne shell script to sign @@ -18,10 +6,6 @@ gecko: https://developer.mozilla.org/en/Extension_Versioning,_Update_and_Compatibility#Update_RDF_Format openssl dgst -sha512 -binary -sign private.pem web/gecko-updates.rdf i'm pretty sure generates the correct signature. however it then has to be encoded, using asn1/der & base64. also, according to the docs only the hash is signed/hashed, whereas it looks like the whole (particularly serialised) rdf is used by uhura -build: - set website from makefile variable / sed everywhere - add clauses to makefile so make can work without a private key (for easy 3rd party modifications etc) - web: change 'download simplyread' button to 'simplyread 0.4 source' diff --git a/chromium/manifest.json b/chromium/manifest.json index ea80b15..996b3e8 100644 --- a/chromium/manifest.json +++ b/chromium/manifest.json @@ -6,6 +6,6 @@ "content_scripts": [{"matches": [""], "js": ["simplyread.js", "keybind.js", "viable.js"]}], "page_action": { "default_icon": "icon.png" }, "icons": {"48":"icon48.png", "128":"icon128.png"}, - "homepage_url": "http://njw.me.uk/software/simplyread/", - "update_url": "http://njw.me.uk/software/simplyread/chromium-updates.xml" + "homepage_url": "WEBSITE/", + "update_url": "WEBSITE/chromium-updates.xml" } diff --git a/chromium/updates.xml b/chromium/updates.xml index 8dec4de..f938094 100644 --- a/chromium/updates.xml +++ b/chromium/updates.xml @@ -1,6 +1,6 @@ - + diff --git a/gecko/chrome/content/simplyread.xul b/gecko/chrome/content/simplyread.xul index e9edffd..2ed3ac8 100644 --- a/gecko/chrome/content/simplyread.xul +++ b/gecko/chrome/content/simplyread.xul @@ -4,10 +4,7 @@ - - - - + diff --git a/gecko/install.ttl b/gecko/install.ttl index dc40853..2ee9aaf 100644 --- a/gecko/install.ttl +++ b/gecko/install.ttl @@ -2,7 +2,7 @@ @prefix em: . - em:id "simplyread@njw.me.uk"; + em:id "GECKOID"; em:version "VERSION"; em:type "2"; em:targetApplication [ @@ -13,7 +13,7 @@ em:name "SimplyRead"; em:description "Stop browsing, start reading. Press Ctrl-Alt-r or click the 'sr' icon in the status bar to toggle SimplyRead."; em:creator "Nick White"; - em:homepageURL "http://njw.me.uk/software/simplyread/"; - em:updateURL "http://njw.me.uk/software/simplyread/gecko-updates.rdf"; + em:homepageURL "WEBSITE/"; + em:updateURL "WEBSITE/gecko-updates.rdf"; em:updateKey "PUBKEY"; . diff --git a/gecko/updates.ttl b/gecko/updates.ttl index 34325db..6283c4e 100644 --- a/gecko/updates.ttl +++ b/gecko/updates.ttl @@ -3,7 +3,7 @@ @prefix rdf: . @prefix em: . - + em:signature "SIG"; em:updates [ a rdf:Seq ; rdf:li <:VERSION>; @@ -15,6 +15,6 @@ em:id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; em:minVersion "3.0"; em:maxVersion "4.0.*"; - em:updateLink "http://njw.me.uk/simplyread/simplyread-VERSION.xpi"; + em:updateLink "WEBSITE/simplyread-VERSION.xpi"; em:updateHash "sha1:HASH"; ]. diff --git a/web/doap-src.ttl b/web/doap-src.ttl new file mode 100644 index 0000000..770e4ed --- /dev/null +++ b/web/doap-src.ttl @@ -0,0 +1,54 @@ +# Note this is populated from the Makefile +@prefix rdf: . +@prefix doap: . +@prefix foaf: . +@prefix : . + +:p a doap:Project; + doap:name "SimplyRead"; + doap:shortdesc "Stop browsing, start reading"; + doap:homepage ; + doap:repository :repo; + doap:programming-language "ECMAScript"; + doap:license ; + doap:release :v0dot1, :v0dot2, :v0dot3, :v0dot4, :v0dot5; + doap:maintainer . + + a foaf:Person; + foaf:name "AUTHORNAME"; + foaf:homepage . + +:repo a doap:GitRepository; + doap:location . + +:v0dot1 a doap:Version; + doap:revision "0.1"; + doap:created "2010-10-23"; + doap:file-release . + +:v0dot2 a doap:Version; + doap:revision "0.2"; + doap:created "2010-11-04"; + doap:file-release , + . + +:v0dot3 a doap:Version; + doap:revision "0.3"; + doap:created "2010-11-13"; + doap:file-release , + , + . + +:v0dot4 a doap:Version; + doap:revision "0.4"; + doap:created "2010-11-16"; + doap:file-release , + , + . + +:v0dot5 a doap:Version; + doap:revision "0.5"; + doap:created "2011-06-16"; + doap:file-release , + , + . diff --git a/web/doap.ttl b/web/doap.ttl deleted file mode 100644 index 55fc2e4..0000000 --- a/web/doap.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix rdf: . -@prefix doap: . -@prefix foaf: . -@prefix : . - -:p a doap:Project; - doap:name "SimplyRead"; - doap:shortdesc "Stop browsing, start reading"; - doap:homepage ; - doap:repository :repo; - doap:programming-language "ECMAScript"; - doap:license ; - doap:release :v0.1, :v0.2, :v0.3, :v0.4; - doap:maintainer . - - a foaf:Person; - foaf:name "Nick White"; - foaf:homepage . - -:repo a doap:GitRepository; - doap:location . - -:v0.1 a doap:Version; - doap:revision "0.1"; - doap:created "2010-10-23"; - doap:file-release . - -:v0.2 a doap:Version; - doap:revision "0.2"; - doap:created "2010-11-04"; - doap:file-release , - . - -:v0.3 a doap:Version; - doap:revision "0.3"; - doap:created "2010-11-13"; - doap:file-release , - , - . - -:v0.4 a doap:Version; - doap:revision "0.4"; - doap:created "2010-11-16"; - doap:file-release , - , - . -- cgit v1.2.3