<?xml version='1.0' encoding='utf-8'?>
<html lang="en">
<h2>Example: Inkscape</h2>
<p>
<a href='http://inkscape.org/'>The Inkscape project</a> makes available a
binary RPM which works on various platforms. However, using this RPM directly
has a few limitations for users:
</p>
<ul>
<li>They must be root to install it.</li>
<li>It doesn't work on all distributions (e.g., Debian).</li>
<li>The system won't periodically check for updates.</li>
</ul>
<p>
These limitations can be avoided by creating a Zero Install interface file for it. This guide goes over
the steps quite quickly. For more details see <a href='injector-packagers.html'>the
packaging main guide</a>.
</p>
<p>
Note: The original Inkscape binary RPM was compiled with binreloc support
disabled, which prevented it from finding its icons (it used hard-coded paths).
Jean-François Lemaire, the creator of the RPM, has kindly recompiled it for us with
relocation support turned on.
</p>
<toc level='h2'/>
<h2>Creating the interface</h2>
<p>
We'll be using the <b>0publish</b> command to create the interface file. If you don't
have it already, create an alias for <b>0publish</b> in the usual way:</p>
<pre>
$ <b>0install add 0publish http://0install.net/2006/interfaces/0publish</b>
</pre>
<p>
To create the interface file:
</p>
<ol>
<li>Download the static binary RPM:
<pre>
$ <b>wget http://users.skynet.be/jflemaire/files/inkscape-0.43-0.i386.rpm</b>
</pre>
</li>
<li>Create the interface:
<pre>
$ <b>0publish Inkscape.xml</b>
</pre>
<p>
Fill in the <b>name</b>, <b>summary</b>, <b>description</b>, <b>icon</b> and <b>homepage</b> fields.
Set <b>main='usr/bin/inkscape'</b> on the <b>group</b> element. Save and quit (using the default filename).
</p>
</li>
<li>
Add version 0.43 with the location of the static RPM:
<pre>
$ <b>0publish Inkscape.xml \
--set-version=0.43 \
--archive-url=http://users.skynet.be/jflemaire/files/inkscape-0.43-0.i386.rpm \
--set-released=today \
--set-arch=Linux-i486</b>
</pre>
</li>
</ol>
<h2>Testing it</h2>
<p>
You can run the new XML file with <b>0launch</b> to download and run Inkscape:
</p>
<pre>
$ <b>0launch ./Inkscape.xml</b>
</pre>
<p style='text-align: center'>
<img width="586" height="261" src="screens/package-inkscape.png"
alt="Running Inkscape with Zero Install" />
</p>
<h2>Signing and publishing</h2>
<p>
Now we need to sign the XML file using our GPG key. If you don't already have a GPG key, create one now:
</p>
<pre>
$ <b>gpg --gen-key</b>
</pre>
<p>
We also need to decide where the Inkscape XML file will be made available. This
URL should not change, since other programs will link to it. We'll assume
<b>http://inkscape.org/2006/ZeroInstall/Inkscape.xml</b> here.
</p>
<p>
To set the URI and sign the interface:
</p>
<pre>
$ <b>0publish Inkscape.xml \
--set-interface-uri=http://inkscape.org/2006/ZeroInstall/Inkscape.xml \
--xmlsign</b>
Exported public key as 'AE07828059A53CC1.gpg'
</pre>
<p>
Upload the resulting <b>Inkscape.xml</b> and GPG files to the same directory on the web-server. The XML file
should look something like <a href='http://0install.net/2006/3rd-party/Inkscape.xml'>the Inkscape.xml test interface</a>.
</p>
<h2>Using the published interface</h2>
<p>
You can now run Inkscape like this:
</p>
<pre>
$ <b>0launch http://inkscape.org/2006/ZeroInstall/Inkscape.xml</b>
</pre>
<p>
Users can now install Inkscape using this URL, either using some graphical installer (like ROX's
<a href='http://rox.sourceforge.net/desktop/AddApp'>AddApp</a> or
<a href='http://rox.sourceforge.net/desktop/node/269'>Xfce 4.4's panel</a>). Command-line users can
get it like this:
</p>
<pre>
$ <b>0install add inkscape http://inkscape.org/2006/ZeroInstall/Inkscape.xml</b>
</pre>
<p>
They can then run it by typing <b>inkscape</b>. To choose a different version:
</p>
<pre>
$ <b>0install update --gui inkscape</b>
</pre>
<h2>Marking as stable</h2>
<p>
After the release has been out for a while, mark it as stable:
</p>
<pre>
$ <b>0publish Inkscape.xml --stable</b>
</pre>
<p>
Users can configure the injector either to prefer stable versions or to select testing versions
by default. This gives your more advanced users the chance to provide feedback before you roll a new
release out to all users.
</p>
<h2>Making a new release</h2>
<p>
When a new static binary RPM is released, add the new version to the XML as follows:
</p>
<ol>
<li>Download the new RPM (if you're not the person who made it).</li>
<li>Add it to the XML (note use of <b>add-version</b> rather than <b>set-version</b> here):
<pre>
$ <b>0publish Inkscape.xml \
--add-version=0.44 \
--archive-url=http://users.skynet.be/jflemaire/files/inkscape-0.44-0.i386.rpm \
--set-released=today \
--set-arch=Linux-i486</b>
</pre></li>
</ol>
</html>