Gem to rpm converter creates an RPM spec file from a Ruby gem. The project uses the gem metadata to fill out most of the information needed for building an RPM containing the gem.
Run 'gem2rpm --help' for options
At its simplest, download a gem (let's call that file GEM) and run
This will print an rpm spec file based on the information contained in the gem's spec file. In general, it is necessary to edit the generated spec file because the gem is missing some important information that is customarily provided in rpm's, most notably the license and the changelog.
Rather than editing the generated specfile, edit the template from which the specfile is generated. This will make it easier to update the RPM when a new version of the Gem becomes available.
To support this process, it is recommended to first save the default template somewhere:
gem2rpm -T > rubygem-GEM.spec.template
Now, edit the template and then run gem2rpm to generate the spec file using the edited template:
gem2rpm -t rubygem-GEM.spec.template > rubygem-GEM.spec
With that, you can now build your RPM as ususal. When a new version of the gem becomes available, you should edit the saved template and rerun gem2rpm over it.
The template is a standard erb file; there are three main variables available in the template file:
format - The Gem::Format for the gem
spec - The Gem::Specification for the gem (the same as format.spec)
A typical source RPM for a gem should consist of three files: the gem file itself, the template for the spec file and the spec file. To ensure that the template will be included in the source RPM, it must be listed as one of the sources in the spec file.
The resulting rpms should follow the naming convention 'rubygem-$GEM' where GEM is the name of the packaged gem. The default template also makes sure that the resulting package provides 'ruby($GEM)', according to general packaging conventions for scripting languages.
What's New in This Release: [ read full changelog ]
· This release works with newer (post 1.0.0) versions of rubygems.