Sync from SUSE:SLFO:Main rubygem-gem2rpm revision 746f0abf2ffbe5ab0a1942ba4cae0dd3

This commit is contained in:
Adrian Schröter 2024-05-04 00:14:57 +02:00
commit 1f6c33256b
41 changed files with 3683 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,33 @@
From 91bc63e3fbba24a5f90c4fce4f74b371c4694657 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,93 @@
From 1742038eb7ec8fcb25009ce8b270b420183875bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,507 @@
From 5e1e30e5addc99825b3bf873983ca48732493060 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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/templates/gem_packages.spec.erb b/templates/gem_packages.spec.erb
new file mode 100644
index 0000000..d1734db
--- /dev/null
+++ b/templates/gem_packages.spec.erb
@@ -0,0 +1,236 @@
+<%
+ 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.get_extension_doc_dir(gem_spec)
+ 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])
+ end
+ return nil
+ end
+
+ def self.get_mod_weight(spec)
+ versions=spec.version.to_s.split('.')
+ begin v1=Integer(versions[0]) rescue v1=1 end
+ begin v2=Integer(versions[1]) rescue v2=0 end
+ begin v3=Integer(versions[2]) rescue v3=0 end
+ weight=v1*10000+v2*100+v3
+ end
+
+ def self.filecontent_or_value(path)
+ (path and File.exists?(path)) ? File.read(path) : path
+ end
+
+ def self.parse_custom_pkgs(env_value)
+ custom_pkgs = {}
+ if env_value
+ list = env_value.split(/\s+/)
+ list.each do |element|
+ pkg_name,filelist_path, preamble, description = element.split(/\|/, 4)
+ filelist = filecontent_or_value(filelist_path)
+ preamble = filecontent_or_value(preamble)
+ description = filecontent_or_value(description)
+ custom_pkgs[pkg_name] = {
+ "filelist" => filelist,
+ "preamble" => preamble,
+ "description" => description,
+ }
+ end
+ end
+ custom_pkgs
+ end
+
+ 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/
+ rb_suffix = '.ruby' + rb_suffix
+ end
+ pkg_basename = rb_pkgname + '-rubygem-' + spec.name
+
+ mod_full_name = "#{spec.name}-#{spec.version}"
+ mod_weight = get_mod_weight(spec)
+
+ gem_platform = Gem::Platform.new(RbConfig::CONFIG["arch"]).to_s
+ rb_bindir = RbConfig::CONFIG['bindir']
+ rb_sysconfdir = RbConfig::CONFIG['sysconfdir']
+ docdir = '/usr/share/doc/packages'
+ gem_spec = Gem::Specification.new
+ gem_base_dir = patch_libdir(gem_spec.base_dir)
+ gem_cache_dir = patch_libdir(gem_spec.cache_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 ))
+ gem_doc_dir = patch_libdir(patch_mod_full_name(gem_spec.doc_dir, mod_full_name ))
+ gem_gem_dir = patch_libdir(patch_mod_full_name(gem_spec.gem_dir, mod_full_name ))
+ gem_ri_dir = patch_libdir(patch_mod_full_name(gem_spec.ri_dir, mod_full_name ))
+ #ruby2.1
+ gem_extensions_dir = gem_spec.respond_to?(:extensions_dir) ? patch_libdir(gem_spec.extensions_dir) : nil
+ 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
+%>
+%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] %>
+<% end -%>
+# /MANUAL
+Summary: <%= config[:summary] or spec.summary %>
+Group: Development/Languages/Ruby
+<% unless spec.executables.empty? -%>
+PreReq: update-alternatives
+<% end -%>
+
+%description -n <%= pkg_basename %><%= config[:version_suffix] %>
+<%= config[:description] or spec.description -%>
+
+<% if spec.has_rdoc && not(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] %>
+Documentation generated at gem installation time.
+Usually in RDoc and RI formats.
+
+<% end -%>
+<% test_frameworks = Hash.new
+ docdirfiles = []
+ format.file_entries.each do |entry|
+ # new rubygems version has it different
+ if entry.kind_of?(Array)
+ path=entry[0]['path']
+ else
+ path=entry
+ end
+ path.gsub!(%r{^\./}, '')
+ %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$}, '')
+ #$stderr.puts "PATH #{path} #{bpath} #{file}"
+ docdirfiles << path if bpath == file
+ }
+ end
+
+ test_frameworks = test_frameworks.keys.sort
+-%>
+<% 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] %>
+Test::Unit or RSpec files, useful for developers.
+
+<% end -%>
+
+<% unless spec.executables.empty? -%>
+%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 %>
+/usr/sbin/update-alternatives --install \
+ <%= 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 %>
+<% 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}" %>
+<% 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
+<% unless docdirfiles.empty? -%>
+<%= 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 %>
+%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 %>
+<% unless spec.extensions.empty? or gem_extension_dir.nil? -%>
+<%= gem_extension_dir %>
+<% end -%>
+<% test_frameworks.each do |framework| -%>
+%exclude <%= File.join gem_gem_dir, framework %>
+<% end -%>
+<%= gem_spec_dir %>/<%= mod_full_name -%>.gemspec
+
+<% if spec.has_rdoc && not(config[:disable_docs]) -%>
+%files -n <%= pkg_basename %>-doc<%= config[:version_suffix] %>
+%defattr(-,root,root,-)
+%doc <%= gem_doc_dir %>
+<% unless spec.extensions.empty? or gem_extension_doc.nil? -%>
+%doc <%= gem_extension_doc %>
+<% end -%>
+<% end -%>
+
+<% unless test_frameworks.empty? -%>
+%files -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %>
+%defattr(-,root,root,-)
+<% test_frameworks.each do |framework| -%>
+<%= File.join gem_gem_dir, framework %>
+<% end -%>
+<% end -%>
+<%
+ 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] %>
+<% if data[:description] and data[:description] != '' -%>
+<%= data[:description] %>
+<% else %>
+<%= spec.description -%>
+
+This package holds the <%= custom_pkg_name %> sub package for <%= spec.name -%>
+<% end %>
+%files -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %>
+%defattr(-,root,root,-)
+<%= data['filelist'] -%>
+<%
+ end
+ end
+-%>
diff --git a/templates/opensuse.spec.erb b/templates/opensuse.spec.erb
index 37de592..25fdec3 100644
--- a/templates/opensuse.spec.erb
+++ b/templates/opensuse.spec.erb
@@ -1,7 +1,7 @@
#
-# 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.
#
# 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 @@
# 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
+# can be maintained in that file. Please consult this file before editing any
+# of those fields
+#
+<% end -%>
-# norootforbuild
-Name: rubygem-<%= spec.name %>
+Name: <%= config[:name] ? config[:name] : "rubygem-#{spec.name}#{config[:version_suffix]}" %>
Version: <%= spec.version %>
Release: 0
%define mod_name <%= spec.name %>
-#
-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
-BuildRequires: rubygems_with_buildroot_patch
-Requires: rubygems >= <%= Gem::RubyGemsVersion %>
-<%
-# no need to add a requires ruby >= 0 here. will be pulled in via rubygems already
- unless spec.required_ruby_version == ['']
--%>
-Requires: ruby <%= spec.required_ruby_version %>
-BuildRequires: ruby-devel <%= spec.required_ruby_version %>
+BuildRequires: ruby-macros >= 5
+<% for req in spec.required_ruby_version -%>
+<% unless req.empty? -%>
+<% if spec.extensions.empty? -%>
+BuildRequires: %{ruby <%= req %>}
+<% else -%>
+BuildRequires: %{rubydevel <%= req %>}
+<% end -%>
+<% else -%>
+<% if spec.extensions.empty? -%>
+BuildRequires: %{ruby}
+<% else -%>
+BuildRequires: %{rubydevel}
+<% end -%>
+<% end -%>
<% end -%>
-<% for d in spec.dependencies -%>
+<% for d in spec.runtime_dependencies -%>
+<% if ['rdoc'].include? d.name.to_s -%>
+# <%= d.name %> <%= d.__getobj__().requirement %>
<% for req in d.requirement -%>
-BuildRequires: rubygem-<%= d.name %> <%= req %>
-Requires: rubygem-<%= d.name %> <%= req %>
+BuildRequires: %{rubygem <%= d.name %> <%= req %>}
<% end -%>
<% end -%>
-#
+<% end -%>
+BuildRequires: %{rubygem gem2rpm}
+<% unless spec.rdoc_options.empty? || config[:disable_automatic_rdoc_dep] -%>
+BuildRequires: %{rubygem rdoc > 3.10}
+<% end -%>
+<% unless spec.executables.empty? -%>
+BuildRequires: update-alternatives
+<% end -%>
+<% unless spec.homepage.nil? || spec.homepage.empty? -%>
Url: <%= spec.homepage %>
-Source: %{mod_name}-%{version}.gem
-#
-Summary: <%= spec.summary.gsub(/\.$/, "") %>
+<% 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 %>
+<% end
+ end -%>
+<% if config[:patches] -%>
+# MANUAL
+<% config[:patches].each_with_index do |patch,i| -%>
+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 %>
+<%= config[:description] or spec.description -%>
+
+<% # TODO move into gem2rpm as gem_packages.sh also need this and we only leave it here for getting the docfiles list
+ test_frameworks = Hash.new
+ docdirfiles = []
+ format.file_entries.each do |entry|
+ # new rubygems version has it different
+ if entry.kind_of?(Array)
+ path=entry[0]['path']
+ else
+ path=entry
+ end
+ path.gsub!(%r{^\./}, '')
+ %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$}, '')
+ #$stderr.puts "PATH #{path} #{bpath} #{file}"
+ docdirfiles << path if bpath == file
+ }
+ end
+ test_frameworks = test_frameworks.keys.sort
+-%>
%prep
+<% 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] %>
+<% end -%>
+%gem_build
+<% end -%>
+
%build
+
%install
-%gem_install %{S:0}
-<% unless spec.extensions.empty? %>
+<% if config[:pre_install] -%>
+# MANUAL
+<%= config[:pre_install] %>
+# /MANUAL
+<% end -%>
+%gem_install \
+<% if config[:gem_install_args] -%>
+<%= config[:gem_install_args] %> \
+<% end -%>
+<% if config[:disable_docs] -%>
+ --no-rdoc --no-ri \
+<% end -%>
+<% unless spec.executables.empty? -%>
+ --symlink-binaries \
+<% end -%>
+<% unless docdirfiles.empty? -%>
+ --doc-files="<%= docdirfiles.join(' ') %>" \
+<% end -%>
+ -f
+<% unless spec.extensions.empty? -%>
%gem_cleanup
-<% end %>
+<% end -%>
+<% if config[:post_install] -%>
+# MANUAL
+<%= config[:post_install] %>
+# /MANUAL
+
+<% end -%>
-%clean
-%{__rm} -rf %{buildroot}
+<% if config[:testsuite_command] -%>
+# MANUAL
+%check
+<%= config[:testsuite_command] %>
+#/ MANUAL
+<% end -%>
+<% if config[:filelist] -%>
%files
%defattr(-,root,root,-)
-<% spec.executables.each do |executable| %>
-%{_bindir}/<%= executable %>
+<%= config[:filelist] %>
+
+<% end -%>
+<% if config[:scripts]
+ if config[:scripts].is_a? Hash
+ config[:scripts].each do |section, content| -%>
+%<%= section %>
+<%= content %>
+
+<% end
+ else -%>
+<%= config[:scripts] %>
+
+<% end
+ end
+-%>
+<% if config[:custom_pkgs]
+ config[:custom_pkgs].each do |custom_pkg_name, data|
+-%>
+%package <%= 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 %>
-%{_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}/
+# Requires: rubygem-<%= spec.name %><%= config[:version_suffix] %> = <%= spec.version %>
+%description <%= custom_pkg_name %><%= config[:version_suffix] %>
+<% if data[:description] and data[:description] != '' -%>
+<%= data[:description] %>
+<% else %>
+<%= spec.description -%>
+
+This package holds the <%= custom_pkg_name %> sub package for <%= spec.name -%>
+<% end %>
+%files <%= custom_pkg_name %><%= config[:version_suffix] %>
+%defattr(-,root,root,-)
+<%= data[:filelist] %>
+
+<% end
+ end
+-%>
+%gem_packages
%changelog
--
2.26.2

