Accepting request 1086831 from devel:languages:ruby

- bump the version so we can require the new version to make it
  easier to depend on the new functionality

- Support runtime dependencies for the generated subpackages:
  syntax:
  Requires: rubygem(gemname)
  Recommends: rubygem(gemname:x) >= x.y
  This will be transformed into
  Requires: rubygem(ruby:<rubyabi>:gemname)
  Recommends: rubygem(ruby:<rubyabi>:gemname:x) >= x.y
  That way we ensure that every package only requires rubygems for
  the current ruby version.

OBS-URL: https://build.opensuse.org/request/show/1086831
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ruby-common?expand=0&rev=25
This commit is contained in:
Dominique Leuenberger 2023-05-14 14:31:32 +00:00 committed by Git OBS Bridge
commit 6d1c987079
3 changed files with 40 additions and 3 deletions

View File

@ -61,7 +61,21 @@
custom_pkgs
end
rb_pkg_abi = "#{RUBY_ENGINE}:#{RUBY_ENGINE_VERSION}:#{spec.name}"
def self.fix_up_rubygem_requires_with_rb_api(rb_api, preamble_text)
STDERR.puts(preamble_text)
preamble_text.lines.map do |line|
if mo = /^(?<pre_text>\s*\S+\s*:\s+rubygem\()(?<pkg_info>[^\)]+)(?<post_text>\).*)?$/.match(line)
if not(mo[:pkg_info] =~ /^ruby:\d\.\d\.\d/)
line = "#{mo[:pre_text]}#{rb_api}:#{mo[:pkg_info]}#{mo[:post_text]}"
end
end
line
end.join("\n")
end
rb_api = "#{RUBY_ENGINE}:#{RbConfig::CONFIG['ruby_version']}"
rb_pkg_abi = "#{rb_api}:#{spec.name}"
rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '')
rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '')
@ -104,7 +118,7 @@
%package -n <%= pkg_basename %><%= config[:version_suffix] %>
# MANUAL
<% if config[:main] && config[:main][:preamble] -%>
<%= config[:main][:preamble] %>
<%= fix_up_rubygem_requires_with_rb_api(rb_api, config[:main][:preamble]) %>
<% end -%>
# /MANUAL
Summary: <%= config[:summary] or spec.summary %>

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Fri May 12 21:28:54 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- bump the version so we can require the new version to make it
easier to depend on the new functionality
-------------------------------------------------------------------
Fri May 12 14:21:14 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- Support runtime dependencies for the generated subpackages:
syntax:
Requires: rubygem(gemname)
Recommends: rubygem(gemname:x) >= x.y
This will be transformed into
Requires: rubygem(ruby:<rubyabi>:gemname)
Recommends: rubygem(ruby:<rubyabi>:gemname:x) >= x.y
That way we ensure that every package only requires rubygems for
the current ruby version.
-------------------------------------------------------------------
Sun May 7 00:35:06 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>

View File

@ -22,7 +22,7 @@
%endif
Name: ruby-common
Version: 3.2
Version: 3.2.1
Release: 0
# ruby-macros and ruby-common version
%define rpm_macros_version 5