2006-07-17 (Mon)

_ From gems to debs

I have set up scripts [1] that automatically generate Debian packages(*.deb) from gems (*.gem) in rubyforge.org.They are available at

deb http://people.debian.org/~daigo/deb experimental/
deb-src http://people.debian.org/~daigo/deb experimental/

I know this is not complete at all, but it just works.

The Debian package generated is named rubygems-<gem_name>.deb and wrapsthe gem. Installing it by aptitude (apt-get) is very equal to installingthe gem by the rubygems package in Debian (i.e. gem install <gem_name>),meaning that all of the files are installed in /var/lib/gems. You mightexpect that library files and executables go to /usr/lib/ruby/1.8 and/usr/bin respectively and so forth. This can not be done automaticallyas of now.

Pure ruby gems are converted fine. However, ones including C extensionsare not, because Debian libraries on which the gem build-depends have tobe written in the control file in a manual way.

[1] http://alioth.debian.org/projects/pkg-ruby-extras/

They exist in pkg-ruby-extras's svn repository (tools/gemsd/*). Thanksto Akira Yamada who made dh_rubygems.rb to convert a gem to a deb andMarcus Rueckert who made a patch for rubygems --build-root option [http://rubyforge.org/pipermail/rubygems-developers/2006-June/002010.html].

[]