views:

79

answers:

1

Version 0.6.0 of gem2rpm includes all (development and runtime) dependencies for a given Gem.

Example: Rack Gem (http://rubygems.org/gems/rack) Version 1.1.0 has no runtime dependencies, but six development dependencies.

Console output of gem2rpm --dependencies rack-1.0.1.gem is:

  • rubygem(test-spec) >= 0
  • rubygem(camping) >= 0
  • rubygem(fcgi) >= 0
  • rubygem(memcache-client) >= 0
  • rubygem(mongrel) >= 0
  • rubygem(ruby-openid) >= 2.0.0
  • rubygem(thin) >= 0`

How can I specify to only include runtime dependencies?

I have also opened a ticket on rubyforge.org, but there isn't a lot of activity on that tracker.

Thank you for any hints.

A: 

Sender: Miguel Armas

I also suffered from this bug. I corrected it including only dependencies of type :runtime with the following patch:

--
--- gem2rpm.rb.orig 2010-04-08 00:09:39.794856454 +0100
+++ gem2rpm.rb  2010-04-08 00:27:11.808853058 +0100
@@ -105,10 +105,12 @@
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u}-n)
 Requires: rubygems
 <% for d in spec.dependencies %>
+<% if d.type == :runtime %>
 <% for req in d.version_requirements.to_rpm %>
 Requires: rubygem(<%= d.name %>) <%= req  %>
 <% end %>
 <% end %>
+<% end %>
 BuildRequires: rubygems
 <% if spec.extensions.empty? %>
 BuildArch: noarch
--

I didn't include the :development dependencies as BuildRequires because they are not needed to create the RPM from the SRPM

prunio