Skip to content

add gem source handler #10

Closed
wants to merge 1 commit into from

4 participants

@ohlol
ohlol commented Jun 11, 2012

I just started using fpm-cookery and would like a uniform interface to building packages. Since I use fpm to build Ruby gems, I hacked this branch together.

I don't know if this is of any value to you. Here's an example recipe:

class RubygemJson173 < FPM::Cookery::Recipe
  description 'This is a JSON implementation as a Ruby extension in C.'

  name 'rubygem-json'
  version '1:1.7.3'
  revision 1
  homepage 'http://www.rubygems.org/'
  source 'http://rubygems.org', :with => :gem, :name => 'json', :version => '1.7.3', :as => 'json-1.7.3.gem'
  sha256 '1070e6cd2fedc0cb06e7e56a980b884bdf6e61a9184abb1c6e677d308b4c26d9'

  section 'ruby'

  def build
    # noop
  end

  def install
    system "gem install --ignore-dependencies --no-rdoc --no-ri --bindir #{destdir}/usr/bin --install-dir=#{destdir}/usr/lib/ruby/gems/1.8 json-1.7.3.gem"
  end
end
@ohlol
ohlol commented Jun 11, 2012

It would be cool to have some of the default fpm functionality in this though, like dependencies etc.

@bernd
Owner
bernd commented Jun 17, 2012

Thanks for your work! I was wondering, wouldn't it be easier to just provide a separate recipe class for rubygems? fpm knows how to handle rubygem sources already. (fpm -s gem -t deb json)

Something like this.

class JSON < FPM::Cookery::RubygemRecipe
  name 'json'
  version '1.7.3'
end

I think that should be enough. (maybe add dependecy handling later) What do you think?

@r4um
r4um commented Oct 29, 2012

+1 for FPM::Cookery::RubygemRecipe.

@smasset smasset referenced this pull request Mar 12, 2013
Merged

Gem Recipes #18

@torrancew

Another :+1: for class-specific overrides - we could extend this out to cover all the various things FPM can input from, so that one can easily define how to build a specific NPM/egg/gem package based off of a main, package-specific base.

@bernd
Owner
bernd commented Aug 19, 2013

Closing this because the gem receipes pull request (#18) has been merged.

@bernd bernd closed this Aug 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.