-
Notifications
You must be signed in to change notification settings - Fork 440
Packaging GEMs
In releases <= 2.10
we distribute the OBS gems as individual RPM packages. All packages are located in the OBS:Server:$VERSION:Staging project and are prefixed with rubygem-
. Our GEM packages are usually branches from packages in devel:languages:ruby:extensions with a fixed revision.
We have several bots which help us to keep our dependencies up to date.
Coolo runs a bot (factory-auto) every hour that updates the packages and submits them to devel:languages:ruby:extensions. The same bot accepts the submit requests the request 24 hours later, if the build was successful. Of course you can also manually accept the submit request if needed.
Sometimes it is still necessary to package manually (e.g. when you add a new dependency which is not yet packaged). This section covers how to do it.
In case that you don't have gem2rpm installed, you can find an up to date version in devel:languages:ruby.
-
Branch the package you want to update and check it out via osc and check it out.
osc branch devel:languages:ruby:extensions rubygem-foo osc co home:YOU:branches:devel:languages:ruby:extensions/rubygem-foo
-
Fetch the new gem from rubygems.org. If you want to get the newest version, you can run this command:
gem2rpm --fetch foo
-
Add the new gem and remove the old one.
rm foo-OLDVERSION.gem osc addremove
-
Update the spec file.
gem2rpm foo-1.2.3.gem --config gem2rpm.yml > rubygem-foo.spec
-
Try a local build to see if it works
osc build
-
Update the changelog. The upstream changelog can usually be found in the gem sources ('Source Code' link in rubygems.org).
osc vc
-
Submit the changes to the server
osc commit
-
Submit the updated package to devel:languages:ruby:extensions.
osc submitrequest
This can also be done in the webui by clicking the 'Submit package' link.
-
Setup a project branch of devel:languages:ruby:extensions.
Each OBS project has it's own project configuration. To build our package against the right project conf, we need to branch from devel:languages:ruby:extensions first. This can be done with any existing package.
osc branch devel:languages:ruby:extensions rubygem-aasm
-
Create a new package. The name should be rubygem-$gem_name.
cd home:YOU:branches:devel:languages:ruby:extensions osc mkpac rubygem-foo
-
Follow the 'Patching an existing package' guide.
-
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.
When working with gem2rpm, all changes of the spec file should be done via the gem2rpm configuration file. Usually this file is named gem2rpm.yml.
When packaging GEMs it might happen that you need to adjust the spec file, eg. to add missing dependencies or update the license. This short guide will show you how to do this.
-
Make sure there is a gem2rpm configuration file.
Check the sources of your package. If there isn't a configuration file yet, copy it over:
cp /usr/share/doc/packages/ruby$VERSION-rubygem-gem2rpm/gem2rpm.yml .
-
Enable the section you want to adjust and edit it.
:license: Apache
-
Update the spec file.
gem2rpm foo-1.2.3.gem --config gem2rpm.yml > rubygem-foo.spec
Further guides and in-depth information about anything around packaging can be found in the openSUSE WIKI.
- Development Environment Overview
- Development Environment Tips & Tricks
- Spec-Tips
- Code Style
- Rubocop
- Testing with VCR
- Authentication
- Authorization
- Autocomplete
- BS Requests
- Events
- ProjectLog
- Notifications
- Feature Toggles
- Build Results
- Attrib classes
- Flags
- The BackendPackage Cache
- Maintenance classes
- Cloud uploader
- Delayed Jobs
- Staging Workflow
- StatusHistory
- OBS API
- Owner Search
- Search
- Links
- Distributions
- Repository
- Data Migrations
- next_rails
- Ruby Update
- Rails Profiling
- Installing a local LDAP-server
- Remote Pairing Setup Guide
- Factory Dashboard
- osc
- Setup an OBS Development Environment on macOS
- Run OpenQA smoketest locally
- Responsive Guidelines
- Importing database dumps
- Problem Statement & Solution
- Kickoff New Stuff
- New Swagger API doc
- Documentation and Communication
- GitHub Actions
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models