Navigation: Debian/Ruby Extras / Ruby Package Tools / Upstream Sources Language: en WikiLink: Upstream Sources

Retrieving Upstream Sources

Since after much discussion it was decided not to put all the upstream sources of every package into the Subversion repository, a tool was added to this package to help retrieving it. This tool, pkg-ruby-get-sources is described below; it can use either the pkg-ruby-extras.sources information file or (preferably) the package’s debian/watch file.

Basic usage

A basic usage scenario for pkg-ruby-get-sources is to do a checkout, get the upstream source and build:

$ cd Debian/packages
$ svn co svn+ssh://svn.debian.org/svn/pkg-ruby-extras/packages/libfoo-ruby
[...]
$ cd libfoo-ruby/trunk
$ mkdir ../tarballs
$ pkg-ruby-get-sources
[100%] http://somesite/path/to/foo-ruby-0.1.tar.gz
$ ls ../tarballs
libfoo-ruby_0.1.orig.tar.gz
$ svn-buildpackage [...]

Note that pkg-ruby-get-sources retrieves the tarball and takes care of the naming of the file locally so that it suits the Debian source package name. For example see above where foo-ruby-0.1.tar.gz is automatically renamed to libfoo-ruby_0.1.orig.tar.gz.

Where does it find upstream sources?

There are two ways to find the upstream sources:
  1. Using the package’s watch file. This is the preferred method.
  2. Using the pkg-ruby-extras.sources file, described below. This should only be used for packages where watch files are not a solution.

debian/watch files

This is by far the best way to do, as other tools from debian also use the information stored in this file (see for instance QA pages for developers).

The principle is simple: if the software you package provides a web page with a link to source tarballs, all you need to do is provide the location of this page along with a regular expression matching the link to the tarball. For a standard Rubyforge package, the watchfile would look like

version=3
http://rubyforge.org/frs/?group_id=701 .*tioga-([\d.-]*)\.t.*

To check the contents of this file, run

  uscan --report 

Look at the uscan manual page for more information.

Registering sources using the pkg-ruby-extras.sources file

Retrieve from Subversion:

/svn/pkg-ruby-extras/tools/ruby-pkg-tools/trunk/pkg-ruby-extras.sources

and edit it. This file follows the YAML format.

Other features

pkg-ruby-get-sources allows for selecting different sources files (--sources) instead of using the one that comes with ruby-pkg-tools by default, so you can use your own. It also can list all available sources (--list-available) or download to a different target directory (--target-directory).