Accepting request 178307 from devel:languages:ruby:extensions

- make sure license.txt is also symlinked

- integrate more of the version into the mod_weight to give
  an easier job to update-alternatives
- use --force in update-alternatives to replace (old) binaries

OBS-URL: https://build.opensuse.org/request/show/178307
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rubygem-gem2rpm?expand=0&rev=8
This commit is contained in:
Stephan Kulow 2013-06-11 04:38:03 +00:00 committed by Git OBS Bridge
parent d97afe0348
commit 12e58c4955
2 changed files with 32 additions and 13 deletions

View File

@ -75,7 +75,7 @@ diff -ru gem2rpm-0.9.2.orig/lib/gem2rpm.rb gem2rpm-0.9.2/lib/gem2rpm.rb
begin
diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/opensuse.spec.erb
--- gem2rpm-0.9.2.orig/templates/opensuse.spec.erb 2013-04-30 13:31:08.586730796 +0200
+++ gem2rpm-0.9.2/templates/opensuse.spec.erb 2013-05-25 22:59:55.229799605 +0200
+++ gem2rpm-0.9.2/templates/opensuse.spec.erb 2013-06-10 12:04:00.205318552 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package rubygem-<%= spec.name %> (Version <%= spec.version %>)
@ -86,7 +86,7 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,58 +15,162 @@
@@ -15,58 +15,169 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@ -101,6 +101,16 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
-License: GPLv2+ or Ruby
-#
+%define mod_full_name %{mod_name}-%{version}
+<% unless spec.executables.empty?
+ versions=spec.version.to_s.split('.')
+ begin v1=Integer(versions[0]) rescue v1=1 end
+ begin v2=Integer(versions[1]) rescue v2=0 end
+ begin v3=Integer(versions[2]) rescue v3=0 end
+ weight=v1*10000+v2*100+v3
+ -%>
+%define mod_branch -%{version}
+%define mod_weight <%= weight %>
+<% end -%>
+
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: rubygems_with_buildroot_patch
@ -116,9 +126,9 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+<% unless req.empty? -%>
+Requires: ruby <%= req %>
+BuildRequires: ruby-devel <%= req %>
+<% end -%>
<% end -%>
-<% for d in spec.dependencies -%>
+<% end -%>
+<% for d in spec.runtime_dependencies -%>
+<% if ['rdoc'].include? d.name.to_s -%>
+# <%= d.name %> <%= d.__getobj__().requirement %>
@ -148,15 +158,13 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+<% end -%>
+Group: Development/Languages/Ruby
+<% unless spec.executables.empty? -%>
+%define mod_branch -%{version}
+%define mod_weight <%= spec.version.to_s.split('.')[0] %>
+PreReq: update-alternatives
+<% end -%>
+
%description
-<%= spec.description %>
+<%= spec.description -%>
+
+<% if spec.has_rdoc -%>
+%package doc
+Summary: RDoc documentation for %{mod_name}
@ -181,11 +189,10 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+ %w(test spec).each { |framework|
+ test_frameworks[framework] = 1 if path.index(framework + "/") == 0
+ }
+ %w(changes copying copying.txt history history.md history.txt legal.rdoc
+ license license.md license.rdoc mit-license changes.txt changes.md changelog.txt history.rdoc changelog.rdoc changelog.md
+ mit-license.txt readme readme.md readme.rdoc readme.txt).each { |file|
+ # $stderr.puts "PATH #{path} #{file}"
+ docdirfiles << path if path.downcase == file
+ %w(changes copying history legal license mit-license changelog readme).each { |file|
+ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '')
+ #$stderr.puts "PATH #{path} #{bpath} #{file}"
+ docdirfiles << path if bpath == file
+ }
+ end
+
@ -199,7 +206,7 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+
+%description testsuite
+Test::Unit or RSpec files, useful for developers.
+
+<% end -%>
%prep
+#gem_unpack
@ -230,7 +237,7 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+
+%post
+<% spec.executables.each do |executable| -%>
+/usr/sbin/update-alternatives --install \
+/usr/sbin/update-alternatives --force --install \
+ %{_bindir}/<%= executable %> <%= executable %> %{_bindir}/<%= executable %>%{mod_branch} %{mod_weight}
+<% end -%>

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Jun 10 10:04:12 UTC 2013 - coolo@suse.com
- make sure license.txt is also symlinked
-------------------------------------------------------------------
Sat Jun 8 06:42:37 UTC 2013 - coolo@suse.com
- integrate more of the version into the mod_weight to give
an easier job to update-alternatives
- use --force in update-alternatives to replace (old) binaries
-------------------------------------------------------------------
Sat May 25 21:00:11 UTC 2013 - coolo@suse.com