summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-06-16 19:50:31 +0100
committerNick White <git@njw.me.uk>2011-06-16 19:50:31 +0100
commitf927ee03c4f769fcb0b29b011dde168bb17ea06f (patch)
treea9a0656277348d194487662088ed9a348caaef57
parent07a763300e751724e18e8fa8729dfb321840757f (diff)
Sort firefox addon, make improvements
-rw-r--r--Makefile32
-rw-r--r--TODO16
-rw-r--r--chromium/manifest.json4
-rw-r--r--chromium/updates.xml2
-rw-r--r--gecko/chrome/content/simplyread.xul5
-rw-r--r--gecko/install.ttl6
-rw-r--r--gecko/updates.ttl4
-rw-r--r--web/doap-src.ttl54
-rw-r--r--web/doap.ttl46
9 files changed, 85 insertions, 84 deletions
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 '<h3><a href="$(NAME)-$(VERSION).crx">SimplyRead $(VERSION) for Chromium</a><br />' >> $@
echo '<a href="$(NAME)-$(VERSION).xpi.crx">GPG signature</a></h3>' >> $@
echo '<hr />' >> $@
- 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 '</body></html>' >> $@
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": ["<all_urls>"], "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 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='apapoaenlmlncnnhbpdobjifmpjdabpn'>
- <updatecheck codebase='http://njw.me.uk/software/simplyread/simplyread-VERSION.crx' version='VERSION' />
+ <updatecheck codebase='WEBSITE/simplyread-VERSION.crx' version='VERSION' />
</app>
</gupdate>
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 @@
<keyset>
<key id="simplyread" modifiers="accel alt" key="r" oncommand="simplyread()" />
</keyset>
- <statusbar id="status-bar">
- <image id="simplyread-icon" src="chrome://simplyread/content/icon.png" onclick="simplyread()" />
- </statusbar>
- <statusbar id="addon-bar"><!-- gecko 2+ -->
+ <statusbar id="addon-bar">
<image id="simplyread-icon" src="chrome://simplyread/content/icon.png" onclick="simplyread()" />
</statusbar>
</overlay>
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: <http://www.mozilla.org/2004/em-rdf#>.
<urn:mozilla:install-manifest>
- 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";
<http://usefulinc.com/ns/doap#license> <http://www.gnu.org/licenses/agpl.html>.
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: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix em: <http://www.mozilla.org/2004/em-rdf#>.
-<urn:mozilla:extension:simplyread@njw.me.uk>
+<urn:mozilla:extension:GECKOID>
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: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix doap: <http://usefulinc.com/ns/doap#>.
+@prefix foaf: <http://xmlns.com/foaf/0.1/>.
+@prefix : <WEBSITE/#>.
+
+:p a doap:Project;
+ doap:name "SimplyRead";
+ doap:shortdesc "Stop browsing, start reading";
+ doap:homepage <WEBSITE/>;
+ doap:repository :repo;
+ doap:programming-language "ECMAScript";
+ doap:license <http://www.gnu.org/licenses/agpl.html>;
+ doap:release :v0dot1, :v0dot2, :v0dot3, :v0dot4, :v0dot5;
+ doap:maintainer <FOAF>.
+
+<FOAF> a foaf:Person;
+ foaf:name "AUTHORNAME";
+ foaf:homepage <AUTHORHOME>.
+
+:repo a doap:GitRepository;
+ doap:location <REPOURL>.
+
+:v0dot1 a doap:Version;
+ doap:revision "0.1";
+ doap:created "2010-10-23";
+ doap:file-release <WEBSITE/readable-0.1.tar.bz2>.
+
+:v0dot2 a doap:Version;
+ doap:revision "0.2";
+ doap:created "2010-11-04";
+ doap:file-release <WEBSITE/readable-0.2.tar.bz2>,
+ <WEBSITE/readable-0.2.xpi>.
+
+:v0dot3 a doap:Version;
+ doap:revision "0.3";
+ doap:created "2010-11-13";
+ doap:file-release <WEBSITE/simplyread-0.3.tar.bz2>,
+ <WEBSITE/simplyread-0.3.xpi>,
+ <WEBSITE/simplyread-0.3.crx>.
+
+:v0dot4 a doap:Version;
+ doap:revision "0.4";
+ doap:created "2010-11-16";
+ doap:file-release <WEBSITE/simplyread-0.4.tar.bz2>,
+ <WEBSITE/simplyread-0.4.xpi>,
+ <WEBSITE/simplyread-0.4.crx>.
+
+:v0dot5 a doap:Version;
+ doap:revision "0.5";
+ doap:created "2011-06-16";
+ doap:file-release <WEBSITE/simplyread-0.5.tar.bz2>,
+ <WEBSITE/simplyread-0.5.xpi>,
+ <WEBSITE/simplyread-0.5.crx>.
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: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix doap: <http://usefulinc.com/ns/doap#>.
-@prefix foaf: <http://xmlns.com/foaf/0.1/>.
-@prefix : <http://njw.me.uk/software/simplyread/#>.
-
-:p a doap:Project;
- doap:name "SimplyRead";
- doap:shortdesc "Stop browsing, start reading";
- doap:homepage <http://njw.me.uk/software/simplyread/>;
- doap:repository :repo;
- doap:programming-language "ECMAScript";
- doap:license <http://www.gnu.org/licenses/agpl.html>;
- doap:release :v0.1, :v0.2, :v0.3, :v0.4;
- doap:maintainer <http://njw.me.uk/card#i>.
-
-<http://njw.me.uk/card#i> a foaf:Person;
- foaf:name "Nick White";
- foaf:homepage <http://njw.me.uk>.
-
-:repo a doap:GitRepository;
- doap:location <http://git.njw.me.uk/simplyread.git>.
-
-:v0.1 a doap:Version;
- doap:revision "0.1";
- doap:created "2010-10-23";
- doap:file-release <http://njw.me.uk/software/simplyread/readable-0.1.tar.bz2>.
-
-:v0.2 a doap:Version;
- doap:revision "0.2";
- doap:created "2010-11-04";
- doap:file-release <http://njw.me.uk/software/simplyread/readable-0.2.tar.bz2>,
- <http://njw.me.uk/software/simplyread/readable-0.2.xpi>.
-
-:v0.3 a doap:Version;
- doap:revision "0.3";
- doap:created "2010-11-13";
- doap:file-release <http://njw.me.uk/software/simplyread/simplyread-0.3.tar.bz2>,
- <http://njw.me.uk/software/simplyread/simplyread-0.3.xpi>,
- <http://njw.me.uk/software/simplyread/simplyread-0.3.crx>.
-
-:v0.4 a doap:Version;
- doap:revision "0.4";
- doap:created "2010-11-16";
- doap:file-release <http://njw.me.uk/software/simplyread/simplyread-0.4.tar.bz2>,
- <http://njw.me.uk/software/simplyread/simplyread-0.4.xpi>,
- <http://njw.me.uk/software/simplyread/simplyread-0.4.crx>.