Home Wiki > openSUSE:Packaging Ruby
Sign up | Login

Revision as of 12:15, 15 December 2010 by Puzel (Talk | contribs)

openSUSE:Packaging Ruby

tagline: From openSUSE

Hints on how to package Ruby modules

Ruby contributions are recommended to be in the form of gems, Ruby's own package format. Fortunately, the process to package gems for openSUSE is really easy.

A recipe for packaging gems

Make sure you have added (and enabled) the devel:languages:ruby and devel:languages:ruby:extensions repository:

zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_11.3/devel:languages:ruby.repo
zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.3/devel:languages:ruby:extensions.repo
zypper ref
zypper in rubygem-gem2rpm

Add a new package in your home project (or preferably in a subproject like home:$USER:ruby):

osc mkpac rubygem-foo
cd rubygem-foo

Download the respective gem file and generate the RPM spec file:

gem fetch foo
gem2rpm-opensuse foo-1.0.0.gem > rubygem-foo.spec

Edit the specfile as needed, add a changelog entry, build the package locally and commit your package.

vi foo.spec
osc vc
osc build --local
osc vc
osc ci

If you feel your package is ready for wider adoption, file a submitrequest against devel:languages:ruby:extensions build service repository:

osc sr devel:languages:ruby:extensions

That's about it.