1
0

Accepting request 159803 from devel:languages:ruby:extensions

- update to 0.8.4 - fixes for fedora 18
- use url for sources

OBS-URL: https://build.opensuse.org/request/show/159803
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rubygem-gem2rpm?expand=0&rev=4
This commit is contained in:
Stephan Kulow 2013-03-20 08:54:16 +00:00 committed by Git OBS Bridge
parent 3dda26a508
commit 65d234e753
6 changed files with 91 additions and 100 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae7b58931e7810c8a04fba98fa456cfaba52b6659f13dbfd74e89d763e7afe12
size 12288

3
gem2rpm-0.8.4.gem Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5fd5d6bd2e1c65d97b295f74def07448212d9227e2149adff39f839ba212bf7
size 12800

View File

@ -19,16 +19,4 @@ Index: gem2rpm-0.8.1/bin/gem2rpm
template = Gem2Rpm::TEMPLATE
else
begin
Index: gem2rpm-0.8.1/lib/gem2rpm/distro.rb
===================================================================
--- gem2rpm-0.8.1.orig/lib/gem2rpm/distro.rb
+++ gem2rpm-0.8.1/lib/gem2rpm/distro.rb
@@ -20,7 +20,7 @@ module Gem2Rpm
else # no version or more versions (=> don't know what to do)
FEDORA
end
- elsif !release_files.grep(/SuSe/).empty?
+ elsif !release_files.grep(/SuSE/).empty?
OPENSUSE
else
DEFAULT

View File