View File

@ -0,0 +1,92 @@
From f408e57b282cd55d59c1317240ee9e0dc679373c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,58 @@
From da07cd470611c3c6b70fc863e2d82a2862a068e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
Date: Thu, 24 Jul 2014 17:09:35 +0200
Subject: [PATCH 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

View File

@ -0,0 +1,61 @@
From 0f22d81f982e02523c852521a5b94db657fe6673 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,56 @@
From eed51b54253c303c593d9466ed8ed17523bda3d1 Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
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

View File

@ -0,0 +1,34 @@
From ba7932c7d7bc6a70a45ac6ebb841a9e1bf8bb86b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,32 @@
From 13b02a1596a744ed70687dae0ffb465e1979221e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,28 @@
From 953ff66677490c78ceff14afc0365f832079333a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,44 @@
From 0ee368bc6c4ea35d233dadbe1f2c7048a99d3dc4 Mon Sep 17 00:00:00 2001
From: Theo chatzimichos <tampakrap@opensuse.org>
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

View File

@ -0,0 +1,26 @@
From 092f7ca4ff1f954dd8982acf7199cd15636e87f3 Mon Sep 17 00:00:00 2001
From: Theo Chatzimichos <tampakrap@opensuse.org>
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

View File

@ -0,0 +1,40 @@
From dad615aa35cbbe0d7351ea66af44a8548853a2da Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dmueller@suse.com>
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

View File

@ -0,0 +1,58 @@
From 5bb494a7d6911754e485f6b729861771181bf2a0 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dmueller@suse.com>
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

View File

@ -0,0 +1,38 @@
From b10341f5c13d71271e195101e46213026f628048 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dmueller@suse.com>
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

View File

@ -0,0 +1,39 @@
From 814a7133ce8ab7271cf0bf31ad6d4de94fec8863 Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
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

View File

@ -0,0 +1,39 @@
From 660fa598f3a78f94f35e1edf10d143dae5db62bb Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
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

View File

@ -0,0 +1,26 @@
From 7a45c828d05304d90b3a202e55acbbcaab5cdac2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,30 @@
From 672a0405c2c191280887b4427a759490aa2ce5ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,25 @@
From f6ace6130df3a2ea6ca8e987e9675d652940510e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,25 @@
From 2d02399fc670b648785b10bf7f1510c136e6f981 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,24 @@
From f8c0600c659f26d1ec6c9d890a63dd642f741003 Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
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

View File

@ -0,0 +1,26 @@
From ee81c7f09669db9e6898df5bf36ac6c102d0d615 Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <tbechtold@suse.com>
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

View File

@ -0,0 +1,29 @@
From 3888b107af6ce5721ff40abe2bedcede1893732b Mon Sep 17 00:00:00 2001
From: Theo Chatzimichos <tampakrap@gmail.com>
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

View File

@ -0,0 +1,44 @@
From e9601db421071203202ddb0122e8826859238e73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,39 @@
From 304e55ea06e789e41683351c3eca7e8f20619201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
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

View File

@ -0,0 +1,26 @@
From 5ed4ebe4fce32e32c75019aa4ac01b78e22c2e44 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
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

View File

@ -0,0 +1,89 @@
From fdf7e5ceb4c165babfb7486fe6640faa21ab5e12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,26 @@
From 04d2ef0c24748dd4120d1cc3a7b08d5c963dc100 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,77 @@
From c4557ce4aa7e0f67e5c249c255fe0c0c5df8f793 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <darix@nordisch.org>
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

View File

@ -0,0 +1,28 @@
From 7fa4f56a2a55278e95510d1663c495fa733d7780 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
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

View File

@ -0,0 +1,25 @@
From 9adb19584120941300dc8269f6a8563eb85b1a1c Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
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

View File

@ -0,0 +1,65 @@
From a55b215427daffb082518545a4617bf04ce013bf Mon Sep 17 00:00:00 2001
From: Martin Vidner <mvidner@suse.com>
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

BIN
gem2rpm-0.10.1.gem (Stored with Git LFS) Normal file

Binary file not shown.

3
gem2rpm-opensuse Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
echo "obsolete, gem2rpm knows it's running on opensuse" >&2
exec gem2rpm -t opensuse $1

76
gem2rpm.yml.documentation Normal file
View File

@ -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
# ## 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

681
rubygem-gem2rpm.changes Normal file
View File

@ -0,0 +1,681 @@
-------------------------------------------------------------------
Fri Feb 3 16:04:04 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- replace the old options to disable docs with the modern -N
-------------------------------------------------------------------
Sun Dec 25 12:19:35 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- ruby 3.2.0 final has a normal ABI version again
-------------------------------------------------------------------
Fri Dec 9 08:43:49 UTC 2022 - Martin Vidner <mvidner@suse.com>
- Use git format-patch instead, fixing one more exists? occurrence
A 0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch
- Note 0004-added-example-gem2rpm.yml.patch has the Rakefile hunk removed
-------------------------------------------------------------------
Mon Dec 5 16:25:59 UTC 2022 - Martin Vidner <mvidner@suse.com>
- Edit patches to use File.exist? instead of File.exists? which was
removed in Ruby 3.2
-------------------------------------------------------------------
Thu Nov 17 12:00:27 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Fix filelist for 3.2.0
-------------------------------------------------------------------
Fri Nov 11 17:22:10 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- added support for 3.2.0
-------------------------------------------------------------------
Sun Dec 26 19:56:42 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- added support for 3.1.0
-------------------------------------------------------------------
Mon Sep 28 00:25:24 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- added support for 3.0.0
-------------------------------------------------------------------
Sun Jun 23 02:24:56 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- build without gem docs
-------------------------------------------------------------------
Sun Jun 23 02:12:56 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- added support for 2.7.0
-------------------------------------------------------------------
Sat Feb 23 06:54:36 UTC 2019 - Stephan Kulow <coolo@suse.com>
- Update from git. Add:
A 0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch
A 0028-add-binary_map-support.patch
A 0029-Use-or-for-the-conditions-instead-of-and.patch
A 0030-gem_package.spec.erb-sync-with-ruby-common.patch
A 0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch
A 0032-Replace-no-rdoc-no-ri-with-no-document.patch
And refresh all others
Remove:
D binary_map.patch
D enhances.patch
-------------------------------------------------------------------
Mon Feb 4 19:57:20 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Use less strict PreReq replacements.
-------------------------------------------------------------------
Fri Jan 18 15:32:43 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- [42.3/sle12] disable ruby 2.3 and 2.4 so we can enable 2.6
-------------------------------------------------------------------
Fri Jun 29 14:00:54 UTC 2018 - mrueckert@suse.de
- add ruby 2.6 support
-------------------------------------------------------------------
Fri Jun 15 17:19:13 UTC 2018 - mrueckert@suse.de
- enhances.patch is a WIP but we add it to the filelist for the
source validator
-------------------------------------------------------------------
Wed Jun 6 15:17:48 UTC 2018 - mrueckert@suse.de
- added binary_map.patch:
add way to avoid conflicts with non rubygems packages in /usr/bin
- added template_loader.patch (boo#1092585)
-------------------------------------------------------------------
Wed Nov 8 18:07:59 UTC 2017 - mrueckert@suse.de
- disable 2.2 on suse_version 1315
-------------------------------------------------------------------
Wed Aug 9 10:09:18 UTC 2017 - mrueckert@suse.de
- add ruby 2.5 support
-------------------------------------------------------------------
Thu Nov 10 17:17:22 UTC 2016 - mrueckert@suse.de
- fix gem2rpm --fetch: prefer https for accessing rubygems.org
(bnc #963710)
adds 0026-use-https-instead-of-http-for-rubygems.org.patch
-------------------------------------------------------------------
Thu Nov 10 16:10:15 UTC 2016 - mrueckert@suse.de
- added support for 2.4.0
-------------------------------------------------------------------
Thu Nov 10 16:04:57 UTC 2016 - mrueckert@suse.de
- dropped all patches and replaced them with git format-patch
series:
- modified:
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
- dropped:
0017-touch-unpacked-sources.patch
0001-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch
- newly added:
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
- added :post_patch hook to run commands before we rebuild the gem
used by libv8
-------------------------------------------------------------------
Mon Jul 18 08:29:08 UTC 2016 - tbechtold@suse.com
- add 0001-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch
-------------------------------------------------------------------
Wed Apr 6 06:54:21 UTC 2016 - coolo@suse.com
- add 0017-touch-unpacked-sources.patch to please build-compare
-------------------------------------------------------------------
Wed Nov 11 23:34:13 UTC 2015 - mrueckert@suse.de
- remove the rubinius 2.2 support
- add support for rubinius 2.5 and ruby 2.3
-------------------------------------------------------------------
Thu Apr 16 22:04:44 UTC 2015 - mrueckert@suse.de
- update
0003-new-opensuse-templates.-they-require-the-config-file.patch:
Fix company name in copyright header
-------------------------------------------------------------------
Wed Feb 11 01:23:45 UTC 2015 - coolo@suse.com
- more patches from git:
A 0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch
A 0011-Add-support-for-scripts-pre-post-for-subpackages.patch
A 0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch
A 0013-Also-tag-LICENSE-MIT-as-docfile.patch
A 0014-Refactor-into-multiple-lines.patch
A 0015-Add-licence-to-the-list-of-license-files-as-well.patch
A 0016-add-two-more-ways-to-express-changes.patch
-------------------------------------------------------------------
Tue Oct 21 13:15:04 UTC 2014 - mrueckert@suse.de
- added 0009-No-longer-require-the-ruby-version-inside-the-subpac.patch
No longer require the ruby version inside the subpackage
With the buildrequires we already make sure that the package is
only built if we find a recent enough ABI. then the normal
$interpreter(abi) requires generated by rpm is enough
-------------------------------------------------------------------
Tue Oct 21 13:06:09 UTC 2014 - mrueckert@suse.de
- refreshed patch series to match the git again:
M 0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch
M 0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch
A 0003-new-opensuse-templates.-they-require-the-config-file.patch
A 0004-added-example-gem2rpm.yml.patch
A 0005-properly-shorten-description-and-summary.patch
A 0006-Preserve-the-license-header-found-in-the-output-file.patch
A 0007-fixes-for-the-opensuse-template.patch
A 0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch
D 0003-sle-12-templates.-they-require-the-config-file-suppo.patch
D 0004-openSUSE-template-fixes.patch
D 0005-added-example-gem2rpm.yml.patch
D 0006-properly-shorten-description-and-summary.patch
D 0007-Preserve-the-license-header-found-in-the-output-file.patch
D 0008-dont-allow-suffixes-with-just-a-plain-number.-prefix.patch
D 0009-rubinius-has-no-extensions-docdir.patch
D 0010-switch-to-new-packaging-scheme-by-default.patch
D 0011-fixes-for-the-opensuse-template.patch
- new patch for fixing usage of not() which breaks on 1.8
-------------------------------------------------------------------
Wed Oct 15 08:44:14 UTC 2014 - coolo@suse.com
- add 0011-fixes-for-the-opensuse-template.patch to survive
format_spec formatting
-------------------------------------------------------------------
Mon Oct 13 13:46:58 UTC 2014 - mrueckert@suse.de
- added 0009-rubinius-has-no-extensions-docdir.patch
special casing for rubinius
- added 0010-switch-to-new-packaging-scheme-by-default.patch
move to new packaging templates by default
-------------------------------------------------------------------
Mon Sep 22 16:12:08 UTC 2014 - mrueckert@suse.de
- added ruby 1.9 support
-------------------------------------------------------------------
Wed Sep 17 16:16:59 UTC 2014 - mrueckert@suse.de
- added ruby 1.8 support
- also guarded the 2.1 part
-------------------------------------------------------------------
Wed Sep 17 14:55:33 UTC 2014 - mrueckert@suse.de
- added 0008-dont-allow-suffixes-with-just-a-plain-number.-prefix.patch
Dont allow an suffix with just a plain number. prefix it with
ruby.
-------------------------------------------------------------------
Wed Sep 17 13:25:27 UTC 2014 - mrueckert@suse.de
- added ruby 2.0 support
-------------------------------------------------------------------
Mon Sep 8 11:02:50 UTC 2014 - mrueckert@suse.de
- changed rubinius macro
-------------------------------------------------------------------
Fri Sep 5 09:46:22 UTC 2014 - mrueckert@suse.de
- for easier bootstrapping dont use gem2rpm here for now.
-------------------------------------------------------------------
Thu Sep 4 13:34:30 UTC 2014 - mrueckert@suse.de
- make it easier to enable rbx and ruby 2.2 support
-------------------------------------------------------------------
Wed Sep 3 12:44:54 UTC 2014 - mrueckert@suse.de
- added support for building for rbx
-------------------------------------------------------------------
Mon Jul 28 11:11:27 UTC 2014 - mrueckert@suse.de
- really install the templates as docs
-------------------------------------------------------------------
Thu Jul 24 15:30:14 UTC 2014 - mrueckert@suse.de
- update to 0.10.1
- Migrate test suite to Minitest 5.x.
- Move gem binary extension and gem.build_complete file.
- Merge pull request #31 from axilleas/add_check_macro
- Add %check macro, fix typos
- Remove Requires/Provides which are now autogenerated.
- Simplify binary extensions installation according to the new
guidelines.
- Clone new template for F21 and above. Rename the old one.
- "cp -a" implies -p.
- Better open mode handling.
- Test always against rawhide template.
- List development dependencies as BuildRequires.
- Cache rendered template in tests.
- Prevent dangling symlink in -debuginfo.
- Ignore release file encoding with older Ruby (fixes #23).
- Fix generating SRPM.
- Add description dot test case.
- Add description ending dot in #description method.
- Avoid 'method is redefined' warning.
- Test against current template.
- Merge pull request #25 from xsuchy/pull-req-dot
- description should end with dot
- Merge pull request #24 from strzibny/master
- Escape % in comment
- rebased gem2rpm-change-default-template.diff, new name:
0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch
- rebased gem2rpm-0.9.2_config_file_support.patch, new name
0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch
- rebased gem2rpm-0.9.2_sles12_template.patch, new name:
0003-sle-12-templates.-they-require-the-config-file-suppo.patch
- rebased and splitted gem2rpm-fix-opensuse-template.diff, new
name:
0004-openSUSE-template-fixes.patch
0005-added-example-gem2rpm.yml.patch
0006-properly-shorten-description-and-summary.patch
0007-Preserve-the-license-header-found-in-the-output-file.patch
-------------------------------------------------------------------
Wed Jul 23 09:06:02 UTC 2014 - mrueckert@suse.de
- make sure the sle12 template is also installed
-------------------------------------------------------------------
Mon Jul 21 11:32:38 UTC 2014 - mrueckert@suse.de
- added gem2rpm_bootstrap conditional:
If this is set to true, the hardcoded subpackage/files sections
are used. Otherwise it will use the normal gem2rpm based solution
- renamed gem2rpm.yml to gem2rpm.yml.documentation:
this is just documentation and not the gem2rpm.yml that gem2rpm
should pick up.
-------------------------------------------------------------------
Mon Jul 21 09:23:55 UTC 2014 - mrueckert@suse.de
- added gem2rpm-0.9.2_sles12_template.patch:
initial template for sle12 ruby packaging
- only build for 2.1 for now
-------------------------------------------------------------------
Tue Jul 15 18:43:12 UTC 2014 - mrueckert@suse.de
- added gem2rpm.yml and install it to the installed documentation
-------------------------------------------------------------------
Tue Jul 15 18:38:35 UTC 2014 - mrueckert@suse.de
- sles 12 template
- allow changing the master package name with config[:name]
This is mostly useful if you want the actual main package to
have real content after building. all the subpackages will
ignore config[:name] and still use the gem name.
-------------------------------------------------------------------
Tue Jul 15 17:21:42 UTC 2014 - mrueckert@suse.de
- sles 12 template
- add version suffix to the "spec file for ..." line
- move the preamble up so we can actually use
%define rb_build_versions ...
- config[:disable_automatic_rdoc_dep] to disable adding automatic
rdoc dependency. This is mostly needed for building rdoc itself
and avoiding a bootstrap cycle.
- actually print the patch name in the preamble
- the scripts entry in gem2rpm.yml can now be a hash or a string.
-------------------------------------------------------------------
Tue Jul 15 14:27:57 UTC 2014 - mrueckert@suse.de
- sles 12 template
- no longer print the gem2rpm.yml warning when the config is empty
- add back mod_version_suffix to the spec file
(needed for gem_install)
- converted buildrequires for ruby and ruby-devel to the macros so
we can easily pull multiple ruby versions and also easily limit
the ruby versions
- always buildrequire gem2rpm in generated spec files. It is the
only clean way to solve the "have choive for rubygem(gem2rpm)"
and still maintaining the multiversion ability
- handle config[:disable_docs] and pass --no-rdoc --no-ri to
gem_install in that case. (mostly a workaround for the rdoc bug
with the fastthread gem)
- added support to specify the content of the %check section.
-------------------------------------------------------------------
Fri Jul 11 08:23:20 UTC 2014 - mrueckert@suse.de
- if the config is nil, set it to an empty hash. this allows for
less noisy template files.
- more updates for the sle 12 template.
-------------------------------------------------------------------
Thu Jul 10 16:27:03 UTC 2014 - mrueckert@suse.de
- added new tag :sources in the yaml file to track additional
sources. this makde the next change much easier.
- make sure the config file that is passed to gem2rpm is also
appended to the sources list automatically.
- added template for sles12 (gem2rpm-0.9.2_sles12_template.patch)
-------------------------------------------------------------------
Thu Jul 10 14:52:01 UTC 2014 - mrueckert@suse.de
- added gem2rpm-0.9.2_config_file_support.patch:
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.
- added quilt series file to the sources list
- dropped empty doc package
-------------------------------------------------------------------
Thu Jun 26 09:58:34 UTC 2014 - mrueckert@suse.de
- update rpm macros requires to 5
-------------------------------------------------------------------
Wed Jun 25 17:07:59 UTC 2014 - mrueckert@suse.de
- fix filelist for multi ruby packaging
-------------------------------------------------------------------
Wed Jun 25 16:28:46 UTC 2014 - mrueckert@suse.de
- add ruby 2.2 support
-------------------------------------------------------------------
Tue Jun 24 15:19:28 UTC 2014 - mrueckert@suse.de
- added BuildIgnore for rubygem(gem2rpm), otherwise we can not
bootstrap a new ruby version. this package will need the
subpackages for a new ruby version to be created manually.
-------------------------------------------------------------------
Wed Jun 18 20:10:04 UTC 2014 - mrueckert@suse.de
- fixed paths in the u-a scriptlets
-------------------------------------------------------------------
Wed Jun 18 18:47:31 UTC 2014 - mrueckert@suse.de
- no longer provide gem2rpm-opensuse
- use new style packaging but the hardcoded version
-------------------------------------------------------------------
Thu Feb 6 11:52:43 UTC 2014 - coolo@suse.com
- buildrequire ruby-devel for extensions
-------------------------------------------------------------------
Mon Jan 13 19:52:26 UTC 2014 - coolo@suse.com
- switch to the macros Klaus wrote
- modified patches:
* gem2rpm-fix-opensuse-template.diff
-------------------------------------------------------------------
Wed Jun 26 14:48:32 UTC 2013 - coolo@suse.com
- doing update-alternatives correctly after reading
http://en.opensuse.org/openSUSE:Packaging_Multiple_Version_guidelines
-------------------------------------------------------------------
Wed Jun 26 08:29:30 UTC 2013 - coolo@suse.com
- avoid --force in update-alternatives as SLE11 does not have that ;(
-------------------------------------------------------------------
Mon Jun 10 10:04:12 UTC 2013 - coolo@suse.com
- make sure license.txt is also symlinked
-------------------------------------------------------------------
Sat Jun 8 06:42:37 UTC 2013 - coolo@suse.com
- integrate more of the version into the mod_weight to give
an easier job to update-alternatives
- use --force in update-alternatives to replace (old) binaries
-------------------------------------------------------------------
Sat May 25 21:00:11 UTC 2013 - coolo@suse.com
- include changelog and history files too
-------------------------------------------------------------------
Tue May 7 09:34:43 UTC 2013 - coolo@suse.com
- more license files
-------------------------------------------------------------------
Thu May 2 08:58:11 UTC 2013 - coolo@suse.com
- ciaran wants to see the license files mentioned in %docdir, so create
symlinks
-------------------------------------------------------------------
Sun Apr 28 06:55:08 UTC 2013 - coolo@suse.com
- support ruby 2.0
-------------------------------------------------------------------
Sat Apr 27 16:09:07 UTC 2013 - coolo@suse.com
- update to 0.9.2 - no changelog
-------------------------------------------------------------------
Mon Apr 22 19:03:01 UTC 2013 - mrueckert@suse.de
- fix redirection in gem2rpm-opensuse
-------------------------------------------------------------------
Mon Mar 18 13:04:43 UTC 2013 - coolo@suse.com
- update to 0.8.4 - fixes for fedora 18
- use url for sources
-------------------------------------------------------------------
Mon Aug 6 10:54:32 UTC 2012 - coolo@suse.com
- buildrequire rdoc if there are options (I just picked 3.10 as
minimum, which is one higher than what ruby 1.9.1 offers in itself)
-------------------------------------------------------------------
Wed Aug 1 06:07:50 UTC 2012 - coolo@suse.com
- shorten the summary
-------------------------------------------------------------------
Mon Jul 30 12:43:00 UTC 2012 - cfarrell@suse.com
- license update: GPL-2.0+
See data/LICENSE
-------------------------------------------------------------------
Fri Jul 27 10:00:27 UTC 2012 - coolo@suse.com
- do not use %gem_unpack by default
-------------------------------------------------------------------
Fri Jul 27 08:19:14 UTC 2012 - coolo@suse.com
- do not put out empty URLs
-------------------------------------------------------------------
Thu Jul 26 13:11:05 UTC 2012 - coolo@suse.com
- fix OS detection on SLE11
-------------------------------------------------------------------
Thu Jul 26 09:56:31 UTC 2012 - coolo@suse.com
- no longer provide stuff for older distributions, we rely on patched
rpms
-------------------------------------------------------------------
Wed Jul 25 13:43:53 UTC 2012 - coolo@suse.com
- do not add buildrequires, but install with -f
-------------------------------------------------------------------
Tue Jul 24 16:17:16 UTC 2012 - coolo@suse.com
- cleanup the opensuse template
-------------------------------------------------------------------
Tue Jul 24 15:37:15 UTC 2012 - coolo@suse.com
- update to 0.8.1, major cleanup and base on new macros
-------------------------------------------------------------------
Wed Apr 4 15:42:10 UTC 2012 - coolo@suse.com
- small cleanup
-------------------------------------------------------------------
Wed Dec 7 13:38:47 UTC 2011 - jreidinger@suse.com
- fix requirements, as package need to run json parser
-------------------------------------------------------------------
Wed Mar 23 11:33:09 UTC 2011 - mrueckert@suse.de
- dont check if spec.license responds_to each. strings have that
method too. check for join
- minor template cleanup
-------------------------------------------------------------------
Tue Mar 22 15:48:03 UTC 2011 - jreidinger@novell.com
- Don't have hardcoded license. Try to extract it from specfile or
if it fail force user to manually check license. It avoids
problems with wrong license for rubygems
-------------------------------------------------------------------
Fri Feb 18 12:43:38 UTC 2011 - mrueckert@suse.de
- remove license tag from doc/testsuite package
-------------------------------------------------------------------
Mon Jan 31 14:48:18 UTC 2011 - mrueckert@suse.de
- small template clean up
-------------------------------------------------------------------
Thu Jan 20 13:44:42 UTC 2011 - mrueckert@suse.de
- remove version from header comment
- calculate the year on run
-------------------------------------------------------------------
Mon Jan 17 13:40:33 UTC 2011 - mvidner@suse.cz
- Updated openSUSE template to produce *- doc and *-testsuite subpackages.
http://lists.opensuse.org/opensuse-ruby/2010-12/msg00001.html
-------------------------------------------------------------------
Thu Dec 9 15:33:55 UTC 2010 - chris@computersalat.de
- update template
o # Copyright (c) 2010
-------------------------------------------------------------------
Wed Jun 9 16:28:21 UTC 2010 - mrueckert@suse.de
- fix typo in template:
"requirements" is not "requirement".
-------------------------------------------------------------------
Wed Jun 9 09:49:19 UTC 2010 - mrueckert@suse.de
- fix deprecation warning in template with newer versions of rubygems:
version_requirements is now called requirements
-------------------------------------------------------------------
Tue May 25 16:06:25 UTC 2010 - mrueckert@suse.de
- use rubygems_requires macro instead of repeating the
#if-conditional in every package
-------------------------------------------------------------------
Tue May 25 11:22:11 UTC 2010 - mrueckert@suse.de
- use requires_eq/requires_ge instead of hardcoding the rubygems
version during spec generation
-------------------------------------------------------------------
Tue Mar 2 12:56:07 UTC 2010 - prusnak@suse.cz
- use default URL when none is specified in gem (default-url.patch)
-------------------------------------------------------------------
Fri Jan 22 17:32:57 CET 2010 - prusnak@suse.cz
- fix version transform (fix-spec-versions.patch)
-------------------------------------------------------------------
Sat Nov 14 02:08:21 UTC 2009 - mrueckert@suse.de
- ignore development type requires of gems
-------------------------------------------------------------------
Fri Mar 27 17:38:45 CET 2009 - mrueckert@suse.de
- fix opensuse template
-------------------------------------------------------------------
Fri Mar 27 16:06:28 CET 2009 - mrueckert@suse.de
- initial package

969
rubygem-gem2rpm.spec Normal file
View File

@ -0,0 +1,969 @@
#
# spec file for package rubygem-gem2rpm
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%bcond_without gem2rpm_bootstrap
%if 0%{?suse_version} && 0%{?suse_version} < 1315
%bcond_with ruby18
%bcond_with ruby19
%bcond_with ruby20
%endif
%bcond_with ruby21
%if ! (0%{?suse_version} == 1315)
%bcond_with ruby22
%bcond_with ruby23
%bcond_with ruby24
%endif
%bcond_with ruby25
%bcond_with ruby26
%bcond_with ruby27
%bcond_with ruby30
%bcond_with ruby31
%bcond_with ruby32
%bcond_with rubinius25
Name: rubygem-gem2rpm
Version: 0.10.1
Release: 0
%define mod_name gem2rpm
%define mod_full_name %{mod_name}-%{version}
%define mod_branch -%{version}
%define mod_weight 1001
BuildRequires: %{ruby}
BuildRequires: ruby-macros >= 5
%if %{with gem2rpm_bootstrap}
#!BuildIgnore: rubygem(gem2rpm) rubygem(ruby:2.1.0:gem2rpm) rubygem(ruby:2.2.0:gem2rpm) rubygem(rbx:2.2:gem2rpm)
%else
BuildRequires: %{rubygem gem2rpm}
%endif
BuildRequires: update-alternatives
URL: https://github.com/lutter/gem2rpm/
Source: http://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml.documentation
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
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.
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
%build
perl -p -i -e 's|("templates/opensuse.spec.erb".freeze)|$1, "templates/gem_packages.spec.erb".freeze|g' *gemspec
%gem_build
%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
done
%if %{with gem2rpm_bootstrap}
%if %{with ruby21}
%package -n ruby2.1-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.1-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 ruby2.1-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.1-rubygem-gem2rpm = %{version}
%description -n ruby2.1-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.1-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.1-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.1-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.1 gem2rpm.ruby2.1 %{_bindir}/gem2rpm.ruby2.1-%{version} %{mod_weight}
%preun -n ruby2.1-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.1-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.1-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.1 %{_bindir}/gem2rpm.ruby2.1-%{version}
fi
%files -n ruby2.1-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.1-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.1-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.1
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.1
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.1.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.1.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.1.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.1-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.1.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby18}
%package -n ruby1.8-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby1.8-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 ruby1.8-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby1.8-rubygem-gem2rpm = %{version}
%description -n ruby1.8-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby1.8-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby1.8-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby1.8-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby1.8 gem2rpm.ruby1.8 %{_bindir}/gem2rpm.ruby1.8-%{version} %{mod_weight}
%preun -n ruby1.8-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby1.8-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby1.8-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby1.8 %{_bindir}/gem2rpm.ruby1.8-%{version}
fi
%files -n ruby1.8-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby1.8-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby1.8-%{version}
%ghost %{_bindir}/gem2rpm.ruby1.8
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby1.8
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/1.8/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/1.8/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/1.8/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby1.8-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/1.8/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby19}
%package -n ruby1.9-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby1.9-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 ruby1.9-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby1.9-rubygem-gem2rpm = %{version}
%description -n ruby1.9-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby1.9-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby1.9-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby1.9-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby1.9 gem2rpm.ruby1.9 %{_bindir}/gem2rpm.ruby1.9-%{version} %{mod_weight}
%preun -n ruby1.9-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby1.9-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby1.9-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby1.9 %{_bindir}/gem2rpm.ruby1.9-%{version}
fi
%files -n ruby1.9-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby1.9-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby1.9-%{version}
%ghost %{_bindir}/gem2rpm.ruby1.9
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby1.9
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/1.9.1/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/1.9.1/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/1.9.1/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby1.9-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/1.9.1/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby20}
%package -n ruby2.0-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.0-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 ruby2.0-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.0-rubygem-gem2rpm = %{version}
%description -n ruby2.0-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.0-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.0-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.0-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.0 gem2rpm.ruby2.0 %{_bindir}/gem2rpm.ruby2.0-%{version} %{mod_weight}
%preun -n ruby2.0-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.0-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.0-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.0 %{_bindir}/gem2rpm.ruby2.0-%{version}
fi
%files -n ruby2.0-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.0-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.0-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.0
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.0
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.0.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.0.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.0.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.0-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.0.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby22}
%package -n ruby2.2-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.2-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 ruby2.2-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.2-rubygem-gem2rpm = %{version}
%description -n ruby2.2-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.2-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.2-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.2-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.2 gem2rpm.ruby2.2 %{_bindir}/gem2rpm.ruby2.2-%{version} %{mod_weight}
%preun -n ruby2.2-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.2-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.2-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.2 %{_bindir}/gem2rpm.ruby2.2-%{version}
fi
%files -n ruby2.2-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.2-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.2-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.2
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.2
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.2.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.2.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.2.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.2-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.2.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby23}
%package -n ruby2.3-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.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 ruby2.3-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.3-rubygem-gem2rpm = %{version}
%description -n ruby2.3-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.3-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.3-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.3-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.3 gem2rpm.ruby2.3 %{_bindir}/gem2rpm.ruby2.3-%{version} %{mod_weight}
%preun -n ruby2.3-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.3-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.3-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.3 %{_bindir}/gem2rpm.ruby2.3-%{version}
fi
%files -n ruby2.3-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.3-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.3-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.3
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.3
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.3.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.3.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.3.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.3-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.3.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby24}
%package -n ruby2.4-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.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 ruby2.4-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.4-rubygem-gem2rpm = %{version}
%description -n ruby2.4-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.4-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.4-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.4-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.4 gem2rpm.ruby2.4 %{_bindir}/gem2rpm.ruby2.4-%{version} %{mod_weight}
%preun -n ruby2.4-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.4-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.4-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.4 %{_bindir}/gem2rpm.ruby2.4-%{version}
fi
%files -n ruby2.4-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.4-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.4-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.4
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.4
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.4.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.4.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.4.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.4-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.4.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby25}
%package -n ruby2.5-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.5-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 ruby2.5-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.5-rubygem-gem2rpm = %{version}
%description -n ruby2.5-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.5-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.5-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.5-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.5 gem2rpm.ruby2.5 %{_bindir}/gem2rpm.ruby2.5-%{version} %{mod_weight}
%preun -n ruby2.5-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.5-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.5-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.5 %{_bindir}/gem2rpm.ruby2.5-%{version}
fi
%files -n ruby2.5-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.5-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.5-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.5
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.5
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.5.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.5.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.5.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.5-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.5.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby26}
%package -n ruby2.6-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.6-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 ruby2.6-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.6-rubygem-gem2rpm = %{version}
%description -n ruby2.6-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.6-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.6-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.6-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.6 gem2rpm.ruby2.6 %{_bindir}/gem2rpm.ruby2.6-%{version} %{mod_weight}
%preun -n ruby2.6-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.6-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.6-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.6 %{_bindir}/gem2rpm.ruby2.6-%{version}
fi
%files -n ruby2.6-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.6-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.6-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.6
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.6
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.6.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.6.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.6.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.6-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.6.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby27}
%package -n ruby2.7-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby2.7-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 ruby2.7-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby2.7-rubygem-gem2rpm = %{version}
%description -n ruby2.7-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby2.7-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby2.7-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.7-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby2.7 gem2rpm.ruby2.7 %{_bindir}/gem2rpm.ruby2.7-%{version} %{mod_weight}
%preun -n ruby2.7-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby2.7-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby2.7-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby2.7 %{_bindir}/gem2rpm.ruby2.7-%{version}
fi
%files -n ruby2.7-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby2.7-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby2.7-%{version}
%ghost %{_bindir}/gem2rpm.ruby2.7
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby2.7
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/2.7.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/2.7.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/2.7.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby2.7-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/2.7.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby30}
%package -n ruby3.0-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby3.0-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.0-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby3.0-rubygem-gem2rpm = %{version}
%description -n ruby3.0-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby3.0-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby3.0-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.0-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby3.0 gem2rpm.ruby3.0 %{_bindir}/gem2rpm.ruby3.0-%{version} %{mod_weight}
%preun -n ruby3.0-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby3.0-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.0-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby3.0 %{_bindir}/gem2rpm.ruby3.0-%{version}
fi
%files -n ruby3.0-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby3.0-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby3.0-%{version}
%ghost %{_bindir}/gem2rpm.ruby3.0
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby3.0
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/3.0.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/3.0.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/3.0.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby3.0-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/3.0.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby31}
%package -n ruby3.1-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby3.1-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.1-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby3.1-rubygem-gem2rpm = %{version}
%description -n ruby3.1-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby3.1-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby3.1-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.1-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby3.1 gem2rpm.ruby3.1 %{_bindir}/gem2rpm.ruby3.1-%{version} %{mod_weight}
%preun -n ruby3.1-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby3.1-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.1-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby3.1 %{_bindir}/gem2rpm.ruby3.1-%{version}
fi
%files -n ruby3.1-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby3.1-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby3.1-%{version}
%ghost %{_bindir}/gem2rpm.ruby3.1
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby3.1
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/3.1.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/3.1.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/3.1.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby3.1-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/3.1.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with ruby32}
%package -n ruby3.2-rubygem-gem2rpm
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n ruby3.2-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.2-rubygem-gem2rpm-doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: ruby3.2-rubygem-gem2rpm = %{version}
%description -n ruby3.2-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n ruby3.2-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm gem2rpm %{_bindir}/gem2rpm.ruby3.2-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm-%{version} gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.2-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/gem2rpm.ruby3.2 gem2rpm.ruby3.2 %{_bindir}/gem2rpm.ruby3.2-%{version} %{mod_weight}
%preun -n ruby3.2-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm %{_bindir}/gem2rpm.ruby3.2-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} %{_bindir}/gem2rpm.ruby3.2-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.ruby3.2 %{_bindir}/gem2rpm.ruby3.2-%{version}
fi
%files -n ruby3.2-rubygem-gem2rpm
%defattr(-,root,root,-)
%{_docdir}/ruby3.2-rubygem-gem2rpm
#{_bindir}/gem2rpm-opensuse
%{_bindir}/gem2rpm.ruby3.2-%{version}
%ghost %{_bindir}/gem2rpm.ruby3.2
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm
%ghost %{_sysconfdir}/alternatives/gem2rpm.ruby3.2
%ghost %{_sysconfdir}/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/ruby/gems/3.2.0/cache/gem2rpm-%{version}.gem
%{_libdir}/ruby/gems/3.2.0/gems/gem2rpm-%{version}
%{_libdir}/ruby/gems/3.2.0/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n ruby3.2-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/3.2.0/doc/gem2rpm-%{version}
%endif
%endif
%if %{with rubinius25}
%package -n rbx2.5-rubygem-gem2rpm
# MANUAL
# /MANUAL
Summary: Generate rpm specfiles from gems
Group: Development/Languages/Ruby
Requires(post): update-alternatives
Requires(preun):update-alternatives
%description -n rbx2.5-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 rbx2.5-rubygem-gem2rpm-doc
Summary: RDoc documentation for gem2rpm
Group: Development/Languages/Ruby
Requires: rbx2.5-rubygem-gem2rpm = %{version}
%description -n rbx2.5-rubygem-gem2rpm-doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%post -n rbx2.5-rubygem-gem2rpm
/usr/sbin/update-alternatives --install \
/usr/bin/gem2rpm gem2rpm /usr/bin/gem2rpm.rbx2.5-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
/usr/bin/gem2rpm-%{version} gem2rpm-%{version} /usr/bin/gem2rpm.rbx2.5-%{version} %{mod_weight}
/usr/sbin/update-alternatives --install \
/usr/bin/gem2rpm.rbx2.5 gem2rpm.rbx2.5 /usr/bin/gem2rpm.rbx2.5-%{version} %{mod_weight}
%preun -n rbx2.5-rubygem-gem2rpm
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove gem2rpm /usr/bin/gem2rpm.rbx2.5-%{version}
/usr/sbin/update-alternatives --remove gem2rpm-%{version} /usr/bin/gem2rpm.rbx2.5-%{version}
/usr/sbin/update-alternatives --remove gem2rpm.rbx2.5 /usr/bin/gem2rpm.rbx2.5-%{version}
fi
%files -n rbx2.5-rubygem-gem2rpm
%defattr(-,root,root,-)
# MANUAL
# /MANUAL
/usr/share/doc/packages/rbx2.5-rubygem-gem2rpm
%{_bindir}/gem2rpm.rbx2.5-%{version}
%ghost %{_bindir}/gem2rpm.rbx2.5
%ghost %{_bindir}/gem2rpm-%{version}
%ghost %{_bindir}/gem2rpm
%ghost /etc/alternatives/gem2rpm
%ghost /etc/alternatives/gem2rpm.rbx2.5
%ghost /etc/alternatives/gem2rpm-%{version}
# cache file
%{_libdir}/rubinius/gems/2.5/cache/gem2rpm-%{version}.gem
%{_libdir}/rubinius/gems/2.5/gems/gem2rpm-%{version}
%{_libdir}/rubinius/gems/2.5/specifications/gem2rpm-%{version}.gemspec
%if %{with docs}
%files -n rbx2.5-rubygem-gem2rpm-doc
%defattr(-,root,root,-)
%doc %{_libdir}/rubinius/gems/2.5/doc/gem2rpm-%{version}
%endif
%endif
%else
%gem_packages
%endif
%changelog

32
series Normal file
View File

@ -0,0 +1,32 @@
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

14
template_loader.patch Normal file
View File

@ -0,0 +1,14 @@
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