Mailinglist Archive: opensuse-ruby (6 mails)

< Previous Next >
Re: [opensuse-ruby] gem2rpm: split off subpackages to reduce rubygem-*.rpm size
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Thu, 16 Dec 2010 15:36:37 +0100
  • Message-id: <20101216143637.GA21678@xxxxxxxxxxxxxxxx>
On Wed, Dec 15, 2010 at 09:38:19PM -0700, Tim Serong wrote:
On 12/15/2010 at 03:43 AM, Martin Vidner <mvidner@xxxxxxx> wrote:
Looks reasonable to me (with the disclaimer that I've just read the
spec and patch, not actually tested it myself).

This should/will also benefit anyone freezing gems/rails into their
apps (e.g.: me :))

Regards,

Tim
Thanks for the review, Tim.

There was a bug for gems with no tests. Attached is a fixed patch
(s/detect/select)
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
--- opensuse.spec.template.os 2010-12-14 16:27:56.000000000 +0100
+++ opensuse.spec.template 2010-12-15 12:35:44.000000000 +0100
@@ -50,6 +50,37 @@
%description
<%= spec.description.to_s.chomp + "\n" %>

+<% if spec.has_rdoc %>
+%package doc
+Summary: RDoc documentation for %{mod_name}
+Group: Development/Languages/Ruby
+License: GPLv2+ or Ruby
+Requires: %{name} = %{version}
+
+%description doc
+Documentation generated at gem installation time.
+Usually in RDoc and RI formats.
+<% end %>
+
+<%
+test_frameworks = %w(test spec).select do |framework|
+ format.file_entries.any? do |entry, data|
+ path = entry['path']
+ path.index(framework + "/") == 0
+ end
+end
+%>
+<% unless test_frameworks.empty? %>
+%package testsuite
+Summary: Test suite for %{mod_name}
+Group: Development/Languages/Ruby
+License: GPLv2+ or Ruby
+Requires: %{name} = %{version}
+
+%description testsuite
+Test::Unit or RSpec files, useful for developers.
+<% end %>
+
%prep
%build
%install
@@ -68,7 +99,23 @@
<% end %>
%{_libdir}/ruby/gems/%{rb_ver}/cache/%{mod_name}-%{version}.gem
%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/
+<% test_frameworks.each do |framework| %>
+%exclude %{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/<%=
framework %>
+<% end %>
%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_name}-%{version}.gemspec
+
+<% if spec.has_rdoc %>
+%files doc
+%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_name}-%{version}/
+<% end %>
+
+<% unless test_frameworks.empty? %>
+%files testsuite
+%defattr(-,root,root,-)
+<% test_frameworks.each do |framework| %>
+%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/<%= framework %>
+<% end %>
+<% end %>

%changelog
< Previous Next >