This page describes the various changes to Ruby packaging that are planned for Wheezy.

Planned changes

Changes to interpreter packaging

Use alternatives to switch between Ruby implementations

There is a huge demand (see #548917) for using alternatives to switch between Ruby implementations. This would provide a way to mimic what RVM provides in a cleaner way, and will help the Ruby community with moving to 1.9.x or other implementations.

Of course, it is clear that some libraries will not work with Ruby 1.9.x or Rubinius or JRuby. The plan is to do something similar to what is done for Java:

Each ruby implementation will provide ruby-interpreter. Pure-ruby packages must depend on ruby-interpreter.

Switch to 1.9 as default

Once we use alternatives, it is quite easy to switch to 1.9 as default. However, 1.9 doesn't sound like a reasonable target now, even if it is likely to become one during the wheeze cycle.

Package other interpreters

It would be nice to make progress towards having the same support for Rubinius and JRuby.

Changes to rubygems packaging

Changes to third-party libraries and software packaging

Single package for all Ruby versions

For Wheezy, Ruby software must not come in separate packages per Ruby interpreter version, as we did until Squeeze (libfoo-ruby1.8, libfoo-ruby1.9.1 etc). We are going to use a single binary package per source package no matter what. In the case of native extensions, those single binary packages will contain the compiled extensions (*.so) for all supported Ruby versions. This is supported by gem2deb, so you should use it.

Naming of ruby packages

The current libfoo-ruby naming, inspired for perl, is not really great. It would be better to move to the python naming, with ruby-foo. Since all packages will have to be modified anyway to switch to gem2deb (see below), it is the perfect time to do that.

The guidelines are the following:

Renaming existing packages

Existing packages must be renamed to the new scheme. This renaming must be done using the standard Debian practices (i.e. Debian Developers' Reference, section 5.9.3). In our case, this means:

Handling of shebangs

gem2deb currenly forces the use of ruby1.8 (the default ruby version, actually). Patches to make it configurable are welcome.

gem2deb as the preferred packaging tool for ruby software

gem2deb is a replacement for our current cdbs-based packaging suite. It:

To test it:

git clone git://github.com/ln/gem2deb.git
cd gem2deb
rake install
then, cd to some temporary place, and do:
gem2deb rdiscount # native gem
or:
gem2deb i18n # pure-ruby gem

It serves two goals:

Prerequisites for migrations:

Generation of ri and rdoc documentation

We decide not to generate the ri and rdoc documentation, as there are good online services providing it (like rdoc.info). We might change our mind later. :)

How do we proceed?

  1. Upload updated interpreter packages, rubygems, and gem2deb to experimental
  2. Package a dozen of gems in experimental, make necessary improvements to gem2deb & other packages

  3. Finish the discussion on the necessary changes to the pkg-ruby-extras infrastructure (consider switching to git)

Success metrics

Transition status

See http://pkg-ruby-extras.alioth.debian.org/wheezy/

Using Git

Obtaining the master repository

git clone <alioth-username>@git.debian.org:/git/pkg-ruby-extras/pkg-ruby-extras.git

Then, to obtain all the team packages, do:

cd pkg-ruby-extras
mr checkout

To avoid typing your username and your password see this page.

Creating a new git repository

on alioth:

cd /git/pkg-ruby-extras
./setup-repository repository-name 'description of the repository'
Example:
./setup-repository ruby-foo 'Packaging for foo'

Note: please do not leave empty repositories on alioth; only create a repository there just before pushing your package (see below).

Pushing an existing package to git.debian.org

On alioth:

cd /git/pkg-ruby-extras
./setup-repository ruby-feedparser 'Packaging for ruby-feedparser'

On your local machine:

Get a basic .dsc from your package, using:
gem2deb ruby-feedparser-0.7.gem

At this point, please do not make any change to the package generated by gem2deb. It is important to track all the changes in git. Then:

cd where-you-cloned-pkg-ruby-extras.git
./make-mrconfig # will generate the config for your new repo
mr checkout # will clone your new repo
cd ruby-feedparser
git import-dsc --pristine-tar path-to/ruby-feedparser_0.7-1.dsc
git tag -d debian/0.7-1 # because the package is not ready yet
git push --all
git push --tags

Then, make the needed changes to the packaging, and then

git push

After upload, tag the package with

git tag debian/0.7-1

And don't forget to

git push --tags

Known Issues

If mr checkout gives an error like mr: illegal section "[DEFAULT]" in untrusted:

Add .mrconfig path to ~/.mrtrust

If your local username is different from your Alioth username (that's probably the case for non-DD developers with -guest accounts), add the following to your ~/.ssh/config:

Host alioth.debian.org svn.debian.org git.debian.org
User alioth-username

References