diff --git a/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch b/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch deleted file mode 100644 index 6bcf227..0000000 --- a/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 91bc63e3fbba24a5f90c4fce4f74b371c4694657 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 16:46:19 +0200 -Subject: [PATCH 01/33] - use the ID from os-release to use the proper template - ---- - bin/gem2rpm | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index 736a645..fa7ce6b 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -67,6 +67,16 @@ opts.separator("") - rest = opts.permute(ARGV) - - template = nil -+if template_file.nil? -+ f = open("/etc/os-release", "r") if File.exists?("/etc/os-release") -+ if f -+ f.read.split('\n').each do |line| -+ line.match(%r{^ID=(.*)$}) { |m| template_file=m[1] } -+ end -+ f.close -+ f = nil -+ end -+end - if template_file.nil? - template = Gem2Rpm::TEMPLATE - else --- -2.26.2 - diff --git a/0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch b/0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch deleted file mode 100644 index 682d066..0000000 --- a/0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 1742038eb7ec8fcb25009ce8b270b420183875bc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 16:54:45 +0200 -Subject: [PATCH 02/33] added basic config file support to gem2rpm in yaml - format. - -There is no validation as it is basically a hash where certain keys are -picked up by our templates. ---- - bin/gem2rpm | 21 +++++++++++++++++++-- - lib/gem2rpm.rb | 3 ++- - 2 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index fa7ce6b..7f28603 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -8,6 +8,7 @@ require 'optparse' - require 'fileutils' - require 'open-uri' - require 'uri' -+require 'yaml' - - opts = OptionParser.new("Usage: #{$0} [OPTIONS] GEM") - opts.separator(" Convert ruby Gems to source RPMs and specfiles") -@@ -23,6 +24,8 @@ deps = false - nongem = false - doc_subpackage = true - fetch = false -+config_file = nil -+config = {} - - opts.separator("") - opts.separator(" Options:") -@@ -58,6 +61,9 @@ end - opts.on("--fetch", "Fetch the gem from rubygems.org") do |val| - fetch = true - end -+opts.on("--config FILE", "Path to gem2rpm.yaml") do |val| -+ config_file = val -+end - opts.separator("") - opts.separator(" Arguments:") - opts.separator(" GEM the path to locally stored gem package file or the name") -@@ -127,13 +133,24 @@ if srpm - end - end - -+if config_file -+ begin -+ config = YAML.load_file(config_file) -+ config[:sources] ||= [] -+ config[:sources] << File.basename(config_file) -+ rescue Exception => ex -+ $stderr.puts "Failed to load config file '#{config_file}': #{ex}" -+ exit 1 -+ end -+end -+ - # Produce a specfile - if output_file.nil? -- Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage) unless deps -+ Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, config) unless deps - else - begin - out = open(output_file, "w") -- Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage) -+ Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, config) - ensure - out.close() - end -diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb -index 017ecd1..e5e2693 100644 ---- a/lib/gem2rpm.rb -+++ b/lib/gem2rpm.rb -@@ -31,12 +31,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, config={}) - package = Gem2Rpm::Package.new(fname) - # 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 - begin --- -2.26.2 - diff --git a/0004-added-example-gem2rpm.yml.patch b/0004-added-example-gem2rpm.yml.patch deleted file mode 100644 index 39a2801..0000000 --- a/0004-added-example-gem2rpm.yml.patch +++ /dev/null @@ -1,92 +0,0 @@ -From f408e57b282cd55d59c1317240ee9e0dc679373c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 17:02:56 +0200 -Subject: [PATCH 04/33] added example gem2rpm.yml - -This patch is edited to remove the Rakefile hunk. Rakefile is not part -of the *.gem ---- - Rakefile | 2 +- - gem2rpm.yml.documentation | 70 +++++++++++++++++++++++++++++++++++++++ - 2 files changed, 71 insertions(+), 1 deletion(-) - create mode 100644 gem2rpm.yml.documentation - -diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation -new file mode 100644 -index 0000000..5e444eb ---- /dev/null -+++ b/gem2rpm.yml.documentation -@@ -0,0 +1,70 @@ -+# --- -+# ## used by gem2rpm -+# :summary: this is a custom summary -+# ## used by gem2rpm -+# :description: |- -+# this is a custom description -+# -+# it can be multiline -+# ## used by gem2rpm -+# :license: MIT or Ruby -+# ## used by gem2rpm and gem_packages -+# :version_suffix: -x_y -+# ## used by gem2rpm and gem_packages -+# :disable_docs: true -+# ## used by gem2rpm -+# :disable_automatic_rdoc_dep: true -+# ## used by gem2rpm -+# :preamble: |- -+# BuildRequires: foobar -+# Requires: foobar -+# ## used by gem2rpm -+# :patches: -+# foo.patch: -p1 -+# bar.patch: -+# ## used by gem2rpm -+# :sources: -+# - foo.desktop -+# - bar.desktop -+# :gem_install_args: '....' -+# ## used by gem2rpm -+# :pre_install: |- -+# %if 0%{?use_system_libev} -+# export USE_VENDORED_LIBEV="no" -+# %endif -+# ## used by gem2rpm -+# :post_install: |- -+# # delete custom files here or do other fancy stuff -+# install -D -m 0644 %{S:1} %{buildroot}%{_bindir}/gem2rpm-opensuse -+# ## used by gem2rpm -+# :testsuite_command: |- -+# (pushd %{buildroot}%{gem_base}/gems/%{mod_full_name} && rake test) -+# ## used by gem2rpm -+# :filelist: |- -+# /usr/bin/gem2rpm-opensuse -+# ## used by gem2rpm -+# :scripts: -+# :post: |- -+# /bin/echo foo -+# ## used by gem_packages -+# :main: -+# :preamble: |- -+# Requires: util-linux -+# Recommends: pwgen -+# :filelist: |- -+# /usr/bin/gem2rpm-opensuse -+# ## used by gem_packages -+# :custom: -+# apache: -+# :preamble: |- -+# Requires: ..... -+# :filelist: |- -+# /etc/apache2/conf.d/passenger.conf -+# :summary: Custom summary is optional -+# :description: |- -+# Custom description is optional -+# -+# bar -+# :post: |- -+# /bin/echo foo -+# --- -2.26.2 - diff --git a/0005-properly-shorten-description-and-summary.patch b/0005-properly-shorten-description-and-summary.patch deleted file mode 100644 index cecd183..0000000 --- a/0005-properly-shorten-description-and-summary.patch +++ /dev/null @@ -1,58 +0,0 @@ -From da07cd470611c3c6b70fc863e2d82a2862a068e4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 17:09:35 +0200 -Subject: [PATCH 05/33] 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} --- -2.26.2 - diff --git a/0006-Preserve-the-license-header-found-in-the-output-file.patch b/0006-Preserve-the-license-header-found-in-the-output-file.patch deleted file mode 100644 index 84feae5..0000000 --- a/0006-Preserve-the-license-header-found-in-the-output-file.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0f22d81f982e02523c852521a5b94db657fe6673 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 17:17:33 +0200 -Subject: [PATCH 06/33] Preserve the license header found in the output file - ---- - bin/gem2rpm | 13 +++++++++++-- - lib/gem2rpm.rb | 5 ++++- - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index 7f28603..8a6db05 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -145,12 +145,21 @@ if config_file - end - - # Produce a specfile -+oldlicense = nil - if output_file.nil? -- Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, config) unless deps -+ Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, oldlicense, config) unless deps - else - begin -+ if File.exists?(output_file) -+ File.open(output_file, 'r') do |oldfile| -+ oldfile.each_line do |line| -+ m = line.match(%r{^License:\s*(\w.*)$}) -+ oldlicense = m[1] if m -+ end -+ end -+ end - out = open(output_file, "w") -- Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, config) -+ Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, oldlicense, config) - ensure - out.close() - end -diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb -index 5261ae1..d30e0f6 100644 ---- a/lib/gem2rpm.rb -+++ b/lib/gem2rpm.rb -@@ -31,11 +31,14 @@ module Gem2Rpm - end - - def Gem2Rpm.convert(fname, template=TEMPLATE, out=$stdout, -- nongem=true, local=false, doc_subpackage = true, config={}) -+ nongem=true, local=false, doc_subpackage = true, oldlicense=nil, config={}) - package = Gem2Rpm::Package.new(fname) - # Deprecate, kept just for backward compatibility. - format = Gem2Rpm::Format.new(package) - spec = Gem2Rpm::Specification.new(package.spec) -+ if spec.licenses.empty? && oldlicense -+ spec.licenses = oldlicense.split(' and ') -+ end - config ||= {} - download_path = "" - unless local --- -2.26.2 - diff --git a/0007-fixes-for-the-opensuse-template.patch b/0007-fixes-for-the-opensuse-template.patch deleted file mode 100644 index 17c1160..0000000 --- a/0007-fixes-for-the-opensuse-template.patch +++ /dev/null @@ -1,56 +0,0 @@ -From eed51b54253c303c593d9466ed8ed17523bda3d1 Mon Sep 17 00:00:00 2001 -From: Stephan Kulow -Date: Wed, 15 Oct 2014 10:38:29 +0200 -Subject: [PATCH 07/33] fixes for the opensuse template: - -- add one more space for sources -- add empty lines in front of the warning preamble - otherwise format_spec_file - removes it as old license comment -- don't %ghost %_bindir ---- - templates/gem_packages.spec.erb | 6 +++--- - templates/opensuse.spec.erb | 4 +++- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index d1734db..058660b 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -173,9 +173,9 @@ fi - <% end -%> - <% spec.executables.each do |executable| -%> - <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> --%ghost <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> --%ghost <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> --%ghost <%= rb_bindir %>/<%= executable %> -+<%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> -+<%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> -+<%= rb_bindir %>/<%= executable %> - %ghost <%= rb_sysconfdir %>/alternatives/<%= executable %> - %ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}#{rb_suffix}" %> - %ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}-#{spec.version}" %> -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 25fdec3..8bc281c 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -15,6 +15,8 @@ - # Please submit bugfixes or comments via http://bugs.opensuse.org/ - # - <% if config && not(config.empty?) -%> -+ -+ - # - # This file was generated with a gem2rpm.yml and not just plain gem2rpm. - # All sections marked as MANUAL, license headers, summaries and descriptions -@@ -74,7 +76,7 @@ Url: <%= spec.homepage %> - Source: http://rubygems.org/gems/%{mod_full_name}.gem - <% if config[:sources] - config[:sources].each_with_index do |src, i| -%> --Source<%= i+1 %>: <%= src %> -+Source<%= i+1 %>: <%= src %> - <% end - end -%> - <% if config[:patches] -%> --- -2.26.2 - diff --git a/0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch b/0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch deleted file mode 100644 index 554a6b5..0000000 --- a/0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ba7932c7d7bc6a70a45ac6ebb841a9e1bf8bb86b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Tue, 21 Oct 2014 14:54:55 +0200 -Subject: [PATCH 08/33] do not use not(). not supported on 1.8 e.g. - ---- - templates/gem_packages.spec.erb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 058660b..94d4005 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -96,7 +96,7 @@ PreReq: update-alternatives - %description -n <%= pkg_basename %><%= config[:version_suffix] %> - <%= config[:description] or spec.description -%> - --<% if spec.has_rdoc && not(config[:disable_docs]) -%> -+<% if spec.has_rdoc && !(config[:disable_docs]) -%> - %package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> - Summary: RDoc documentation for <%= spec.name %> - Group: Development/Languages/Ruby -@@ -191,7 +191,7 @@ fi - <% end -%> - <%= gem_spec_dir %>/<%= mod_full_name -%>.gemspec - --<% if spec.has_rdoc && not(config[:disable_docs]) -%> -+<% if spec.has_rdoc && !(config[:disable_docs]) -%> - %files -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> - %defattr(-,root,root,-) - %doc <%= gem_doc_dir %> --- -2.26.2 - diff --git a/0009-No-longer-require-the-ruby-version-inside-the-subpac.patch b/0009-No-longer-require-the-ruby-version-inside-the-subpac.patch deleted file mode 100644 index a72f01a..0000000 --- a/0009-No-longer-require-the-ruby-version-inside-the-subpac.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 13b02a1596a744ed70687dae0ffb465e1979221e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Tue, 21 Oct 2014 15:13:31 +0200 -Subject: [PATCH 09/33] 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 ---- - templates/gem_packages.spec.erb | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 94d4005..29873e5 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -77,11 +77,6 @@ - #/ruby2.1 - %> - %package -n <%= pkg_basename %><%= config[:version_suffix] %> --<% for req in spec.required_ruby_version -%> --<% unless req.empty? -%> --Requires: <%= rb_pkgname %> <%= req %> --<% end -%> --<% end -%> - # MANUAL - <% if config[:main] && config[:main][:preamble] -%> - <%= config[:main][:preamble] %> --- -2.26.2 - diff --git a/0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch b/0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch deleted file mode 100644 index 1b19a1c..0000000 --- a/0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 953ff66677490c78ceff14afc0365f832079333a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Tue, 21 Oct 2014 17:55:23 +0200 -Subject: [PATCH 10/33] Try to load rbconfigpackagingsupport and fail - gracefully if not available - -The file will patch ruby_install_name on unversioned ruby installations. ---- - templates/gem_packages.spec.erb | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 29873e5..a6ab58b 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -1,4 +1,9 @@ - <% -+ -+ begin -+ require 'rbconfigpackagingsupport' -+ rescue LoadError => ex -+ end - def self.patch_mod_full_name(path, mod_full_name) - path.gsub(/\/-/, "/#{mod_full_name}") - end --- -2.26.2 - diff --git a/0011-Add-support-for-scripts-pre-post-for-subpackages.patch b/0011-Add-support-for-scripts-pre-post-for-subpackages.patch deleted file mode 100644 index 11c3b83..0000000 --- a/0011-Add-support-for-scripts-pre-post-for-subpackages.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0ee368bc6c4ea35d233dadbe1f2c7048a99d3dc4 Mon Sep 17 00:00:00 2001 -From: Theo chatzimichos -Date: Fri, 5 Dec 2014 17:11:47 +0200 -Subject: [PATCH 11/33] Add support for :scripts: (pre/post) for subpackages - -With this commit we can add pre/post/(etc) scripts in gem2rpm.yml for -subpackages, as in the example below: - -:custom_pkgs: - apache: - :scripts: - :pre: |- - some_command - :post: - another_command ---- - templates/opensuse.spec.erb | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 8bc281c..af04eaf 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -209,6 +209,17 @@ This package holds the <%= custom_pkg_name %> sub package for <%= spec.name -%> - %defattr(-,root,root,-) - <%= data[:filelist] %> - -+<% if data[:scripts] -+ if data[:scripts].is_a? Hash -+ data[:scripts].each do |section, content| -%> -+%<%=section %> <%=custom_pkg_name %> -+<%= content %> -+ -+<% end -+ end -+ end -+-%> -+ - <% end - end - -%> --- -2.26.2 - diff --git a/0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch b/0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch deleted file mode 100644 index 42376ec..0000000 --- a/0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 092f7ca4ff1f954dd8982acf7199cd15636e87f3 Mon Sep 17 00:00:00 2001 -From: Theo Chatzimichos -Date: Fri, 5 Dec 2014 17:16:41 +0200 -Subject: [PATCH 12/33] typo in gem2rpm.yml.documentation: :custom_pkgs: - instead of :custom: - ---- - gem2rpm.yml.documentation | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation -index 5e444eb..376eacd 100644 ---- a/gem2rpm.yml.documentation -+++ b/gem2rpm.yml.documentation -@@ -54,7 +54,7 @@ - # :filelist: |- - # /usr/bin/gem2rpm-opensuse - # ## used by gem_packages --# :custom: -+# :custom_pkgs: - # apache: - # :preamble: |- - # Requires: ..... --- -2.26.2 - diff --git a/0013-Also-tag-LICENSE-MIT-as-docfile.patch b/0013-Also-tag-LICENSE-MIT-as-docfile.patch deleted file mode 100644 index 785f03c..0000000 --- a/0013-Also-tag-LICENSE-MIT-as-docfile.patch +++ /dev/null @@ -1,40 +0,0 @@ -From dad615aa35cbbe0d7351ea66af44a8548853a2da Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Mon, 12 Jan 2015 15:34:26 +0100 -Subject: [PATCH 13/33] Also tag LICENSE-MIT as docfile - -Some packages (e.g. rubygem-http_parser) name it that way ---- - templates/gem_packages.spec.erb | 2 +- - templates/opensuse.spec.erb | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index a6ab58b..15500a0 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -120,7 +120,7 @@ Usually in RDoc and RI formats. - %w(test spec).each { |framework| - test_frameworks[framework] = 1 if path.index(framework + "/") == 0 - } -- %w(changes copying history legal license mit-license changelog readme).each { |file| -+ %w(changes copying history legal license license-mit 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 -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index af04eaf..8eb7fee 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -110,7 +110,7 @@ PreReq: update-alternatives - %w(test spec).each { |framework| - test_frameworks[framework] = 1 if path.index(framework + "/") == 0 - } -- %w(changes copying history legal license mit-license changelog readme).each { |file| -+ %w(changes copying history legal license license-mit 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 --- -2.26.2 - diff --git a/0014-Refactor-into-multiple-lines.patch b/0014-Refactor-into-multiple-lines.patch deleted file mode 100644 index 9a06529..0000000 --- a/0014-Refactor-into-multiple-lines.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 5bb494a7d6911754e485f6b729861771181bf2a0 Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Mon, 12 Jan 2015 15:51:08 +0100 -Subject: [PATCH 14/33] Refactor into multiple lines - -Makes this easier to extend/read imho. ---- - templates/gem_packages.spec.erb | 11 ++++++++++- - templates/opensuse.spec.erb | 11 ++++++++++- - 2 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 15500a0..d3a43fd 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -120,7 +120,16 @@ Usually in RDoc and RI formats. - %w(test spec).each { |framework| - test_frameworks[framework] = 1 if path.index(framework + "/") == 0 - } -- %w(changes copying history legal license license-mit mit-license changelog readme).each { |file| -+ %w(changes -+ copying -+ history -+ legal -+ license -+ license-mit -+ 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 -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 8eb7fee..88e7356 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -110,7 +110,16 @@ PreReq: update-alternatives - %w(test spec).each { |framework| - test_frameworks[framework] = 1 if path.index(framework + "/") == 0 - } -- %w(changes copying history legal license license-mit mit-license changelog readme).each { |file| -+ %w(changes -+ copying -+ history -+ legal -+ license -+ license-mit -+ 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 --- -2.26.2 - diff --git a/0015-Add-licence-to-the-list-of-license-files-as-well.patch b/0015-Add-licence-to-the-list-of-license-files-as-well.patch deleted file mode 100644 index 5b22229..0000000 --- a/0015-Add-licence-to-the-list-of-license-files-as-well.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b10341f5c13d71271e195101e46213026f628048 Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Mon, 12 Jan 2015 15:52:34 +0100 -Subject: [PATCH 15/33] Add 'licence' to the list of license files as well - -This is a misspelling, but seems to be common enough still ---- - templates/gem_packages.spec.erb | 1 + - templates/opensuse.spec.erb | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index d3a43fd..b772d02 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -124,6 +124,7 @@ Usually in RDoc and RI formats. - copying - history - legal -+ licence - license - license-mit - mit-license -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 88e7356..8d14e38 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -114,6 +114,7 @@ PreReq: update-alternatives - copying - history - legal -+ licence - license - license-mit - mit-license --- -2.26.2 - diff --git a/0016-add-two-more-ways-to-express-changes.patch b/0016-add-two-more-ways-to-express-changes.patch deleted file mode 100644 index a917d7a..0000000 --- a/0016-add-two-more-ways-to-express-changes.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 814a7133ce8ab7271cf0bf31ad6d4de94fec8863 Mon Sep 17 00:00:00 2001 -From: Stephan Kulow -Date: Wed, 11 Feb 2015 02:05:31 +0100 -Subject: [PATCH 16/33] add two more ways to express changes - ---- - templates/gem_packages.spec.erb | 2 ++ - templates/opensuse.spec.erb | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index b772d02..0cd92e2 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -129,6 +129,8 @@ Usually in RDoc and RI formats. - license-mit - mit-license - changelog -+ news -+ release_notes - readme - ).each { |file| - bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 8d14e38..b1251c5 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -119,6 +119,8 @@ PreReq: update-alternatives - license-mit - mit-license - changelog -+ news -+ release_notes - readme - ).each { |file| - bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') --- -2.26.2 - diff --git a/0017-.markdown-is-also-seen-in-the-wild.patch b/0017-.markdown-is-also-seen-in-the-wild.patch deleted file mode 100644 index 9adbe80..0000000 --- a/0017-.markdown-is-also-seen-in-the-wild.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 660fa598f3a78f94f35e1edf10d143dae5db62bb Mon Sep 17 00:00:00 2001 -From: Stephan Kulow -Date: Wed, 11 Feb 2015 02:30:14 +0100 -Subject: [PATCH 17/33] .markdown is also seen in the wild - ---- - templates/gem_packages.spec.erb | 2 +- - templates/opensuse.spec.erb | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 0cd92e2..9e2e877 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -133,7 +133,7 @@ Usually in RDoc and RI formats. - release_notes - readme - ).each { |file| -- bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') -+ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '').gsub(%r{\.markdown$}, '') - #$stderr.puts "PATH #{path} #{bpath} #{file}" - docdirfiles << path if bpath == file - } -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index b1251c5..a5f34c6 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -123,7 +123,7 @@ PreReq: update-alternatives - release_notes - readme - ).each { |file| -- bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') -+ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '').gsub(%r{\.markdown$}, '') - #$stderr.puts "PATH #{path} #{bpath} #{file}" - docdirfiles << path if bpath == file - } --- -2.26.2 - diff --git a/0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch b/0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch deleted file mode 100644 index 070249c..0000000 --- a/0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7a45c828d05304d90b3a202e55acbbcaab5cdac2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Fri, 13 Mar 2015 03:24:25 +0100 -Subject: [PATCH 18/33] Only use the extensions doc dir on MRI 2.1.x - ---- - templates/gem_packages.spec.erb | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 9e2e877..80e552e 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -14,6 +14,9 @@ - end - - def self.get_extension_doc_dir(gem_spec) -+ # TODO: This is kinda ugly but it does the job for now. -+ rv = Gem::Version.new(RUBY_VERSION) -+ return nil unless RUBY_ENGINE=='ruby' && (Gem::Version.new('2.2.0') > rv && rv > Gem::Version.new('2.1.0')) - if gem_spec.respond_to?(:extensions_dir) && RUBY_ENGINE != 'rbx' - rp = gem_spec.extensions_dir.rpartition(gem_spec.base_dir) - return File.join(rp[1], 'doc', rp[2]) --- -2.26.2 - diff --git a/0019-Cleaner-solution-for-the-extensions-doc-dir.patch b/0019-Cleaner-solution-for-the-extensions-doc-dir.patch deleted file mode 100644 index 4d939a9..0000000 --- a/0019-Cleaner-solution-for-the-extensions-doc-dir.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 672a0405c2c191280887b4427a759490aa2ce5ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Fri, 13 Mar 2015 14:53:04 +0100 -Subject: [PATCH 19/33] Cleaner solution for the extensions doc dir - -The other solution was also failing on 1.8 ---- - templates/gem_packages.spec.erb | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 80e552e..661539a 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -14,10 +14,8 @@ - end - - def self.get_extension_doc_dir(gem_spec) -- # TODO: This is kinda ugly but it does the job for now. -- rv = Gem::Version.new(RUBY_VERSION) -- return nil unless RUBY_ENGINE=='ruby' && (Gem::Version.new('2.2.0') > rv && rv > Gem::Version.new('2.1.0')) -- if gem_spec.respond_to?(:extensions_dir) && RUBY_ENGINE != 'rbx' -+ return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by? Gem.ruby_version -+ if gem_spec.respond_to?(:extensions_dir) - rp = gem_spec.extensions_dir.rpartition(gem_spec.base_dir) - return File.join(rp[1], 'doc', rp[2]) - end --- -2.26.2 - diff --git a/0020-Ruby-1.8-insists-on-the-for-the-parameter.patch b/0020-Ruby-1.8-insists-on-the-for-the-parameter.patch deleted file mode 100644 index 8191304..0000000 --- a/0020-Ruby-1.8-insists-on-the-for-the-parameter.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f6ace6130df3a2ea6ca8e987e9675d652940510e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Fri, 13 Mar 2015 15:06:01 +0100 -Subject: [PATCH 20/33] Ruby 1.8 insists on the () for the parameter - ---- - templates/gem_packages.spec.erb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 661539a..6add6a7 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -14,7 +14,7 @@ - end - - def self.get_extension_doc_dir(gem_spec) -- return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by? Gem.ruby_version -+ return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by?(Gem.ruby_version) - if gem_spec.respond_to?(:extensions_dir) - rp = gem_spec.extensions_dir.rpartition(gem_spec.base_dir) - return File.join(rp[1], 'doc', rp[2]) --- -2.26.2 - diff --git a/0021-Fix-company-name-in-copyright-header.patch b/0021-Fix-company-name-in-copyright-header.patch deleted file mode 100644 index 6115351..0000000 --- a/0021-Fix-company-name-in-copyright-header.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2d02399fc670b648785b10bf7f1510c136e6f981 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 16 Apr 2015 23:49:01 +0200 -Subject: [PATCH 21/33] Fix company name in copyright header - ---- - templates/opensuse.spec.erb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index a5f34c6..57bf9ff 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -1,7 +1,7 @@ - # - # spec file for package rubygem-<%= spec.name %><%= config[:version_suffix] %> - # --# Copyright (c) <%= Time.now.year %> SUSE LINUX Products GmbH, Nuernberg, Germany. -+# Copyright (c) <%= Time.now.year %> SUSE LINUX GmbH, Nuernberg, Germany. - # - # All modifications and additions to the file contributed by third parties - # remain the property of their copyright owners, unless otherwise agreed --- -2.26.2 - diff --git a/0022-add-the-touch-for-build-compare-to-the-template.patch b/0022-add-the-touch-for-build-compare-to-the-template.patch deleted file mode 100644 index 2ae6fcc..0000000 --- a/0022-add-the-touch-for-build-compare-to-the-template.patch +++ /dev/null @@ -1,24 +0,0 @@ -From f8c0600c659f26d1ec6c9d890a63dd642f741003 Mon Sep 17 00:00:00 2001 -From: Stephan Kulow -Date: Wed, 6 Apr 2016 08:00:27 +0200 -Subject: [PATCH 22/33] add the touch for build-compare to the template - ---- - templates/opensuse.spec.erb | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 57bf9ff..22c4647 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -137,6 +137,7 @@ PreReq: update-alternatives - <% config[:patches].each_with_index do |patch, i| -%> - %patch<%= i %> <%= patch[1] if patch[1] %> - <% end -%> -+find -type f -print0 | xargs -0 touch -r %{S:0} - %gem_build - <% end -%> - --- -2.26.2 - diff --git a/0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch b/0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch deleted file mode 100644 index 1b20d3c..0000000 --- a/0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ee81c7f09669db9e6898df5bf36ac6c102d0d615 Mon Sep 17 00:00:00 2001 -From: Thomas Bechtold -Date: Mon, 18 Jul 2016 10:12:29 +0200 -Subject: [PATCH 23/33] Also tag APACHE-LICENSE-2.0 as docfile - -Some packages (e.g. rubygem-apipie-rails) name it that way ---- - templates/opensuse.spec.erb | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 22c4647..5b62b26 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -118,6 +118,8 @@ PreReq: update-alternatives - license - license-mit - mit-license -+ apache-license-2.0 -+ license-apache-2.0 - changelog - news - release_notes --- -2.26.2 - diff --git a/0024-add-ability-to-provide-alternative-main-Source.patch b/0024-add-ability-to-provide-alternative-main-Source.patch deleted file mode 100644 index 81107e1..0000000 --- a/0024-add-ability-to-provide-alternative-main-Source.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3888b107af6ce5721ff40abe2bedcede1893732b Mon Sep 17 00:00:00 2001 -From: Theo Chatzimichos -Date: Tue, 23 Aug 2016 23:49:40 +0200 -Subject: [PATCH 24/33] add ability to provide alternative main Source - -this is useful in cases where the gem is not taken from rubygems.org ---- - templates/opensuse.spec.erb | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 5b62b26..ae2d458 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -73,7 +73,11 @@ BuildRequires: update-alternatives - <% unless spec.homepage.nil? || spec.homepage.empty? -%> - Url: <%= spec.homepage %> - <% end -%> -+<% if config[:sourceurl] -%> -+Source: <%= config[:sourceurl] %> -+<% else -%> - Source: http://rubygems.org/gems/%{mod_full_name}.gem -+<% end -%> - <% if config[:sources] - config[:sources].each_with_index do |src, i| -%> - Source<%= i+1 %>: <%= src %> --- -2.26.2 - diff --git a/0025-allow-running-commands-after-patching.patch b/0025-allow-running-commands-after-patching.patch deleted file mode 100644 index b165afe..0000000 --- a/0025-allow-running-commands-after-patching.patch +++ /dev/null @@ -1,44 +0,0 @@ -From e9601db421071203202ddb0122e8826859238e73 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 10 Nov 2016 15:46:22 +0100 -Subject: [PATCH 25/33] allow running commands after patching - -but before we actually rebuild the gem. -needed for libv8 gem. ---- - gem2rpm.yml.documentation | 2 ++ - templates/opensuse.spec.erb | 5 +++++ - 2 files changed, 7 insertions(+) - -diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation -index 376eacd..fbed82e 100644 ---- a/gem2rpm.yml.documentation -+++ b/gem2rpm.yml.documentation -@@ -22,6 +22,8 @@ - # :patches: - # foo.patch: -p1 - # bar.patch: -+# :post_patch: -+# if you need to fiddle with the source dir before rebuilding the gem - # ## used by gem2rpm - # :sources: - # - foo.desktop -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index ae2d458..e6e9a1a 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -143,6 +143,11 @@ PreReq: update-alternatives - <% config[:patches].each_with_index do |patch, i| -%> - %patch<%= i %> <%= patch[1] if patch[1] %> - <% end -%> -+<% if config[:post_patch] -%> -+# MANUAL -+<%= config[:post_patch] %> -+# /MANUAL -+<% end -%> - find -type f -print0 | xargs -0 touch -r %{S:0} - %gem_build - <% end -%> --- -2.26.2 - diff --git a/0026-use-https-instead-of-http-for-rubygems.org.patch b/0026-use-https-instead-of-http-for-rubygems.org.patch deleted file mode 100644 index bbe9ac2..0000000 --- a/0026-use-https-instead-of-http-for-rubygems.org.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 304e55ea06e789e41683351c3eca7e8f20619201 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 10 Nov 2016 18:16:23 +0100 -Subject: [PATCH 26/33] use https instead of http for rubygems.org - ---- - bin/gem2rpm | 2 +- - templates/opensuse.spec.erb | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index 8a6db05..45ed21c 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -111,7 +111,7 @@ gemfile = rest[0] - - if fetch - gem_uri = '' -- open("http://rubygems.org/api/v1/gems/#{gemfile}.json") do |f| -+ open("https://rubygems.org/api/v1/gems/#{gemfile}.json") do |f| - gem_uri = f.read.match(/"gem_uri":\s*"(.*?)",/m)[1] - gemfile = URI.parse(gem_uri).path.split('/').last - open(gemfile, 'w') do |gf| -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index e6e9a1a..b070745 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -76,7 +76,7 @@ Url: <%= spec.homepage %> - <% if config[:sourceurl] -%> - Source: <%= config[:sourceurl] %> - <% else -%> --Source: http://rubygems.org/gems/%{mod_full_name}.gem -+Source: https://rubygems.org/gems/%{mod_full_name}.gem - <% end -%> - <% if config[:sources] - config[:sources].each_with_index do |src, i| -%> --- -2.26.2 - diff --git a/0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch b/0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch deleted file mode 100644 index beab3c8..0000000 --- a/0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5ed4ebe4fce32e32c75019aa4ac01b78e22c2e44 Mon Sep 17 00:00:00 2001 -From: Johannes Kastl -Date: Fri, 3 Nov 2017 14:46:39 +0100 -Subject: [PATCH 27/33] quote version_suffix in gem2rpm.yml.documentation to - avoid wrong package names - ---- - gem2rpm.yml.documentation | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation -index fbed82e..bb4893d 100644 ---- a/gem2rpm.yml.documentation -+++ b/gem2rpm.yml.documentation -@@ -9,7 +9,7 @@ - # ## used by gem2rpm - # :license: MIT or Ruby - # ## used by gem2rpm and gem_packages --# :version_suffix: -x_y -+# :version_suffix: '-x_y' - # ## used by gem2rpm and gem_packages - # :disable_docs: true - # ## used by gem2rpm --- -2.26.2 - diff --git a/0028-add-binary_map-support.patch b/0028-add-binary_map-support.patch deleted file mode 100644 index 4aa429e..0000000 --- a/0028-add-binary_map-support.patch +++ /dev/null @@ -1,89 +0,0 @@ -From fdf7e5ceb4c165babfb7486fe6640faa21ab5e12 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Wed, 6 Jun 2018 16:15:39 +0200 -Subject: [PATCH 28/33] add binary_map support - ---- - gem2rpm.yml.documentation | 2 ++ - templates/gem_packages.spec.erb | 24 ++++++++++++++++-------- - 2 files changed, 18 insertions(+), 8 deletions(-) - -diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation -index bb4893d..5b9e4e3 100644 ---- a/gem2rpm.yml.documentation -+++ b/gem2rpm.yml.documentation -@@ -28,6 +28,8 @@ - # :sources: - # - foo.desktop - # - bar.desktop -+# :binary_map: -+# annotate: annotate-rb - # :gem_install_args: '....' - # ## used by gem2rpm - # :pre_install: |- -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 6add6a7..4861bbd 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -30,6 +30,13 @@ - weight=v1*10000+v2*100+v3 - end - -+ def self.map_executable(config, executable) -+ if not(config[:binary_map].nil? and config[:binary_map][executable].nil?) -+ executable=config[:binary_map][executable] -+ end -+ executable -+ end -+ - def self.filecontent_or_value(path) - (path and File.exists?(path)) ? File.read(path) : path - end -@@ -93,6 +100,7 @@ Group: Development/Languages/Ruby - <% unless spec.executables.empty? -%> - PreReq: update-alternatives - <% end -%> -+Enhances: <%= rb_pkgname %> - - %description -n <%= pkg_basename %><%= config[:version_suffix] %> - <%= config[:description] or spec.description -%> -@@ -157,19 +165,19 @@ Test::Unit or RSpec files, useful for developers. - %post -n <%= pkg_basename %><%= config[:version_suffix] %> - <% spec.executables.each do |executable| -%> - /usr/sbin/update-alternatives --install \ -- <%= rb_bindir %>/<%= executable %> <%= executable %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> -+ <%= rb_bindir %>/<%= map_executable(config, executable) %> <%= map_executable(config, executable) %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> - /usr/sbin/update-alternatives --install \ -- <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> -+ <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> - /usr/sbin/update-alternatives --install \ -- <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> -+ <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> - <% end -%> - - %preun -n <%= pkg_basename %><%= config[:version_suffix] %> - if [ "$1" = 0 ] ; then - <% spec.executables.each do |executable| -%> -- /usr/sbin/update-alternatives --remove <%= executable %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -- /usr/sbin/update-alternatives --remove <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -- /usr/sbin/update-alternatives --remove <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+ /usr/sbin/update-alternatives --remove <%= map_executable(config, executable) %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+ /usr/sbin/update-alternatives --remove <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+ /usr/sbin/update-alternatives --remove <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> - <% end -%> - fi - <% end -%> -@@ -188,8 +196,8 @@ fi - <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> - <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> - <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> --<%= rb_bindir %>/<%= executable %> --%ghost <%= rb_sysconfdir %>/alternatives/<%= executable %> -+<%= rb_bindir %>/<%= map_executable(config, executable) %> -+%ghost <%= rb_sysconfdir %>/alternatives/<%= map_executable(config, executable) %> - %ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}#{rb_suffix}" %> - %ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}-#{spec.version}" %> - <% end -%> --- -2.26.2 - diff --git a/0029-Use-or-for-the-conditions-instead-of-and.patch b/0029-Use-or-for-the-conditions-instead-of-and.patch deleted file mode 100644 index d1c6e23..0000000 --- a/0029-Use-or-for-the-conditions-instead-of-and.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 04d2ef0c24748dd4120d1cc3a7b08d5c963dc100 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Wed, 6 Jun 2018 16:40:15 +0200 -Subject: [PATCH 29/33] Use "or" for the conditions instead of and - ---- - templates/gem_packages.spec.erb | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 4861bbd..b704b91 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -31,7 +31,8 @@ - end - - def self.map_executable(config, executable) -- if not(config[:binary_map].nil? and config[:binary_map][executable].nil?) -+ if not(config[:binary_map].nil? or -+ config[:binary_map][executable].nil?) - executable=config[:binary_map][executable] - end - executable --- -2.26.2 - diff --git a/0030-gem_package.spec.erb-sync-with-ruby-common.patch b/0030-gem_package.spec.erb-sync-with-ruby-common.patch deleted file mode 100644 index ddbf5fa..0000000 --- a/0030-gem_package.spec.erb-sync-with-ruby-common.patch +++ /dev/null @@ -1,77 +0,0 @@ -From c4557ce4aa7e0f67e5c249c255fe0c0c5df8f793 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Wed, 6 Jun 2018 17:15:35 +0200 -Subject: [PATCH 30/33] gem_package.spec.erb: sync with ruby-common - -Also drop the Enhances change that sneaked in by accident ---- - templates/gem_packages.spec.erb | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index b704b91..257c719 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -62,6 +62,8 @@ - end - - rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '') -+ # TODO: "ruby" hardcoded here is wrong. it should support jruby/rubinius or so -+ rb_abi = "ruby:#{RbConfig::CONFIG['ruby_version']}" - rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '') - if rb_suffix =~ /\A\d+\.\d+\z/ - rb_suffix = '.ruby' + rb_suffix -@@ -78,6 +80,7 @@ - gem_spec = Gem::Specification.new - gem_base_dir = patch_libdir(gem_spec.base_dir) - gem_cache_dir = patch_libdir(gem_spec.cache_dir) -+ gem_build_info_dir = patch_libdir(gem_spec.build_info_dir) - gem_gems_dir = patch_libdir(gem_spec.gems_dir) - gem_spec_dir = patch_libdir(gem_spec.spec_dir) - gem_bin_dir = patch_libdir(patch_mod_full_name(gem_spec.bin_dir , mod_full_name )) -@@ -101,7 +104,6 @@ Group: Development/Languages/Ruby - <% unless spec.executables.empty? -%> - PreReq: update-alternatives - <% end -%> --Enhances: <%= rb_pkgname %> - - %description -n <%= pkg_basename %><%= config[:version_suffix] %> - <%= config[:description] or spec.description -%> -@@ -110,7 +112,7 @@ Enhances: <%= rb_pkgname %> - %package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> - Summary: RDoc documentation for <%= spec.name %> - Group: Development/Languages/Ruby --Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> -+Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> - - %description -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> - Documentation generated at gem installation time. -@@ -155,7 +157,7 @@ Usually in RDoc and RI formats. - %package -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> - Summary: Test suite for <%= spec.name %> - Group: Development/Languages/Ruby --Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> -+Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> - - %description -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> - Test::Unit or RSpec files, useful for developers. -@@ -205,6 +207,7 @@ fi - # cache file - <%= gem_cache_dir %>/<%= mod_full_name %>.gem - <%= gem_gem_dir %> -+<%= gem_build_info_dir %> - <% unless spec.extensions.empty? or gem_extension_dir.nil? -%> - <%= gem_extension_dir %> - <% end -%> -@@ -240,7 +243,7 @@ fi - Summary: <%= custom_pkg_name %> sub package for <%= spec.name %> - Group: Development/Languages/Ruby - <% end %> --Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> -+Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> - %description -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %> - <% if data[:description] and data[:description] != '' -%> - <%= data[:description] %> --- -2.26.2 - diff --git a/0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch b/0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch deleted file mode 100644 index 5de9108..0000000 --- a/0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7fa4f56a2a55278e95510d1663c495fa733d7780 Mon Sep 17 00:00:00 2001 -From: Johannes Kastl -Date: Sat, 21 Jul 2018 23:13:35 +0200 -Subject: [PATCH 31/33] use template opensuse on openSUSE Tumbleweed, where - /etc/os-release contains ID="opensuse-tumbleweed" - ---- - bin/gem2rpm | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index 45ed21c..1298798 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -82,6 +82,10 @@ if template_file.nil? - f.close - f = nil - end -+ if template_file.eql? '"opensuse-tumbleweed"' -+ $stderr.puts 'Using template opensuse on Tumbleweed' -+ template_file = 'opensuse' -+ end - end - if template_file.nil? - template = Gem2Rpm::TEMPLATE --- -2.26.2 - diff --git a/0032-Replace-no-rdoc-no-ri-with-no-document.patch b/0032-Replace-no-rdoc-no-ri-with-no-document.patch deleted file mode 100644 index ab6d2d9..0000000 --- a/0032-Replace-no-rdoc-no-ri-with-no-document.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9adb19584120941300dc8269f6a8563eb85b1a1c Mon Sep 17 00:00:00 2001 -From: Stephan Kulow -Date: Sat, 23 Feb 2019 07:45:40 +0100 -Subject: [PATCH 32/33] Replace --no-rdoc --no-ri with --no-document - ---- - templates/opensuse.spec.erb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index b070745..4bcc224 100644 ---- a/templates/opensuse.spec.erb -+++ b/templates/opensuse.spec.erb -@@ -165,7 +165,7 @@ find -type f -print0 | xargs -0 touch -r %{S:0} - <%= config[:gem_install_args] %> \ - <% end -%> - <% if config[:disable_docs] -%> -- --no-rdoc --no-ri \ -+ --no-document \ - <% end -%> - <% unless spec.executables.empty? -%> - --symlink-binaries \ --- -2.26.2 - diff --git a/0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch b/0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch deleted file mode 100644 index c585b2f..0000000 --- a/0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a55b215427daffb082518545a4617bf04ce013bf Mon Sep 17 00:00:00 2001 -From: Martin Vidner -Date: Wed, 7 Dec 2022 11:05:25 +0100 -Subject: [PATCH 33/33] Use File.exist? instead of File.exists? which was - removed in Ruby 3.2 - -https://www.ruby-lang.org/en/news/2022/12/06/ruby-3-2-0-rc1-released/ - -> Removed methods -> -> The following deprecated methods are removed. -> - ... -> - File.exists? [Feature 17391] ---- - bin/gem2rpm | 6 +++--- - templates/gem_packages.spec.erb | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/bin/gem2rpm b/bin/gem2rpm -index 1298798..059e953 100755 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -74,7 +74,7 @@ rest = opts.permute(ARGV) - - template = nil - if template_file.nil? -- f = open("/etc/os-release", "r") if File.exists?("/etc/os-release") -+ f = open("/etc/os-release", "r") if File.exist?("/etc/os-release") - if f - f.read.split('\n').each do |line| - line.match(%r{^ID=(.*)$}) { |m| template_file=m[1] } -@@ -91,7 +91,7 @@ if template_file.nil? - template = Gem2Rpm::TEMPLATE - else - begin -- f = open(template_file, "r") if File.exists?(template_file) -+ f = open(template_file, "r") if File.exist?(template_file) - f = open(File.join(Gem2Rpm.template_dir, template_file + '.spec.erb'), "r") unless f - rescue Errno::ENOENT - $stderr.puts "Could not open template #{template_file}. Aborting" -@@ -154,7 +154,7 @@ if output_file.nil? - Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, oldlicense, config) unless deps - else - begin -- if File.exists?(output_file) -+ if File.exist?(output_file) - File.open(output_file, 'r') do |oldfile| - oldfile.each_line do |line| - m = line.match(%r{^License:\s*(\w.*)$}) -diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb -index 257c719..4f9447c 100644 ---- a/templates/gem_packages.spec.erb -+++ b/templates/gem_packages.spec.erb -@@ -39,7 +39,7 @@ - end - - def self.filecontent_or_value(path) -- (path and File.exists?(path)) ? File.read(path) : path -+ (path and File.exist?(path)) ? File.read(path) : path - end - - def self.parse_custom_pkgs(env_value) --- -2.26.2 - diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation deleted file mode 100644 index d9d13dc..0000000 --- a/gem2rpm.yml.documentation +++ /dev/null @@ -1,76 +0,0 @@ -# --- -# ## used by gem2rpm -# :summary: this is a custom summary -# ## used by gem2rpm -# :description: |- -# this is a custom description -# -# it can be multiline -# ## used by gem2rpm -# :license: MIT or Ruby -# ## used by gem2rpm and gem_packages -# :version_suffix: -x_y -# ## used by gem2rpm and gem_packages -# :disable_docs: true -# ## used by gem2rpm -# :disable_automatic_rdoc_dep: true -# ## used by gem2rpm -# :preamble: |- -# BuildRequires: foobar -# Requires: foobar -# ## used by gem2rpm -# :patches: -# foo.patch: -p1 -# bar.patch: -# :post_patch: -# if you need to fiddle with the source dir before rebuilding the gem -# ## used by gem2rpm -# :sources: -# - foo.desktop -# - bar.desktop -# :gem_install_args: '....' -# ## used by gem2rpm -# :pre_install: |- -# %if 0%{?use_system_libev} -# export USE_VENDORED_LIBEV="no" -# %endif -# ## used by gem2rpm -# :post_install: |- -# # delete custom files here or do other fancy stuff -# install -D -m 0644 %{S:1} %{buildroot}%{_bindir}/gem2rpm-opensuse -# ## used by gem2rpm -# :testsuite_command: |- -# (pushd %{buildroot}%{gem_base}/gems/%{mod_full_name} && rake test) -# ## used by gem2rpm -# :filelist: |- -# /usr/bin/gem2rpm-opensuse -# ## used by gem2rpm -# :scripts: -# :post: |- -# /bin/echo foo -# ## used by gem_packages -# :main: -# :preamble: |- -# Requires: util-linux -# Recommends: pwgen -# :filelist: |- -# /usr/bin/gem2rpm-opensuse -# ## used by gem_packages -# :custom_pkgs: -# apache: -# :preamble: |- -# Requires: ..... -# :filelist: |- -# /etc/apache2/conf.d/passenger.conf -# :summary: Custom summary is optional -# :description: |- -# Custom description is optional -# -# bar -# :post: |- -# /bin/echo foo -# :preamble: |- -# %if 0%{?suse_version} && 0%{?suse_version} < 1330 -# %define rb_build_versions ruby24 ruby25 -# %define rb_default_ruby_abi ruby:2.4.0 ruby:2.5.0 -# %endif diff --git a/rubygem-gem2rpm.changes b/rubygem-gem2rpm.changes index fce8cfc..4331ca8 100644 --- a/rubygem-gem2rpm.changes +++ b/rubygem-gem2rpm.changes @@ -1,3 +1,104 @@ +------------------------------------------------------------------- +Fri Dec 27 04:49:23 UTC 2024 - Marcus Rueckert + +- update filelist for the final 3.4.0 api_version + +------------------------------------------------------------------- +Fri Dec 13 13:21:20 UTC 2024 - Marcus Rueckert + +- Fix filelist for 3.4.0 + +------------------------------------------------------------------- +Thu Dec 12 19:22:27 UTC 2024 - Marcus Rueckert + +- enable ruby3.4 support + +------------------------------------------------------------------- +Tue Oct 8 10:52:39 UTC 2024 - Marcus Rueckert + +- update suse.patch: + handle ERB.new for older ruby versions + +------------------------------------------------------------------- +Tue Oct 8 00:26:29 UTC 2024 - Marcus Rueckert + +- update suse.patch and sync in ruby-common/gem_packages.spec.erb + +------------------------------------------------------------------- +Mon Oct 7 23:08:35 UTC 2024 - Marcus Rueckert + +- remove gem2rpm.yml.documentation as it is now in the git tree and + therefor part of the suse.patch + +------------------------------------------------------------------- +Mon Oct 7 23:06:16 UTC 2024 - Marcus Rueckert + +- replaced all patches with suse.patch generated with + update-suse-patch.sh + + 0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch + 0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch + 0003-new-opensuse-templates.-they-require-the-config-file.patch + 0004-added-example-gem2rpm.yml.patch + 0005-properly-shorten-description-and-summary.patch + 0006-Preserve-the-license-header-found-in-the-output-file.patch + 0007-fixes-for-the-opensuse-template.patch + 0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch + 0009-No-longer-require-the-ruby-version-inside-the-subpac.patch + 0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch + 0011-Add-support-for-scripts-pre-post-for-subpackages.patch + 0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch + 0013-Also-tag-LICENSE-MIT-as-docfile.patch + 0014-Refactor-into-multiple-lines.patch + 0015-Add-licence-to-the-list-of-license-files-as-well.patch + 0016-add-two-more-ways-to-express-changes.patch + 0017-.markdown-is-also-seen-in-the-wild.patch + 0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch + 0019-Cleaner-solution-for-the-extensions-doc-dir.patch + 0020-Ruby-1.8-insists-on-the-for-the-parameter.patch + 0021-Fix-company-name-in-copyright-header.patch + 0022-add-the-touch-for-build-compare-to-the-template.patch + 0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch + 0024-add-ability-to-provide-alternative-main-Source.patch + 0025-allow-running-commands-after-patching.patch + 0026-use-https-instead-of-http-for-rubygems.org.patch + 0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch + 0028-add-binary_map-support.patch + 0029-Use-or-for-the-conditions-instead-of-and.patch + 0030-gem_package.spec.erb-sync-with-ruby-common.patch + 0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch + 0032-Replace-no-rdoc-no-ri-with-no-document.patch + 0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch + 0034-plugin-dir.patch + 0035-fix-patch-syntax.patch + template_loader.patch + +------------------------------------------------------------------- +Fri Feb 23 13:07:37 UTC 2024 - Marcus Rueckert + +- Added 0034-plugin-dir.patch + - also own the new gem plugin dir +- Added 0035-fix-patch-syntax.patch: + Fix patch syntax for the upcoming rpm 4.20 + +------------------------------------------------------------------- +Mon Dec 25 07:15:47 UTC 2023 - Marcus Rueckert + +- Update the ruby ABI version in the 3.3.0 paths to the final + string. + +------------------------------------------------------------------- +Thu Sep 14 14:57:00 UTC 2023 - Marcus Rueckert + +- enable building for ruby 3.3 + +------------------------------------------------------------------- +Mon May 8 19:40:38 UTC 2023 - Software System + +- add BuildRequires: ruby-common >= 3.2 + This version is required to rebuild the package. The older + ruby-common is no longer sufficient. + ------------------------------------------------------------------- Fri Feb 3 16:04:04 UTC 2023 - Marcus Rueckert diff --git a/rubygem-gem2rpm.spec b/rubygem-gem2rpm.spec index 7b710bd..443c09f 100644 --- a/rubygem-gem2rpm.spec +++ b/rubygem-gem2rpm.spec @@ -1,7 +1,7 @@ # # spec file for package rubygem-gem2rpm # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,11 +29,15 @@ %bcond_with ruby24 %endif %bcond_with ruby25 +%if ! (0%{?suse_version} == 1550) %bcond_with ruby26 +%endif %bcond_with ruby27 %bcond_with ruby30 %bcond_with ruby31 %bcond_with ruby32 +%bcond_with ruby33 +%bcond_with ruby34 %bcond_with rubinius25 Name: rubygem-gem2rpm @@ -50,51 +54,17 @@ BuildRequires: ruby-macros >= 5 %else BuildRequires: %{rubygem gem2rpm} %endif +BuildRequires: ruby-common >= 3.2 BuildRequires: update-alternatives URL: https://github.com/lutter/gem2rpm/ Source: http://rubygems.org/gems/%{mod_full_name}.gem -Source1: gem2rpm.yml.documentation +Source1: update-suse-patch.sh Source2: gem2rpm-opensuse Source3: series -Patch01: 0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch -Patch02: 0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch -Patch03: 0003-new-opensuse-templates.-they-require-the-config-file.patch -Patch04: 0004-added-example-gem2rpm.yml.patch -Patch05: 0005-properly-shorten-description-and-summary.patch -Patch06: 0006-Preserve-the-license-header-found-in-the-output-file.patch -Patch07: 0007-fixes-for-the-opensuse-template.patch -Patch08: 0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch -Patch09: 0009-No-longer-require-the-ruby-version-inside-the-subpac.patch -Patch10: 0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch -Patch11: 0011-Add-support-for-scripts-pre-post-for-subpackages.patch -Patch12: 0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch -Patch13: 0013-Also-tag-LICENSE-MIT-as-docfile.patch -Patch14: 0014-Refactor-into-multiple-lines.patch -Patch15: 0015-Add-licence-to-the-list-of-license-files-as-well.patch -Patch16: 0016-add-two-more-ways-to-express-changes.patch -Patch17: 0017-.markdown-is-also-seen-in-the-wild.patch -Patch18: 0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch -Patch19: 0019-Cleaner-solution-for-the-extensions-doc-dir.patch -Patch20: 0020-Ruby-1.8-insists-on-the-for-the-parameter.patch -Patch21: 0021-Fix-company-name-in-copyright-header.patch -Patch22: 0022-add-the-touch-for-build-compare-to-the-template.patch -Patch23: 0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch -Patch24: 0024-add-ability-to-provide-alternative-main-Source.patch -Patch25: 0025-allow-running-commands-after-patching.patch -Patch26: 0026-use-https-instead-of-http-for-rubygems.org.patch -Patch27: 0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch -Patch28: 0028-add-binary_map-support.patch -Patch29: 0029-Use-or-for-the-conditions-instead-of-and.patch -Patch30: 0030-gem_package.spec.erb-sync-with-ruby-common.patch -Patch31: 0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch -Patch32: 0032-Replace-no-rdoc-no-ri-with-no-document.patch -Patch33: 0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch -Patch128: template_loader.patch +Patch01: suse.patch Summary: Generate rpm specfiles from gems License: GPL-2.0-or-later Group: Development/Languages/Ruby -Requires(post): update-alternatives -Requires(preun):update-alternatives %description Generate source rpms and rpm spec files from a Ruby Gem. @@ -102,40 +72,7 @@ The spec file tries to follow the gem as closely as possible %prep %gem_unpack -%patch01 -p1 -%patch02 -p1 -%patch03 -p1 -%patch04 -p1 -%patch05 -p1 -%patch06 -p1 -%patch07 -p1 -%patch08 -p1 -%patch09 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 -%patch30 -p1 -%patch31 -p1 -%patch32 -p1 -%patch33 -p1 -%patch128 -p1 +%autopatch -p1 %build perl -p -i -e 's|("templates/opensuse.spec.erb".freeze)|$1, "templates/gem_packages.spec.erb".freeze|g' *gemspec @@ -144,7 +81,7 @@ perl -p -i -e 's|("templates/opensuse.spec.erb".freeze)|$1, "templates/gem_packa %install %gem_install -f -N --symlink-binaries --doc-files="AUTHORS LICENSE README" for i in %{buildroot}%{_docdir}/*rubygem-gem2rpm*/ ; do - install -m 0644 %{S:1} $i/gem2rpm.yml + install -m 0644 gem2rpm-%{version}/gem2rpm.yml.documentation $i/gem2rpm.yml done %if %{with gem2rpm_bootstrap} @@ -153,7 +90,7 @@ done Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.1-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -211,7 +148,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby1.8-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -269,7 +206,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby1.9-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -327,7 +264,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.0-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -385,7 +322,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.2-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -443,7 +380,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.3-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -501,7 +438,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.4-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -559,7 +496,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.5-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -617,7 +554,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.6-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -675,7 +612,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby2.7-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -733,7 +670,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby3.0-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -791,7 +728,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby3.1-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -849,7 +786,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n ruby3.2-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. @@ -902,6 +839,122 @@ fi %endif %endif +%if %{with ruby33} +%package -n ruby3.3-rubygem-gem2rpm +Summary: Generate rpm specfiles from gems +Group: Development/Languages/Ruby +Requires(post): update-alternatives +Requires(preun): update-alternatives + +%description -n ruby3.3-rubygem-gem2rpm +Generate source rpms and rpm spec files from a Ruby Gem. +The spec file tries to follow the gem as closely as possible + +%package -n ruby3.3-rubygem-gem2rpm-doc +Summary: RDoc documentation for %{mod_name} +Group: Development/Languages/Ruby +Requires: ruby3.3-rubygem-gem2rpm = %{version} + +%description -n ruby3.3-rubygem-gem2rpm-doc +Documentation generated at gem installation time. +Usually in RDoc and RI formats. + +%post -n ruby3.3-rubygem-gem2rpm +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby3.3-%{version} %{mod_weight} +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.3-%{version} %{mod_weight} +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm.ruby3.3 gem2rpm.ruby3.3 %{_bindir}/gem2rpm.ruby3.3-%{version} %{mod_weight} + +%preun -n ruby3.3-rubygem-gem2rpm +if [ "$1" = 0 ] ; then + /usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby3.3-%{version} + /usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.3-%{version} + /usr/sbin/update-alternatives --remove gem2rpm.ruby3.3 %{_bindir}/gem2rpm.ruby3.3-%{version} +fi + +%files -n ruby3.3-rubygem-gem2rpm +%defattr(-,root,root,-) +%{_docdir}/ruby3.3-rubygem-gem2rpm +#{_bindir}/gem2rpm-opensuse +%{_bindir}/gem2rpm.ruby3.3-%{version} +%ghost %{_bindir}/gem2rpm.ruby3.3 +%ghost %{_bindir}/gem2rpm-%{version} +%ghost %{_bindir}/gem2rpm +%ghost %{_sysconfdir}/alternatives/gem2rpm +%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby3.3 +%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version} +# cache file +%{_libdir}/ruby/gems/3.3.0/cache/gem2rpm-%{version}.gem +%{_libdir}/ruby/gems/3.3.0/gems/gem2rpm-%{version} +%{_libdir}/ruby/gems/3.3.0/specifications/gem2rpm-%{version}.gemspec + +%if %{with docs} +%files -n ruby3.3-rubygem-gem2rpm-doc +%defattr(-,root,root,-) +%doc %{_libdir}/ruby/gems/3.3.0/doc/gem2rpm-%{version} +%endif +%endif + +%if %{with ruby34} +%package -n ruby3.4-rubygem-gem2rpm +Summary: Generate rpm specfiles from gems +Group: Development/Languages/Ruby +Requires(post): update-alternatives +Requires(preun): update-alternatives + +%description -n ruby3.4-rubygem-gem2rpm +Generate source rpms and rpm spec files from a Ruby Gem. +The spec file tries to follow the gem as closely as possible + +%package -n ruby3.4-rubygem-gem2rpm-doc +Summary: RDoc documentation for %{mod_name} +Group: Development/Languages/Ruby +Requires: ruby3.4-rubygem-gem2rpm = %{version} + +%description -n ruby3.4-rubygem-gem2rpm-doc +Documentation generated at gem installation time. +Usually in RDoc and RI formats. + +%post -n ruby3.4-rubygem-gem2rpm +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby3.4-%{version} %{mod_weight} +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.4-%{version} %{mod_weight} +/usr/sbin/update-alternatives --install \ + %{_bindir}/gem2rpm.ruby3.4 gem2rpm.ruby3.4 %{_bindir}/gem2rpm.ruby3.4-%{version} %{mod_weight} + +%preun -n ruby3.4-rubygem-gem2rpm +if [ "$1" = 0 ] ; then + /usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby3.4-%{version} + /usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.4-%{version} + /usr/sbin/update-alternatives --remove gem2rpm.ruby3.4 %{_bindir}/gem2rpm.ruby3.4-%{version} +fi + +%files -n ruby3.4-rubygem-gem2rpm +%defattr(-,root,root,-) +%{_docdir}/ruby3.4-rubygem-gem2rpm +#{_bindir}/gem2rpm-opensuse +%{_bindir}/gem2rpm.ruby3.4-%{version} +%ghost %{_bindir}/gem2rpm.ruby3.4 +%ghost %{_bindir}/gem2rpm-%{version} +%ghost %{_bindir}/gem2rpm +%ghost %{_sysconfdir}/alternatives/gem2rpm +%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby3.4 +%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version} +# cache file +%{_libdir}/ruby/gems/3.4.0/cache/gem2rpm-%{version}.gem +%{_libdir}/ruby/gems/3.4.0/gems/gem2rpm-%{version} +%{_libdir}/ruby/gems/3.4.0/specifications/gem2rpm-%{version}.gemspec + +%if %{with docs} +%files -n ruby3.4-rubygem-gem2rpm-doc +%defattr(-,root,root,-) +%doc %{_libdir}/ruby/gems/3.4.0/doc/gem2rpm-%{version} +%endif +%endif + %if %{with rubinius25} %package -n rbx2.5-rubygem-gem2rpm # MANUAL @@ -909,7 +962,7 @@ fi Summary: Generate rpm specfiles from gems Group: Development/Languages/Ruby Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives %description -n rbx2.5-rubygem-gem2rpm Generate source rpms and rpm spec files from a Ruby Gem. diff --git a/series b/series index 2db1c5a..703ff3e 100644 --- a/series +++ b/series @@ -1,32 +1 @@ -0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch -p1 -0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch -p1 -0003-new-opensuse-templates.-they-require-the-config-file.patch -p1 -0004-added-example-gem2rpm.yml.patch -p1 -0005-properly-shorten-description-and-summary.patch -p1 -0006-Preserve-the-license-header-found-in-the-output-file.patch -p1 -0007-fixes-for-the-opensuse-template.patch -p1 -0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch -p1 -0009-No-longer-require-the-ruby-version-inside-the-subpac.patch -p1 -0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch -p1 -0011-Add-support-for-scripts-pre-post-for-subpackages.patch -p1 -0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch -p1 -0013-Also-tag-LICENSE-MIT-as-docfile.patch -p1 -0014-Refactor-into-multiple-lines.patch -p1 -0015-Add-licence-to-the-list-of-license-files-as-well.patch -p1 -0016-add-two-more-ways-to-express-changes.patch -p1 -0017-.markdown-is-also-seen-in-the-wild.patch -p1 -0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch -p1 -0019-Cleaner-solution-for-the-extensions-doc-dir.patch -p1 -0020-Ruby-1.8-insists-on-the-for-the-parameter.patch -p1 -0021-Fix-company-name-in-copyright-header.patch -p1 -0022-add-the-touch-for-build-compare-to-the-template.patch -p1 -0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch -p1 -0024-add-ability-to-provide-alternative-main-Source.patch -p1 -0025-allow-running-commands-after-patching.patch -p1 -0026-use-https-instead-of-http-for-rubygems.org.patch -p1 -0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch -p1 -0028-add-binary_map-support.patch -p1 -0029-Use-or-for-the-conditions-instead-of-and.patch -p1 -0030-gem_package.spec.erb-sync-with-ruby-common.patch -p1 -0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch -p1 -0032-Replace-no-rdoc-no-ri-with-no-document.patch -p1 +suse.patch diff --git a/0003-new-opensuse-templates.-they-require-the-config-file.patch b/suse.patch similarity index 51% rename from 0003-new-opensuse-templates.-they-require-the-config-file.patch rename to suse.patch index b815162..67d4e58 100644 --- a/0003-new-opensuse-templates.-they-require-the-config-file.patch +++ b/suse.patch @@ -1,35 +1,311 @@ -From 5e1e30e5addc99825b3bf873983ca48732493060 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcus=20R=C3=BCckert?= -Date: Thu, 24 Jul 2014 16:55:57 +0200 -Subject: [PATCH 03/33] new opensuse templates. they require the config file - support. - ---- - templates/gem_packages.spec.erb | 236 ++++++++++++++++++++++++++++++++ - templates/opensuse.spec.erb | 213 +++++++++++++++++++++++----- - 2 files changed, 414 insertions(+), 35 deletions(-) - create mode 100644 templates/gem_packages.spec.erb - +diff --git a/bin/gem2rpm b/bin/gem2rpm +index 736a645..a794436 100755 +--- a/bin/gem2rpm ++++ b/bin/gem2rpm +@@ -8,6 +8,7 @@ require 'optparse' + require 'fileutils' + require 'open-uri' + require 'uri' ++require 'yaml' + + opts = OptionParser.new("Usage: #{$0} [OPTIONS] GEM") + opts.separator(" Convert ruby Gems to source RPMs and specfiles") +@@ -23,6 +24,8 @@ deps = false + nongem = false + doc_subpackage = true + fetch = false ++config_file = nil ++config = {} + + opts.separator("") + opts.separator(" Options:") +@@ -58,6 +61,9 @@ end + opts.on("--fetch", "Fetch the gem from rubygems.org") do |val| + fetch = true + end ++opts.on("--config FILE", "Path to gem2rpm.yaml") do |val| ++ config_file = val ++end + opts.separator("") + opts.separator(" Arguments:") + opts.separator(" GEM the path to locally stored gem package file or the name") +@@ -67,11 +73,25 @@ opts.separator("") + rest = opts.permute(ARGV) + + template = nil ++if template_file.nil? ++ f = open("/etc/os-release", "r") if File.exist?("/etc/os-release") ++ if f ++ f.read.split('\n').each do |line| ++ line.match(%r{^ID=(.*)$}) { |m| template_file=m[1] } ++ end ++ f.close ++ f = nil ++ end ++ if template_file.match? '^"opensuse' ++ $stderr.puts 'Using template opensuse on openSUSE variant' ++ template_file = 'opensuse' ++ end ++end + if template_file.nil? + template = Gem2Rpm::TEMPLATE + else + begin +- f = open(template_file, "r") if File.exists?(template_file) ++ f = open(template_file, "r") if File.exist?(template_file) + f = open(File.join(Gem2Rpm.template_dir, template_file + '.spec.erb'), "r") unless f + rescue Errno::ENOENT + $stderr.puts "Could not open template #{template_file}. Aborting" +@@ -95,7 +115,7 @@ gemfile = rest[0] + + if fetch + gem_uri = '' +- open("http://rubygems.org/api/v1/gems/#{gemfile}.json") do |f| ++ open("https://rubygems.org/api/v1/gems/#{gemfile}.json") do |f| + gem_uri = f.read.match(/"gem_uri":\s*"(.*?)",/m)[1] + gemfile = URI.parse(gem_uri).path.split('/').last + open(gemfile, 'w') do |gf| +@@ -117,13 +137,33 @@ if srpm + end + end + ++if config_file ++ begin ++ config = YAML.load_file(config_file) ++ config[:sources] ||= [] ++ config[:sources] << File.basename(config_file) ++ rescue Exception => ex ++ $stderr.puts "Failed to load config file '#{config_file}': #{ex}" ++ exit 1 ++ end ++end ++ + # Produce a specfile ++oldlicense = nil + if output_file.nil? +- Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage) unless deps ++ Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, oldlicense, config) unless deps + else + begin ++ if File.exist?(output_file) ++ File.open(output_file, 'r') do |oldfile| ++ oldfile.each_line do |line| ++ m = line.match(%r{^License:\s*(\w.*)$}) ++ oldlicense = m[1] if m ++ end ++ end ++ end + out = open(output_file, "w") +- Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage) ++ Gem2Rpm::convert(gemfile, template, out, nongem, local, doc_subpackage, oldlicense, config) + ensure + out.close() + end +diff --git a/gem2rpm.yml.documentation b/gem2rpm.yml.documentation +new file mode 100644 +index 0000000..2d4adf0 +--- /dev/null ++++ b/gem2rpm.yml.documentation +@@ -0,0 +1,76 @@ ++# --- ++# ## used by gem2rpm ++# :summary: this is a custom summary ++# ## used by gem2rpm ++# :description: |- ++# this is a custom description ++# ++# it can be multiline ++# ## used by gem2rpm ++# :license: MIT or Ruby ++# :additional_copyrights: ++# - 2006-2024 darix was here ++# ## used by gem2rpm and gem_packages ++# :version_suffix: '-x.y' ++# ## used by gem2rpm and gem_packages ++# :disable_docs: true ++# ## used by gem2rpm ++# :disable_automatic_rdoc_dep: true ++# ## used by gem2rpm ++# :preamble: |- ++# BuildRequires: foobar ++# Requires: foobar ++# ## used by gem2rpm ++# :patches: ++# foo.patch: -p1 ++# bar.patch: ++# :post_patch: ++# if you need to fiddle with the source dir before rebuilding the gem ++# ## used by gem2rpm ++# :sources: ++# - foo.desktop ++# - bar.desktop ++# :binary_map: ++# annotate: annotate-rb ++# :gem_install_args: '....' ++# ## used by gem2rpm ++# :pre_install: |- ++# %if 0%{?use_system_libev} ++# export USE_VENDORED_LIBEV="no" ++# %endif ++# ## used by gem2rpm ++# :post_install: |- ++# # delete custom files here or do other fancy stuff ++# install -D -m 0644 %{S:1} %{buildroot}%{_bindir}/gem2rpm-opensuse ++# ## used by gem2rpm ++# :testsuite_command: |- ++# (pushd %{buildroot}%{gem_base}/gems/%{mod_full_name} && rake test) ++# ## used by gem2rpm ++# :filelist: |- ++# /usr/bin/gem2rpm-opensuse ++# ## used by gem2rpm ++# :scripts: ++# :post: |- ++# /bin/echo foo ++# ## used by gem_packages ++# :main: ++# :preamble: |- ++# Requires: util-linux ++# Recommends: pwgen ++# :filelist: |- ++# /usr/bin/gem2rpm-opensuse ++# ## used by gem_packages ++# :custom_pkgs: ++# apache: ++# :preamble: |- ++# Requires: ..... ++# :filelist: |- ++# /etc/apache2/conf.d/passenger.conf ++# :summary: Custom summary is optional ++# :description: |- ++# Custom description is optional ++# ++# bar ++# :post: |- ++# /bin/echo foo ++# +diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb +index 017ecd1..3db6853 100644 +--- a/lib/gem2rpm.rb ++++ b/lib/gem2rpm.rb +@@ -31,12 +31,15 @@ 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, config={}) + package = Gem2Rpm::Package.new(fname) + # Deprecate, kept just for backward compatibility. + format = Gem2Rpm::Format.new(package) + spec = Gem2Rpm::Specification.new(package.spec) +- spec.description ||= spec.summary ++ if spec.licenses.empty? && oldlicense ++ spec.licenses = oldlicense.split(' and ') ++ end ++ config ||= {} + download_path = "" + unless local + begin +@@ -46,8 +49,12 @@ module Gem2Rpm + $stderr.puts e.inspect + end + end +- template = ERB.new(template, 0, '-') +- out.puts template.result(binding) ++ erb_instance = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') ++ ERB.new(str=template, trim_mode: '-') ++ else ++ ERB.new(str=template, safe_mode=0, trim_mode='-') ++ end ++ out.puts erb_instance.result(binding) + rescue Gem::Exception => e + puts e + end +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} diff --git a/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb new file mode 100644 -index 0000000..d1734db +index 0000000..10b1d70 --- /dev/null +++ b/templates/gem_packages.spec.erb -@@ -0,0 +1,236 @@ +@@ -0,0 +1,319 @@ +<% ++ ++ begin ++ require 'rbconfigpackagingsupport' ++ rescue LoadError => ex ++ end + def self.patch_mod_full_name(path, mod_full_name) + path.gsub(/\/-/, "/#{mod_full_name}") + end -+ ++ + def self.patch_libdir(path) + # path ? path.gsub(/\/usr\/lib(64)?/, '%{_libdir}') : path + path + end + ++ ++ def self.rpm_suffix_for_feature(feature) ++ rpm_prefix = nil ++ ++ package_name = RbConfig::CONFIG['RUBY_SO_NAME'] ++ ++ IO.popen("rpm -q --provides #{package_name}") {|rpm_io| ++ rpm_provides = rpm_io.read ++ mo = /(?with(out)?-#{feature})/.match(rpm_provides) ++ ++ if mo ++ rpm_prefix = mo[:rpm_prefix] ++ end ++ } ++ ++ rpm_prefix ++ end ++ ++ def self.requires_for_feature(feature) ++ found_rpm_prefix = rpm_suffix_for_feature(feature) ++ ++ if found_rpm_prefix ++ return "Requires: #{RbConfig::CONFIG['RUBY_SO_NAME']}-#{found_rpm_prefix} >= #{RbConfig::CONFIG['RUBY_PROGRAM_VERSION']}" ++ end ++ # ++ return "" ++ end ++ + def self.get_extension_doc_dir(gem_spec) -+ if gem_spec.respond_to?(:extensions_dir) && RUBY_ENGINE != 'rbx' ++ return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by?(Gem.ruby_version) ++ if gem_spec.respond_to?(:extensions_dir) + rp = gem_spec.extensions_dir.rpartition(gem_spec.base_dir) -+ return File.join(rp[1], 'doc', rp[2]) ++ return File.join(rp[1], 'doc', rp[2]) + end + return nil + end @@ -38,10 +314,18 @@ index 0000000..d1734db + 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 ++ begin v3=Integer(versions[2]) rescue v3=0 end + weight=v1*10000+v2*100+v3 + end + ++ def self.map_executable(config, executable) ++ if not(config[:binary_map].nil? or ++ config[:binary_map][executable].nil?) ++ executable=config[:binary_map][executable] ++ end ++ executable ++ end ++ + def self.filecontent_or_value(path) + (path and File.exists?(path)) ? File.read(path) : path + end @@ -64,7 +348,23 @@ index 0000000..d1734db + end + custom_pkgs + end -+ ++ ++ def self.fix_up_rubygem_requires_with_rb_api(rb_api, preamble_text) ++ STDERR.puts(preamble_text) ++ preamble_text.lines.map do |line| ++ if mo = /^(?\s*\S+\s*:\s+rubygem\()(?[^\)]+)(?\).*)?$/.match(line) ++ if not(mo[:pkg_info] =~ /^ruby:\d\.\d\.\d/) ++ line = "#{mo[:pre_text]}#{rb_api}:#{mo[:pkg_info]}#{mo[:post_text]}" ++ end ++ end ++ line ++ end.join("\n") ++ end ++ ++ rb_api = "#{RUBY_ENGINE}:#{RbConfig::CONFIG['ruby_version']}" ++ ++ rb_pkg_abi = "#{rb_api}:#{spec.name}" ++ + rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '') + rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '') + if rb_suffix =~ /\A\d+\.\d+\z/ @@ -73,7 +373,7 @@ index 0000000..d1734db + pkg_basename = rb_pkgname + '-rubygem-' + spec.name + + mod_full_name = "#{spec.name}-#{spec.version}" -+ mod_weight = get_mod_weight(spec) ++ mod_weight = get_mod_weight(spec) + + gem_platform = Gem::Platform.new(RbConfig::CONFIG["arch"]).to_s + rb_bindir = RbConfig::CONFIG['bindir'] @@ -82,6 +382,7 @@ index 0000000..d1734db + gem_spec = Gem::Specification.new + gem_base_dir = patch_libdir(gem_spec.base_dir) + gem_cache_dir = patch_libdir(gem_spec.cache_dir) ++ gem_build_info_dir = patch_libdir(gem_spec.build_info_dir) + gem_gems_dir = patch_libdir(gem_spec.gems_dir) + gem_spec_dir = patch_libdir(gem_spec.spec_dir) + gem_bin_dir = patch_libdir(patch_mod_full_name(gem_spec.bin_dir , mod_full_name )) @@ -93,31 +394,41 @@ index 0000000..d1734db + gem_extension_dir = gem_spec.respond_to?(:extension_dir) ? patch_libdir(patch_mod_full_name(gem_spec.extension_dir, mod_full_name)) : nil + gem_extension_doc = patch_libdir(get_extension_doc_dir(gem_spec)) + #/ruby2.1 ++ gem_plugins_dir = Gem.respond_to?(:plugindir) ? Gem.plugindir : nil ++ has_plugins = gem_plugins_dir && not( spec.files.select {|filename| filename =~ /rubygems_plugin#{Gem.suffix_regexp}\z/ }.empty? ) ++ if config[:disable_docs].nil? ++ config[:disable_docs] ||= true ++ end ++ if config[:include_testsuite].nil? ++ config[:include_testsuite] ||= false ++ end +%> +%package -n <%= pkg_basename %><%= config[:version_suffix] %> -+<% for req in spec.required_ruby_version -%> -+<% unless req.empty? -%> -+Requires: <%= rb_pkgname %> <%= req %> -+<% end -%> -+<% end -%> +# MANUAL +<% if config[:main] && config[:main][:preamble] -%> -+<%= config[:main][:preamble] %> ++<%= fix_up_rubygem_requires_with_rb_api(rb_api, config[:main][:preamble]) %> +<% end -%> +# /MANUAL -+Summary: <%= config[:summary] or spec.summary %> -+Group: Development/Languages/Ruby -+<% unless spec.executables.empty? -%> -+PreReq: update-alternatives ++<% unless spec.extensions.empty? -%> ++<%= requires_for_feature('jemalloc') %> ++<%= requires_for_feature('yjit') %> +<% end -%> ++Summary: <%= config[:summary] or spec.summary %> ++<% unless spec.executables.empty? -%> ++Requires(preun): update-alternatives ++Requires(post): update-alternatives ++<% end -%> ++<% if has_plugins -%> ++Conflicts: rubygem(<%= rb_pkg_abi %>) ++<% end -%> ++Enhances: <%= rb_pkgname %> + +%description -n <%= pkg_basename %><%= config[:version_suffix] %> +<%= config[:description] or spec.description -%> + -+<% if spec.has_rdoc && not(config[:disable_docs]) -%> ++<% if spec.has_rdoc? && !(config[:disable_docs]) -%> +%package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> +Summary: RDoc documentation for <%= spec.name %> -+Group: Development/Languages/Ruby +Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> + +%description -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> @@ -138,8 +449,20 @@ index 0000000..d1734db + %w(test spec).each { |framework| + test_frameworks[framework] = 1 if path.index(framework + "/") == 0 + } -+ %w(changes copying history legal license mit-license changelog readme).each { |file| -+ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') ++ %w(changes ++ copying ++ history ++ legal ++ licence ++ license ++ license-mit ++ mit-license ++ changelog ++ news ++ release_notes ++ readme ++ ).each { |file| ++ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '').gsub(%r{\.markdown$}, '') + #$stderr.puts "PATH #{path} #{bpath} #{file}" + docdirfiles << path if bpath == file + } @@ -150,7 +473,6 @@ index 0000000..d1734db +<% unless test_frameworks.empty? -%> +%package -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> +Summary: Test suite for <%= spec.name %> -+Group: Development/Languages/Ruby +Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> + +%description -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> @@ -162,45 +484,49 @@ index 0000000..d1734db +%post -n <%= pkg_basename %><%= config[:version_suffix] %> +<% spec.executables.each do |executable| -%> +/usr/sbin/update-alternatives --install \ -+ <%= rb_bindir %>/<%= executable %> <%= executable %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> ++ <%= rb_bindir %>/<%= map_executable(config, executable) %> <%= map_executable(config, executable) %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> +/usr/sbin/update-alternatives --install \ -+ <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> ++ <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> +/usr/sbin/update-alternatives --install \ -+ <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> ++ <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> <%= mod_weight %> +<% end -%> + +%preun -n <%= pkg_basename %><%= config[:version_suffix] %> +if [ "$1" = 0 ] ; then +<% spec.executables.each do |executable| -%> -+ /usr/sbin/update-alternatives --remove <%= executable %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+ /usr/sbin/update-alternatives --remove <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+ /usr/sbin/update-alternatives --remove <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> ++ /usr/sbin/update-alternatives --remove <%= map_executable(config, executable) %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> ++ /usr/sbin/update-alternatives --remove <%= "#{executable}-#{spec.version}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> ++ /usr/sbin/update-alternatives --remove <%= "#{executable}#{rb_suffix}" %> <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> +<% end -%> +fi +<% end -%> + +%files -n <%= pkg_basename %><%= config[:version_suffix] %> +%defattr(-,root,root,-) -+# MANUAL +<% if config[:main] && config[:main][:filelist] -%> -+<%= config[:main][:filelist] -%> -+<% end -%> ++# MANUAL ++<%= config[:main][:filelist] %> +# /MANUAL ++<% end -%> +<% unless docdirfiles.empty? -%> -+<%= docdir %>/<%= pkg_basename %><%= config[:version_suffix] %> ++%doc <%= docdir %>/<%= pkg_basename %><%= config[:version_suffix] %> +<% end -%> +<% spec.executables.each do |executable| -%> +<%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %> -+%ghost <%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> -+%ghost <%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> -+%ghost <%= rb_bindir %>/<%= executable %> -+%ghost <%= rb_sysconfdir %>/alternatives/<%= executable %> ++<%= rb_bindir %>/<%= "#{executable}#{rb_suffix}" %> ++<%= rb_bindir %>/<%= "#{executable}-#{spec.version}" %> ++<%= rb_bindir %>/<%= map_executable(config, executable) %> ++%ghost <%= rb_sysconfdir %>/alternatives/<%= map_executable(config, executable) %> +%ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}#{rb_suffix}" %> +%ghost <%= rb_sysconfdir %>/alternatives/<%= "#{executable}-#{spec.version}" %> +<% end -%> +# cache file +<%= gem_cache_dir %>/<%= mod_full_name %>.gem +<%= gem_gem_dir %> ++<% if has_plugins -%> ++<%= gem_plugins_dir %> ++<% end -%> ++<%= gem_build_info_dir %> +<% unless spec.extensions.empty? or gem_extension_dir.nil? -%> +<%= gem_extension_dir %> +<% end -%> @@ -209,7 +535,7 @@ index 0000000..d1734db +<% end -%> +<%= gem_spec_dir %>/<%= mod_full_name -%>.gemspec + -+<% if spec.has_rdoc && not(config[:disable_docs]) -%> ++<% if spec.has_rdoc? && !(config[:disable_docs]) -%> +%files -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> +%defattr(-,root,root,-) +%doc <%= gem_doc_dir %> @@ -218,7 +544,7 @@ index 0000000..d1734db +<% end -%> +<% end -%> + -+<% unless test_frameworks.empty? -%> ++<% if config[:include_testsuite] and !test_frameworks.empty? -%> +%files -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> +%defattr(-,root,root,-) +<% test_frameworks.each do |framework| -%> @@ -228,13 +554,12 @@ index 0000000..d1734db +<% + if config[:custom_pkgs_ruby_versioned] + config[:custom_pkgs_ruby_versioned].each do |custom_pkg_name, data| -+-%> ++-%> +%package -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %> +<% if data[:preamble] and data[:preamble] != '' -%> +<%= data[:preamble] %> +<% else %> +Summary: <%= custom_pkg_name %> sub package for <%= spec.name %> -+Group: Development/Languages/Ruby +<% end %> +Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> +%description -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %> @@ -253,24 +578,34 @@ index 0000000..d1734db + end +-%> diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb -index 37de592..25fdec3 100644 +index 37de592..eb7e84c 100644 --- a/templates/opensuse.spec.erb +++ b/templates/opensuse.spec.erb -@@ -1,7 +1,7 @@ +@@ -1,7 +1,12 @@ # -# spec file for package rubygem-<%= spec.name %> (Version <%= spec.version %>) +# spec file for package rubygem-<%= spec.name %><%= config[:version_suffix] %> # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. -+# Copyright (c) <%= Time.now.year %> SUSE LINUX Products GmbH, Nuernberg, Germany. ++# Copyright (c) <%= Time.now.year %> SUSE LLC ++<% if config[:additional_copyrights] -%> ++<% for copyright in config[:additional_copyrights] -%> ++# Copyright (c) <%= copyright %> ++<% end -%> ++<% end -%> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed -@@ -14,59 +14,202 @@ +@@ -12,61 +17,236 @@ + # license that conforms to the Open Source Definition (Version 1.9) + # published by the Open Source Initiative. - # Please submit bugfixes or comments via http://bugs.opensuse.org/ +-# Please submit bugfixes or comments via http://bugs.opensuse.org/ ++# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +<% if config && not(config.empty?) -%> ++ ++ +# +# This file was generated with a gem2rpm.yml and not just plain gem2rpm. +# All sections marked as MANUAL, license headers, summaries and descriptions @@ -289,16 +624,7 @@ index 37de592..25fdec3 100644 -Group: Development/Languages/Ruby -License: GPLv2+ or Ruby -# -+%define mod_full_name %{mod_name}-%{version} -+<% if config[:version_suffix] -%> -+%define mod_version_suffix <%= config[:version_suffix] %> -+<% end -%> -+<% if config[:preamble] -%> -+# MANUAL -+<%= config[:preamble] %> -+# /MANUAL -+<% end -%> - BuildRoot: %{_tmppath}/%{name}-%{version}-build +-BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: rubygems_with_buildroot_patch -Requires: rubygems >= <%= Gem::RubyGemsVersion %> -<% @@ -307,6 +633,16 @@ index 37de592..25fdec3 100644 --%> -Requires: ruby <%= spec.required_ruby_version %> -BuildRequires: ruby-devel <%= spec.required_ruby_version %> ++%define mod_full_name %{mod_name}-%{version} ++<% if config[:version_suffix] -%> ++%define mod_version_suffix <%= config[:version_suffix] %> + <% end -%> +-<% for d in spec.dependencies -%> ++<% if config[:preamble] -%> ++# MANUAL ++<%= config[:preamble] %> ++# /MANUAL ++<% end -%> +BuildRequires: ruby-macros >= 5 +<% for req in spec.required_ruby_version -%> +<% unless req.empty? -%> @@ -322,8 +658,7 @@ index 37de592..25fdec3 100644 +BuildRequires: %{rubydevel} +<% end -%> +<% 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 %> @@ -334,6 +669,10 @@ index 37de592..25fdec3 100644 <% end -%> <% end -%> -# +-Url: <%= spec.homepage %> +-Source: %{mod_name}-%{version}.gem +-# +-Summary: <%= spec.summary.gsub(/\.$/, "") %> +<% end -%> +BuildRequires: %{rubygem gem2rpm} +<% unless spec.rdoc_options.empty? || config[:disable_automatic_rdoc_dep] -%> @@ -343,30 +682,27 @@ index 37de592..25fdec3 100644 +BuildRequires: update-alternatives +<% end -%> +<% unless spec.homepage.nil? || spec.homepage.empty? -%> - Url: <%= spec.homepage %> --Source: %{mod_name}-%{version}.gem --# --Summary: <%= spec.summary.gsub(/\.$/, "") %> ++URL: <%= spec.homepage %> ++<% end -%> ++<% if config[:sourceurl] -%> ++Source: <%= config[:sourceurl] %> ++<% else -%> ++Source: https://rubygems.org/gems/%{mod_full_name}.gem +<% end -%> -+Source: http://rubygems.org/gems/%{mod_full_name}.gem +<% if config[:sources] + config[:sources].each_with_index do |src, i| -%> -+Source<%= i+1 %>: <%= src %> ++Source<%= i+1 %>: <%= src %> +<% end + end -%> +<% if config[:patches] -%> +# MANUAL +<% config[:patches].each_with_index do |patch,i| -%> -+Patch<%= i %>: <%= patch[0] %> ++Patch<%= i %>: <%= patch[0] %> +<% end -%> +# /MANUAL +<% end -%> +Summary: <%= config[:summary] or spec.summary %> +License: <%= config[:license] or (spec.licenses and spec.licenses.join(" and ")) or 'CHECK(Ruby)' %> -+Group: Development/Languages/Ruby -+<% unless spec.executables.empty? -%> -+PreReq: update-alternatives -+<% end -%> + %description -<%= spec.description %> @@ -386,8 +722,22 @@ index 37de592..25fdec3 100644 + %w(test spec).each { |framework| + test_frameworks[framework] = 1 if path.index(framework + "/") == 0 + } -+ %w(changes copying history legal license mit-license changelog readme).each { |file| -+ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '') ++ %w(changes ++ copying ++ history ++ legal ++ licence ++ license ++ license-mit ++ mit-license ++ apache-license-2.0 ++ license-apache-2.0 ++ changelog ++ news ++ release_notes ++ readme ++ ).each { |file| ++ bpath = path.downcase.gsub(%r{\.rdoc$}, '').gsub(%r{\.txt$}, '').gsub(%r{\.md$}, '').gsub(%r{\.markdown$}, '') + #$stderr.puts "PATH #{path} #{bpath} #{file}" + docdirfiles << path if bpath == file + } @@ -399,8 +749,14 @@ index 37de592..25fdec3 100644 +<% unless config[:patches].nil? or config[:patches].empty? -%> +%gem_unpack +<% config[:patches].each_with_index do |patch, i| -%> -+%patch<%= i %> <%= patch[1] if patch[1] %> ++%patch -P <%= i %> <%= patch[1] if patch[1] %> +<% end -%> ++<% if config[:post_patch] -%> ++# MANUAL ++<%= config[:post_patch] %> ++# /MANUAL ++<% end -%> ++find -type f -print0 | xargs -0 touch -r %{S:0} +%gem_build +<% end -%> + @@ -478,11 +834,7 @@ index 37de592..25fdec3 100644 +<% else %> +Summary: <%= custom_pkg_name %> sub package for <%= spec.name %> +Group: Development/Languages/Ruby - <% end %> --%{_libdir}/ruby/gems/%{rb_ver}/cache/%{mod_name}-%{version}.gem --%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/ --%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_name}-%{version}.gemspec --%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_name}-%{version}/ ++<% end %> +# Requires: rubygem-<%= spec.name %><%= config[:version_suffix] %> = <%= spec.version %> +%description <%= custom_pkg_name %><%= config[:version_suffix] %> +<% if data[:description] and data[:description] != '' -%> @@ -491,17 +843,29 @@ index 37de592..25fdec3 100644 +<%= spec.description -%> + +This package holds the <%= custom_pkg_name %> sub package for <%= spec.name -%> -+<% end %> + <% end %> +-%{_libdir}/ruby/gems/%{rb_ver}/cache/%{mod_name}-%{version}.gem +-%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}/ +-%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_name}-%{version}.gemspec +-%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_name}-%{version}/ +%files <%= custom_pkg_name %><%= config[:version_suffix] %> +%defattr(-,root,root,-) +<%= data[:filelist] %> + ++<% if data[:scripts] ++ if data[:scripts].is_a? Hash ++ data[:scripts].each do |section, content| -%> ++%<%=section %> <%=custom_pkg_name %> ++<%= content %> ++ ++<% end ++ end ++ end ++-%> ++ +<% end + end +-%> +%gem_packages %changelog --- -2.26.2 - diff --git a/template_loader.patch b/template_loader.patch deleted file mode 100644 index d3bd61e..0000000 --- a/template_loader.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/bin/gem2rpm b/bin/gem2rpm -old mode 100755 -new mode 100644 -index 45ed21c..c613c12 ---- a/bin/gem2rpm -+++ b/bin/gem2rpm -@@ -73,6 +73,7 @@ opts.separator("") - rest = opts.permute(ARGV) - - template = nil -+template_file ||= 'opensuse' - if template_file.nil? - f = open("/etc/os-release", "r") if File.exist?("/etc/os-release") - if f diff --git a/update-suse-patch.sh b/update-suse-patch.sh new file mode 100644 index 0000000..727147f --- /dev/null +++ b/update-suse-patch.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git diff v0.10.1..HEAD -- ':(exclude)Rakefile' > ../suse.patch