Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build second xpi for updates from master #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/Makefile.in
.DS_Store
*.xpi
*-fx.xpi
install.rdf
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@ all: Makefile.in

-include Makefile.in

RELEASE:=$(shell grep em:version install.rdf | head -n 1 | sed -e 's/ *<em:version>//' -e 's/<\/em:version>//')
RELEASE:=$(shell xsltproc version.xsl install.xml)

zotfile.xpi: FORCE
zotfile-fx.xpi: FORCE
rm -rf $@
xsltproc removeupdateurl.xsl install.xml > install.rdf
zip -r $@ chrome chrome.manifest defaults install.rdf -x \*.DS_Store

zotfile-%-fx.xpi: zotfile.xpi
zotfile-github.xpi: FORCE
rm -rf $@
cp install.xml install.rdf
xsltproc -stringparam release ${RELEASE} update.xsl install.xml > update.rdf
zip -r $@ chrome chrome.manifest defaults install.rdf

zotfile-%-fx.xpi: zotfile-fx.xpi
mv $< $@

zotfile-%-github.xpi: zotfile-github.xpi
mv $< $@

Makefile.in: install.rdf
echo "all: zotfile-${RELEASE}-fx.xpi" > Makefile.in
Makefile.in: install.xml
echo "all: zotfile-${RELEASE}-fx.xpi zotfile-${RELEASE}-github.xpi" > Makefile.in

FORCE:
1 change: 1 addition & 0 deletions install.rdf → install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
<em:creator>Joscha Legewie</em:creator>
<em:homepageURL>http://www.zotfile.com</em:homepageURL>
<em:optionsURL>chrome://zotfile/content/options.xul</em:optionsURL>
<em:updateURL>https://raw.githubusercontent.com/jlegewie/zotfile/master/update.rdf</em:updateURL>
</Description>
</RDF>
13 changes: 13 additions & 0 deletions removeupdateurl.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">

<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

<xsl:template match="em:updateURL"/>
</xsl:stylesheet>
32 changes: 32 additions & 0 deletions update.rdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF:Description about="urn:mozilla:extension:[email protected]">
<em:updates>
<RDF:Seq>
<RDF:li>
<RDF:Description>
<em:version>3.3</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>18.*</em:minVersion>
<em:maxVersion>28.*</em:maxVersion>
<em:updateLink>https://raw.githubusercontent.com/jlegewie/zotfile/master/zotfile-3.3-github.xpi</em:updateLink>
<em:updateInfoURL>https://github.com/jlegewie/zotfile</em:updateInfoURL>
</RDF:Description>
</em:targetApplication>
<em:targetApplication>
<RDF:Description>
<em:id>[email protected]</em:id>
<em:minVersion>3.0b1</em:minVersion>
<em:maxVersion>4.*</em:maxVersion>
<em:updateLink>https://raw.githubusercontent.com/jlegewie/zotfile/master/zotfile-3.3-github.xpi</em:updateLink>
<em:updateInfoURL>https://github.com/jlegewie/zotfile</em:updateInfoURL>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</em:updates>
</RDF:Description>
</RDF:RDF>
47 changes: 47 additions & 0 deletions update.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#"
>
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<xsl:variable name="id" select="RDF:RDF/RDF:Description/em:id"/>
<xsl:variable name="version" select="RDF:RDF/RDF:Description/em:version"/>
<RDF:Description about="urn:mozilla:extension:{$id}">
<em:updates>
<RDF:Seq>
<RDF:li>
<RDF:Description>
<em:version><xsl:value-of select="$version"/></em:version>
<xsl:for-each select="RDF:RDF/RDF:Description/em:targetApplication">
<em:targetApplication>
<RDF:Description>
<xsl:if test="string-length(RDF:Description/em:id)!=0">
<em:id><xsl:value-of select="RDF:Description/em:id"/></em:id>
</xsl:if>
<xsl:if test="string-length(RDF:Description/em:minVersion)!=0">
<em:minVersion><xsl:value-of select="RDF:Description/em:minVersion"/></em:minVersion>
</xsl:if>
<xsl:if test="string-length(RDF:Description/em:maxVersion)!=0">
<em:maxVersion><xsl:value-of select="RDF:Description/em:maxVersion"/></em:maxVersion>
</xsl:if>

<em:updateLink>https://raw.githubusercontent.com/jlegewie/zotfile/master/zotfile-<xsl:value-of select="$release"/>-github.xpi</em:updateLink>

<em:updateInfoURL>https://github.com/jlegewie/zotfile</em:updateInfoURL>
</RDF:Description>
</em:targetApplication>
</xsl:for-each>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</em:updates>
</RDF:Description>
</RDF:RDF>
</xsl:template>

</xsl:stylesheet>
7 changes: 7 additions & 0 deletions version.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#" >
<xsl:output method="text"/>

<xsl:template match="/"><xsl:value-of select="RDF:RDF/RDF:Description/em:version"/></xsl:template>

</xsl:stylesheet>