gem2deb(1)

gem2deb1

Converts rubygems' .gem file into debian package

Usage

gem2deb [OPTIONS] GEMNAME (to download the gem with gem fetch)

gem2deb [OPTIONS] GEMFILE (to use a local .gem file)

Overview

gem2deb converts the gem into a Debian source package, and then will attempt to build it. The process is made of several steps.

First, gem2deb converts the gem file to a tar.gz archive containing a metadata.yml file with the Gem specification. This is equivalent to what gem2tgz does.

Then, gem2deb unpacks the tar.gz archive and prepares a Debian source package, guess many of the defaults from the files included in the archive, or the Gem specification. This is equivalent to what dh-make-ruby does. gem2deb cannot determine all parameters for obvious reasons. It is recommended to search for the "FIXME" string in the debian/ directory. The generated Debian source package uses dh_ruby to build the package.

Finally, gem2deb tries to build the source and binary packages using dpkg-buildpackage.

Options

-t, --only-tarball

Stop after creating the tar.gz archive.

-s, --only-source-dir

Stop after preparing the Debian source package directory (do not attempt to build the package).

-S, --only-debian-source

Only build a Debian source package (do not build binary packages).

-d, --no-check-builddeps

Do not check build dependencies when building the package. Equivalent to the options with the same in dpkg-buildpackage(1).

-p PACKAGE, --package PACKAGE

Specify package name (default: ruby-*). Passed to dh-make-ruby. See dh-make-ruby(1).

-g, --git

Import the resulting source package, if any, to a git repository under the current directory. The git repository will be named after the source package (i.e. it is influenced by --package).

Note that --only-tarball or --only-source-dir will prevent this, since they make gem2deb stop early.

The import uses gbp import-dsc --pristine-tar (see gbp-import-dsc(1)), and thus git-buildpackage and pristine-tar need to be installed for this to work.

--purge

After building the package, remove all files files that were produced by gem2deb. This includes source tarballs, Debian package artifacts (.dsc, .deb, .changes etc), and even the source directory. This is useful for example when used in conjunction with --git.

--no-wnpp-check

Prevents dh-make-ruby to check wnpp reports to get the number of a possible ITP (intend to package) bug report. By default, dh-make-ruby does check these reports, which requires an Internet access.

-o, --offline

Prevents dh-make-ruby from accessing the internet at all.

-h, --help

Displays gem2deb usage information.

-v, --version

Displays gem2deb version information.

How the .gem -> .TGZ conversion works

A gem named mygem-0.1.0.gem is converted in a tarball with (approximately) the following steps:

  mkdir mygem-0.1.0
  cd mygem-0.1.0
  tar xfm /absolute/path/to/mygem-0.1.0.gem
  tar xzfm data.tar.gz
  zcat metadata.gz > metadata.yml
  rm -f data.tar.gz metadata.gz
  cd ..
  tar czf mygem-0.1.0.tar.gz mygem-0.1.0
  rm -rf mygem-0.1.0

The generated tarball has the following properties:

Files

It contains all the files the gem contains.

Metadata

It contains the gem metadata in a file named ``metadata.yml`` inside the mygem-0.1.0 directory.

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

--git since Debian 11 (Bullseye); --no-check-builddeps since Debian 11 (Bullseye); --no-wnpp-check since Debian 8 (Jessie); --offline since Debian 10 (Buster); --purge since Debian 11 (Bullseye); -d since Debian 11 (Bullseye); -g since Debian 11 (Bullseye); -o since Debian 10 (Buster).

--ruby-versions until Debian 11 (Bullseye).

From gem2deb 2.2.5 in Debian 13 (Trixie). Parsed by carta from the page's man source.