@ -1,7 +1,80 @@
Index: gem2rpm-0.8.1/templates/opensuse.spec.erb
===================================================================
--- gem2rpm-0.8.1.orig/templates/opensuse.spec.erb
+++ gem2rpm-0.8.1/templates/opensuse.spec.erb
diff -ru gem2rpm-0.8.4.orig/bin/gem2rpm gem2rpm-0.8.4/bin/gem2rpm
--- gem2rpm-0.8.4.orig/bin/gem2rpm 2013-03-18 14:10:53.897635829 +0100
+++ gem2rpm-0.8.4/bin/gem2rpm 2013-03-18 14:11:06.853676714 +0100
@@ -122,9 +122,15 @@
if output_file.nil?
Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage) unless deps
else
+ oldfile=IO.readlines(output_file) if File.exists? output_file
+ oldlicense=nil
+ oldfile.each do |line|
+ m = line.match(%r{^License:\s*(\w.*)$})
+ oldlicense = m[1] if m
+ end if oldfile
begin
out = open(output_file, "w")
- Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage)
+ Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, oldlicense)
ensure
out.close()
end
Nur in gem2rpm-0.8.4/bin: gem2rpm.orig.
diff -ru gem2rpm-0.8.4.orig/lib/gem2rpm/specification.rb gem2rpm-0.8.4/lib/gem2rpm/specification.rb
--- gem2rpm-0.8.4.orig/lib/gem2rpm/specification.rb 2013-03-18 14:10:53.897635829 +0100
+++ gem2rpm-0.8.4/lib/gem2rpm/specification.rb 2013-03-18 14:11:06.852676700 +0100
@@ -6,7 +6,11 @@
class Specification < SimpleDelegator
# A long description of gem wrapped to 78 characters.
def description
- Helpers::word_wrap(super.to_s.chomp, 78) + "\n"
+ text=super
+ if text.nil? or text.empty?
+ text=self.__getobj__().summary
+ end
+ Helpers::word_wrap(text.to_s.chomp, 78) + "\n"
end
# A list of Gem::Dependency objects this gem depends on (includes every
@@ -15,6 +19,17 @@
super.map {|d| Gem2Rpm::Dependency.new d}
end
+ # a short summary trimmed to 70 characters
+ def summary
+ text = super
+ if text.length >= 70
+ text = text[0,70].split(/\s/)
+ text = text[0, text.length-1].join(" ")
+ end
+ text = text[0, text.length-1] if text[-1] == '.'
+ text
+ end
+
# List of dependencies that are used for development.
def development_dependencies
super.map {|d| Gem2Rpm::Dependency.new d}
diff -ru gem2rpm-0.8.4.orig/lib/gem2rpm.rb gem2rpm-0.8.4/lib/gem2rpm.rb
--- gem2rpm-0.8.4.orig/lib/gem2rpm.rb 2013-03-18 14:10:53.897635829 +0100
+++ gem2rpm-0.8.4/lib/gem2rpm.rb 2013-03-18 14:11:06.853676714 +0100
@@ -35,11 +35,13 @@
end
def Gem2Rpm.convert(fname, template=TEMPLATE, out=$stdout,
- nongem=true, local=false, doc_subpackage = true)
+ nongem=true, local=false, doc_subpackage = true, oldlicense=nil)
format = Gem::Format.from_file_by_path(fname)
spec = Gem2Rpm::Specification.new(format.spec)
- spec.description ||= spec.summary
download_path = ""
+ if spec.licenses.empty? && oldlicense
+ spec.licenses = oldlicense.split(' and ')
+ end
unless local
begin
download_path = find_download_url(spec.name, spec.version)
diff -ru gem2rpm-0.8.4.orig/templates/opensuse.spec.erb gem2rpm-0.8.4/templates/opensuse.spec.erb
--- gem2rpm-0.8.4.orig/templates/opensuse.spec.erb 2013-03-18 14:10:53.897635829 +0100
+++ gem2rpm-0.8.4/templates/opensuse.spec.erb 2013-03-18 14:11:53.478824020 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package rubygem-<%= spec.name %> (Version <%= spec.version %>)
@ -65,7 +138,7 @@ Index: gem2rpm-0.8.1/templates/opensuse.spec.erb
-#
-Summary: <%= spec.summary.gsub(/\.$/, "") %>
+<% end -%>
+Source: %{mod_full_name}.gem
+Source: http://rubygems.org/gems/%{mod_full_name}.gem
+Summary: <%= spec.summary %>
+<% unless spec.licenses.empty? -%>
+License: <%= spec.licenses.join(" and ") %>
@ -152,79 +225,3 @@ Index: gem2rpm-0.8.1/templates/opensuse.spec.erb
+
+<% end -%>
%changelog
Index: gem2rpm-0.8.1/lib/gem2rpm/specification.rb
===================================================================
--- gem2rpm-0.8.1.orig/lib/gem2rpm/specification.rb
+++ gem2rpm-0.8.1/lib/gem2rpm/specification.rb
@@ -6,7 +6,11 @@ module Gem2Rpm
class Specification < SimpleDelegator
# A long description of gem wrapped to 78 characters.
def description
- Helpers::word_wrap(super.to_s.chomp, 78) + "\n"
+ text=super
+ if text.nil? or text.empty?
+ text=self.__getobj__().summary
+ end
+ Helpers::word_wrap(text.to_s.chomp, 78) + "\n"
end
# A list of Gem::Dependency objects this gem depends on (includes every
@@ -15,6 +19,17 @@ module Gem2Rpm
super.map {|d| Gem2Rpm::Dependency.new d}
end
+ # a short summary trimmed to 70 characters
+ def summary
+ text = super
+ if text.length >= 70
+ text = text[0,70].split(/\s/)
+ text = text[0, text.length-1].join(" ")
+ end
+ text = text[0, text.length-1] if text[-1] == '.'
+ text
+ end
+
# List of dependencies that are used for development.
def development_dependencies
super.map {|d| Gem2Rpm::Dependency.new d}
Index: gem2rpm-0.8.1/lib/gem2rpm.rb
===================================================================
--- gem2rpm-0.8.1.orig/lib/gem2rpm.rb
+++ gem2rpm-0.8.1/lib/gem2rpm.rb
@@ -35,11 +35,13 @@ module Gem2Rpm
end
def Gem2Rpm.convert(fname, template=TEMPLATE, out=$stdout,
- nongem=true, local=false, doc_subpackage = true)
+ nongem=true, local=false, doc_subpackage = true, oldlicense=nil)
format = Gem::Format.from_file_by_path(fname)
spec = Gem2Rpm::Specification.new(format.spec)
- spec.description ||= spec.summary
download_path = ""
+ if spec.licenses.empty? && oldlicense
+ spec.licenses = oldlicense.split(' and ')
+ end
unless local
begin
download_path = find_download_url(spec.name, spec.version)
Index: gem2rpm-0.8.1/bin/gem2rpm
===================================================================
--- gem2rpm-0.8.1.orig/bin/gem2rpm
+++ gem2rpm-0.8.1/bin/gem2rpm
@@ -132,9 +132,15 @@ end
if output_file.nil?
Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage) unless deps
else
+ oldfile=IO.readlines(output_file) if File.exists? output_file
+ oldlicense=nil
+ oldfile.each do |line|
+ m = line.match(%r{^License:\s*(\w.*)$})
+ oldlicense = m[1] if m
+ end if oldfile
begin
out = open(output_file, "w")
- Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage)
+ Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, oldlicense)
ensure
out.close()
end

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Mar 18 13:04:43 UTC 2013 - coolo@suse.com
- update to 0.8.4 - fixes for fedora 18
- use url for sources
-------------------------------------------------------------------
Mon Aug 6 10:54:32 UTC 2012 - coolo@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package rubygem-gem2rpm
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: rubygem-gem2rpm
Version: 0.8.1
Version: 0.8.4
Release: 0
%define mod_name gem2rpm
%define mod_full_name %{mod_name}-%{version}
@ -26,7 +26,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ruby-macros >= 1
%rubygems_requires
Url: https://github.com/lutter/gem2rpm/
Source: %{mod_full_name}.gem
Source: http://rubygems.org/gems/%{mod_full_name}.gem
Source2: gem2rpm-opensuse
Patch0: gem2rpm-fix-opensuse-template.diff
Patch1: gem2rpm-change-default-template.diff