rubygem-gem2rpm/0005-properly-shorten-description-and-summary.patch
Marcus Rueckert 3240fc8261 - added 0009-No-longer-require-the-ruby-version-inside-the-subpac.patch
No longer require the ruby version inside the subpackage
  With the buildrequires we already make sure that the package is
  only built if we find a recent enough ABI. then the normal
  $interpreter(abi) requires generated by rpm is enough

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=9
2014-10-21 13:15:23 +00:00

59 lines
1.8 KiB
Diff

From da07cd470611c3c6b70fc863e2d82a2862a068e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
Date: Thu, 24 Jul 2014 17:09:35 +0200
Subject: [PATCH 5/9] properly shorten description and summary
This also includes the description if we reuse the summary.
---
lib/gem2rpm.rb | 1 -
lib/gem2rpm/specification.rb | 14 ++++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb
index e5e2693..5261ae1 100644
--- a/lib/gem2rpm.rb
+++ b/lib/gem2rpm.rb
@@ -36,7 +36,6 @@ module Gem2Rpm
# Deprecate, kept just for backward compatibility.
format = Gem2Rpm::Format.new(package)
spec = Gem2Rpm::Specification.new(package.spec)
- spec.description ||= spec.summary
config ||= {}
download_path = ""
unless local
diff --git a/lib/gem2rpm/specification.rb b/lib/gem2rpm/specification.rb
index 9a8d5a1..2e4f7b2 100644
--- a/lib/gem2rpm/specification.rb
+++ b/lib/gem2rpm/specification.rb
@@ -7,6 +7,9 @@ module Gem2Rpm
# A long description of gem wrapped to 78 characters.
def description
d = super.to_s.chomp
+ if d.nil? or d.empty?
+ d=self.__getobj__().summary
+ end
d.gsub!(/([^.])\Z/, "\\1.")
Helpers::word_wrap(d, 78) + "\n"
end
@@ -17,6 +20,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}
--
1.8.4.5