Download to a '.part' file and rename on success
[deb2zero.git] / doc / README
blob845305f6573beec293c60fd95d44d08714a12e94
1 pkg2zero - publish Debian and RPM packages using Zero Install
3 Copyright Thomas Leonard, 2009
4 Copyright Anders F Bjorklund, 2008
7 INTRODUCTION
9 Zero Install is a decentralised installation system. Meta-data about each
10 package is published in a "feed" file. The Zero Install client reads these
11 feeds files and downloads and runs the programs. For details, see:
13   http://0install.net for details.
15 The feed files can be created manually (e.g. using 0publish or 0publish-gui):
17   http://0install.net/0publish.html
18   http://0install.net/injector-packagers.html
20 However, Debian and RPM packages already contain much of the required information. This
21 program extracts the information in an existing distribution package and uses it to
22 generate the feed.
25 INSTRUCTIONS
27 To download and create a short-cut to pkg2zero:
29   $ 0alias pkg2zero http://0install.net/2009/interfaces/pkg2zero.xml
31 To create a feed for the GQView image viewer from the Debian package:
33   $ pkg2zero http://ftp.uk.debian.org/debian/pool/main/g/gqview/gqview_2.0.1-1_i386.deb GQView.xml
35 To create a feed for the GQView image viewer from an RPM package:
37   $ pkg2zero http://dag.wieers.com/rpm/packages/gqview/gqview-1.4.5-1.el5.rf.i386.rpm GQView.xml
39 You will be prompted to "Enter the URI for this feed". This is the URL from
40 which other people will download your feed file.
42 Note: pkg2zero guesses some things (such as which binary to run by default if
43 the package contains several) so you should check the feed file manually and
44 edit if required.
46 To test the feed:
48   $ 0launch ./GQView.xml
50 If you want to publish the feed so that others can use it, you'll also need to
51 sign it. You can do this by specifying a GPG key with the --key option, e.g.:
53   $ pkg2zero -k Bob http://.../package.rpm
55 See the packaging tutorial for more details:
57   http://0install.net/injector-packagers.html
59 To add a new version to your feed later:
61   $ pkg2zero http://.../new-version.rpm GQView.xml
63 USING A PACKAGES FILE (Debian)
65 As an alternative to specifying the URL of the Debian package directly, you can
66 download the index file to the current directory and then just give the package
67 name. e.g.
69   $ wget ftp://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2
70   $ pkg2zero -p Packages.bz2 gqview GQView.xml
72 USING REPOSITORY METADATA (RPM)
74 As an alternative to specifying the URL of the RPM package directly, you can
75 download the repodata to the current directory and then just give the package
76 name. e.g.
78   $ mkdir -p repodata
79   $ wget -N -P repodata http://download.fedoraproject.org/pub/epel/5/i386/repodata/repomd.xml
80   $ wget -N -P repodata http://download.fedoraproject.org/pub/epel/5/i386/repodata/primary.xml.gz
81   $ pkg2zero -m http://download.fedoraproject.org/pub/epel --path 5/i386 gqview GQView.xml
84 DEPENDENCIES
86 pkg2zero can process the requirements given in a distribution package and generate a
87 corresponding <requires> element in the feed. For this to work, you need to
88 create a file called '~/.config/0install.net/pkg2zero/mappings' [1],
89 mapping from distribution package names to Zero Install feed URIs, one per line. For
90 example:
92 libfoo: http://0install.net/2008/3rd-party/libfoo.xml
94 pkg2zero will then turn
96   Requires: libfoo
98 into
100   <requires interface="http://0install.net/2008/3rd-party/libfoo.xml">
101     <environment insert="usr/lib" name="LD_LIBRARY_PATH"/>
102   </requires>
104 Note that setting LD_LIBRARY_PATH is just a guess. It may be that the package
105 depends on libfoo in some other way (e.g. it needs a binary in $PATH). In that
106 case, you'll need to edit the feed to correct it.
108 When you create a new feed, pkg2zero automatically appends the new mapping
109 to the mappings file for you. The last line of the file is also used to
110 suggest a default when naming new feeds.
113 LIMITATIONS
115 Version restrictions in dependencies are not currently handled.
117 Source packages are not handled; you have to add the 0compile directives
118 manually.
121 CONDITIONS
123 This library is free software; you can redistribute it and/or
124 modify it under the terms of the GNU Lesser General Public
125 License as published by the Free Software Foundation; either
126 version 3 of the License, or (at your option) any later version.
128 This library is distributed in the hope that it will be useful,
129 but WITHOUT ANY WARRANTY; without even the implied warranty of
130 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
131 Lesser General Public License for more details.
133 You should have received a copy of the GNU Lesser General Public
134 License along with this library; if not, write to the Free Software
135 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
138 BUG REPORTS
140 Please report any bugs to the mailing list:
142         http://0install.net/support.html
144 [1] See freedesktop.org basedir specification for full details.