Skip to content

Packaging GEMs

Henne Vogelsang edited this page Sep 21, 2017 · 24 revisions

Installing gem2rpm

In case that you don't have gem2rpm installed, you can find an up to date version in devel:languages:ruby.

Update an existing package

  1. Branch the package you want to update and check it out via osc.

      osc bco devel:languages:ruby:extensions rubygem-foo
    
  2. Fetch the new gem from rubygems.org. If you want to get the newest version, you can run this command:

      gem2rpm -o rubygem-foo.spec --fetch foo
    
  3. Add the new gem and remove the old one.

      rm foo-OLDVERSION.gem
      osc addremove
    
  4. Try a local build to see if it works

      osc build
    
  5. Update the changelog. The upstream changelog can usually be found in the gem sources ('Source Code' link in rubygems.org).

      osc vc
    
  6. Commit/push the changes to the server

      osc commit
    
  7. Submit the patched package to devel:languages:ruby:extensions.

      osc sr
    

    This can also be done in the webui by clicking the 'Submit package' link.

Creating a new package

  1. Branch an existing package from devel:languages:ruby:extensions to have a branch project with the right setup.

      osc bco devel:languages:ruby:extensions rubygem-aasm
    
  2. Create a new package in your branch project checkout

      cd home:YOU:branches:devel:languages:ruby:extensions
      osc mkpac rubygem-foo
    
  3. Follow the 'Patching an existing package' guide.

  4. Copy the standard gem2rpm.yml file from the template

      cp /usr/share/doc/packages/ruby$VERSION-rubygem-gem2rpm/gem2rpm.yml .
    
  5. Ensure that the license of the GEM allows us to package and distribute the gem. Also make sure the license and all relevant metadata (eg. project url) appear in the spec file.

Clone this wiki locally