tags:

views:

22

answers:

1

I'm creating a gem package with hoe library.

The package shoud do "cd ext/lib/ && make " when "gem install pkg.gem"

How to add task when package installing.

# -*- ruby -*-

require 'rubygems'
require 'hoe'
file ["ext/lib/*.c", "ext/lib/*.h"] do
  Dir.chdir "ext/lib" do
    sh "make"
  end
end

Hoe.spec 'mypackage' do |p|
  p.developer('My.Name.IS.FF', '[email protected]')
  p.rubyforge_name = 'mypackage'
  p.author = 'My.Name.IS.FF'
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
  p.clean_globs = ["ext/lib/*.c", "ext/lib/*.h"]
end
+1  A: 

I think you're asking, "how do I make the 'mypackage' task run make before bundling?" If that's what you mean, I think you want this in your Rakefile:

# -*- ruby -*-

require 'rubygems'
require 'hoe'

task 'compile_binary_components' do
  Dir.chdir "ext/lib" do
  sh "make"
end

Hoe.spec 'mypackage' do |p|
  # as you had this...
end

task 'mypackage' => 'compile_binary_components'
James A. Rosen