Giter VIP home page Giter VIP logo

gem2rpm's Introduction

This package is a first attempt at converting ruby gems to rpm's. Because
of the differences between the two packaging schemes, it is impossible to
come up with a completely automated way of doing the conversion, but the
spec files produced by this package should be good enough for most
pure-ruby gems. I wouldn't put too much hope into automating the gem->rpm
process for gems with binary code such as database drivers. But even for
those, gem2rpm provides a good starting point for the packaging gems as
RPM's.

Installation
============

Download the ruby gem or an RPM (TODO: more detail)

Usage
=====

Run 'gem2rpm --help' for options

At its simplest, download a gem (let's call it GEM) in its latest
version (e.g. 1.2.3):

  $ gem fetch GEM

and run gem2rpm above the downloaded file:

  $ gem2rpm GEM-1.2.3.gem

You can also use the --fetch flag to fetch the (latest) gem before generating the spec file, achieving the same effect as running 'gem fetch GEM' plus 'gem2rpm GEM-1.2.3.gem':

  $ gem2rpm --fetch GEM

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 usual. When a new version of the
gem becomes available, you should edit the saved template and rerun
gem2rpm over it.

Template Details
================

The template is a standard erb file; there are two main variables available
in the template file:
  
  package      - The Gem::Package for the gem
  spec         - The Gem::Specification for the gem (the same as format.spec)

Deprecated:

  format       - The Gem::Format for the gem. Please note that this is kept
                 just for compatibility reasons, since RubyGems 2.0 removed
                 this class.

Conventions
===========

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.

Gem Limitiations
================

Gem has some important limitations that make it next to impossible to
fully automate the gem -> rpm conversion process. Amongst them are
  
  - No license field
  - No changelog
  - No distinction between build and install time (important for gems with
    binary components)
  - Because of its nature as a separate packaging system, gems can not
    capture dependencies on non-gem system components, e.g., the ruby
    PostgreSQL driver can not properly describe its build- and
    runtime-dependencies on the various pieces of the PostgreSQL database

See also
========

Fedora ruby and rubygem packaging guidelines:
  http://fedoraproject.org/wiki/Packaging/Ruby

Project website
  https://github.com/lutter/gem2rpm/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.