1
0

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 begin
diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/opensuse.spec.erb 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.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 @@ @@ -1,7 +1,7 @@
# #
-# spec file for package rubygem-<%= spec.name %> (Version <%= spec.version %>) -# 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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/ # 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 -License: GPLv2+ or Ruby
-# -#
+%define mod_full_name %{mod_name}-%{version} +%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 BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: rubygems_with_buildroot_patch -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? -%> +<% unless req.empty? -%>
+Requires: ruby <%= req %> +Requires: ruby <%= req %>
+BuildRequires: ruby-devel <%= req %> +BuildRequires: ruby-devel <%= req %>
+<% end -%>
<% end -%> <% end -%>
-<% for d in spec.dependencies -%> -<% for d in spec.dependencies -%>
+<% end -%>
+<% for d in spec.runtime_dependencies -%> +<% for d in spec.runtime_dependencies -%>
+<% if ['rdoc'].include? d.name.to_s -%> +<% if ['rdoc'].include? d.name.to_s -%>
+# <%= d.name %> <%= d.__getobj__().requirement %> +# <%= 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 -%> +<% end -%>
+Group: Development/Languages/Ruby +Group: Development/Languages/Ruby
+<% unless spec.executables.empty? -%> +<% unless spec.executables.empty? -%>
+%define mod_branch -%{version}
+%define mod_weight <%= spec.version.to_s.split('.')[0] %>
+PreReq: update-alternatives +PreReq: update-alternatives
+<% end -%> +<% end -%>
+ +
%description %description
-<%= spec.description %> -<%= spec.description %>
+<%= spec.description -%> +<%= spec.description -%>
+
+<% if spec.has_rdoc -%> +<% if spec.has_rdoc -%>
+%package doc +%package doc
+Summary: RDoc documentation for %{mod_name} +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| + %w(test spec).each { |framework|
+ test_frameworks[framework] = 1 if path.index(framework + "/") == 0 + test_frameworks[framework] = 1 if path.index(framework + "/") == 0
+ } + }
+ %w(changes copying copying.txt history history.md history.txt legal.rdoc + %w(changes copying history legal license mit-license changelog readme).each { |file|
+ license license.md license.rdoc mit-license changes.txt changes.md changelog.txt history.rdoc changelog.rdoc changelog.md + bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '')
+ mit-license.txt readme readme.md readme.rdoc readme.txt).each { |file| + #$stderr.puts "PATH #{path} #{bpath} #{file}"
+ # $stderr.puts "PATH #{path} #{file}" + docdirfiles << path if bpath == file
+ docdirfiles << path if path.downcase == file
+ } + }
+ end + end
+ +
@ -199,7 +206,7 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+ +
+%description testsuite +%description testsuite
+Test::Unit or RSpec files, useful for developers. +Test::Unit or RSpec files, useful for developers.
+
+<% end -%> +<% end -%>
%prep %prep
+#gem_unpack +#gem_unpack
@ -230,7 +237,7 @@ diff -ru gem2rpm-0.9.2.orig/templates/opensuse.spec.erb gem2rpm-0.9.2/templates/
+ +
+%post +%post
+<% spec.executables.each do |executable| -%> +<% 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} + %{_bindir}/<%= executable %> <%= executable %> %{_bindir}/<%= executable %>%{mod_branch} %{mod_weight}
+<% end -%> +<% 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 Sat May 25 21:00:11 UTC 2013 - coolo@suse.com