Duncan Mac-Vicar P.


Easy packaging of ruby gems for openSUSE

with 4 comments

Every distribution has its own conventions to package scripting languages addons (perl modules, ruby gems, etc) as native packages. This allows packages to depend on those addons honoring the package dependencies, and at the same time, look like the addon was installed the scripting language tool (cpan, gem).

openSUSE keeps a repository of gems, thanks to Marcus Rueckert.

For ruby, David Lutterkort (augeas lead developer) created a nice tool to help converting gems into spec files.

I created a template for openSUSE-like rubygem-* packages, and David committed it upstream.

So, to create a package for a gem:

Fetch it:

gem fetch foo

Convert it:

gem2rpm -t opensuse.spec.template ./foo-1.1.gem > rubygem-foo.spec

Build and tweak it. Make sure everything is alright. Some gems work out of the box, some not, but still gem2rpm saves 90% of the effort. Consider submitting it to the project if you are willing to keep it up to date ;-)

Written by duncan

March 17th, 2009 at 12:49 am

Posted in Software

Tagged with ,

4 Responses to 'Easy packaging of ruby gems for openSUSE'

Subscribe to comments with RSS or TrackBack to 'Easy packaging of ruby gems for openSUSE'.

  1. [...] in my last post, I wrote how to easily package gems for openSUSE, saving at least 99% of the work. However, how do you know that you need to package a new gem? [...]

  2. the template is sadly not correct. fixing packages

    darix

    23 Mar 09 at 7:22 pm

  3. the fixed template is now in svn. and we also got a rubygem-gem2rpm in the devel:languages:ruby:extensions project now.

    in the meanwhile i have created some new specs with it. =)

    though for upgrading i still manually edit the spec.

    darix

    7 Apr 09 at 11:57 pm

  4. I just found out that package gem2rpm contains a script called gem2rpm-opensuse which calls gem2rpm with correct parameters so it is no longer needed to specify the parameters manually.

    Pavol Rusnak

    17 Dec 09 at 12:14 pm

Leave a Reply