Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/ruby.git#35f28c9a6800eaf1d557b74e2f60d13e99cd2268
This commit is contained in:
DistroBaker 2021-01-27 21:33:45 +00:00
parent e2a680dabb
commit 5812295267
2 changed files with 75 additions and 44 deletions

View File

@ -22,7 +22,7 @@
%endif
%global release 144
%global release 145
%{!?release_string:%define release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
# The RubyGems library has to stay out of Ruby directory tree, since the
@ -93,7 +93,7 @@ Release: %{release_string}
# zlib: ext/digest/md5/md5.*, ext/nkf/nkf-utf8/nkf.c
# UCD: some of enc/trans/**/*.src
License: (Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD
URL: http://ruby-lang.org/
URL: https://www.ruby-lang.org/
Source0: https://cache.ruby-lang.org/pub/%{name}/%{major_minor_version}/%{ruby_archive}.tar.xz
Source1: operating_system.rb
# TODO: Try to push SystemTap support upstream.
@ -153,6 +153,9 @@ Patch10: ruby-3.0.0-Fixed-dangling-imemo_tmpbuf.patch
# https://bugs.ruby-lang.org/issues/17536
# https://github.com/ruby/ruby/pull/4077
Patch11: ruby-3.0.0-Dont-try-to-clear-cache-on-garbage-objects.patch
# Use proper path for plugin wrappers.
# https://github.com/rubygems/rubygems/pull/4317
Patch12: rubygems-3.2.7-Generate-plugin-wrappers-with-relative-requires.patch
# Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.
# https://bugs.ruby-lang.org/issues/16492
Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch
@ -161,7 +164,6 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Suggests: rubypick
Recommends: ruby(rubygems) >= %{rubygems_version}
Recommends: rubygem(bigdecimal) >= %{bigdecimal_version}
Recommends: rubygem(openssl) >= %{openssl_version}
BuildRequires: autoconf
BuildRequires: gdbm-devel
@ -223,6 +225,7 @@ Provides: bundled(ccan-list)
# StdLib default gems.
Provides: bundled(rubygem-did_you_mean) = %{did_you_mean_version}
Provides: bundled(rubygem-openssl) = %{openssl_version}
Provides: bundled(rubygem-racc) = %{racc_version}
# Tcl/Tk support was removed from stdlib in Ruby 2.4, i.e. F27 timeframe.
@ -248,7 +251,6 @@ Requires: ruby(release)
Recommends: rubygem(bundler) >= %{bundler_version}
Recommends: rubygem(rdoc) >= %{rdoc_version}
Recommends: rubygem(io-console) >= %{io_console_version}
Requires: rubygem(openssl) >= %{openssl_version}
Requires: rubygem(psych) >= %{psych_version}
Provides: gem = %{version}-%{release}
Provides: ruby(rubygems) = %{version}-%{release}
@ -289,6 +291,9 @@ Requires: rubygem(io-console)
# Obsoleted by Ruby 2.7 in F32 timeframe.
Obsoletes: rubygem-did_you_mean < 1.4.0-130
Obsoletes: rubygem-racc < 1.4.16-130
# Obsoleted by Ruby 3.0 in F34 timeframe.
Obsoletes: rubygem-openssl < 2.2.0-145
Provides: rubygem(openssl) = %{openssl_version}-%{release}
BuildArch: noarch
%description default-gems
@ -396,19 +401,6 @@ data to disk or transmit it over a network rather than use a verbose
markup language.
%package -n rubygem-openssl
Summary: OpenSSL provides SSL, TLS and general purpose cryptography
Version: %{openssl_version}
License: Ruby or BSD
Requires: ruby(release)
Requires: ruby(rubygems) >= %{rubygems_version}
Provides: rubygem(openssl) = %{version}-%{release}
%description -n rubygem-openssl
OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
OpenSSL library.
%package -n rubygem-psych
Summary: A libyaml wrapper for Ruby
Version: %{psych_version}
@ -433,7 +425,7 @@ Requires: ruby(rubygems) >= %{rubygems_version}
Requires: rubygem(io-console)
Provides: rubygem(bundler) = %{version}-%{release}
# https://github.com/bundler/bundler/issues/3647
Provides: bundled(connection_pool) = %{bundler_connection_pool_version}
Provides: bundled(rubygem-connection_pool) = %{bundler_connection_pool_version}
Provides: bundled(rubygem-fileutils) = %{bundler_fileutils_version}
Provides: bundled(rubygem-molinillo) = %{bundler_molinillo_version}
Provides: bundled(rubygem-net-http-persisntent) = %{bundler_net_http_persistent_version}
@ -579,8 +571,8 @@ to read and create these feeds.
%package -n rubygem-typeprof
Version: %{typeprof_version}
Summary: TypeProf is a type analysis tool for Ruby code based on abstract interpretation
Version: %{typeprof_version}
License: MIT
URL: https://github.com/ruby/typeprof
Requires: ruby(release)
@ -614,6 +606,7 @@ rm -rf ext/fiddle/libffi*
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch19 -p1
# Provide an example of usage of the tapset:
@ -758,21 +751,6 @@ ln -s %{gem_dir}/gems/json-%{json_version}/lib/json.rb %{buildroot}%{ruby_libdir
ln -s %{gem_dir}/gems/json-%{json_version}/lib/json %{buildroot}%{ruby_libdir}/json
ln -s %{_libdir}/gems/%{name}/json-%{json_version}/json/ %{buildroot}%{ruby_libarchdir}/json
mkdir -p %{buildroot}%{gem_dir}/gems/openssl-%{openssl_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/openssl-%{openssl_version}
mv %{buildroot}%{ruby_libdir}/openssl* %{buildroot}%{gem_dir}/gems/openssl-%{openssl_version}/lib
mv %{buildroot}%{ruby_libarchdir}/openssl.so %{buildroot}%{_libdir}/gems/%{name}/openssl-%{openssl_version}/
touch %{buildroot}%{_libdir}/gems/%{name}/openssl-%{openssl_version}/gem.build_complete
mv %{buildroot}%{gem_dir}/specifications/default/openssl-%{openssl_version}.gemspec %{buildroot}%{gem_dir}/specifications
# This used to be directory when OpenSSL was integral part of StdLib => Keep
# it as directory and link everything in it to prevent directory => symlink
# conversion RPM issues.
mkdir -p %{buildroot}%{ruby_libdir}/openssl
find %{buildroot}%{gem_dir}/gems/openssl-%{openssl_version}/lib/openssl -maxdepth 1 -type f -exec \
sh -c 'ln -s %{gem_dir}/gems/openssl-%{openssl_version}/lib/openssl/`basename {}` %{buildroot}%{ruby_libdir}/openssl' \;
ln -s %{gem_dir}/gems/openssl-%{openssl_version}/lib/openssl.rb %{buildroot}%{ruby_libdir}/openssl.rb
ln -s %{_libdir}/gems/%{name}/openssl-%{openssl_version}/openssl.so %{buildroot}%{ruby_libarchdir}/openssl.so
mkdir -p %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}
mv %{buildroot}%{ruby_libdir}/psych* %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
@ -901,6 +879,15 @@ make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE13}"
DISABLE_TESTS=""
MSPECOPTS=""
%ifarch armv7hl ppc64le
# Disable test which started to fail presumably after move to DWARF5:
# https://bugzilla.redhat.com/show_bug.cgi?id=1920533
# Unfortunately, these used to be problematic already before:
# https://bugs.ruby-lang.org/issues/13758
DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\|loaded_features\)/"
DISABLE_TESTS="$DISABLE_TESTS -n !/test_bug_reporter_add/"
%endif
# Avoid `hostname' dependency.
%{!?with_hostname:MSPECOPTS="-P 'Socket.gethostname returns the host name'"}
@ -957,7 +944,6 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
%exclude %{ruby_libdir}/bigdecimal*
%exclude %{ruby_libdir}/irb*
%exclude %{ruby_libdir}/json*
%exclude %{ruby_libdir}/openssl*
%exclude %{ruby_libdir}/psych*
%{ruby_libdir}/abbrev.rb
%{ruby_libdir}/base64.rb
@ -1128,6 +1114,8 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
# Default gems
%{ruby_libdir}/did_you_mean*
%{ruby_libdir}/openssl*
%{ruby_libarchdir}/openssl.so
%{ruby_libdir}/racc*
%dir %{ruby_libarchdir}/racc
%{ruby_libarchdir}/racc/cparse.so
@ -1203,6 +1191,7 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
%{gem_dir}/specifications/default/open3-0.1.1.gemspec
%{gem_dir}/specifications/default/open-uri-0.1.0.gemspec
%{gem_dir}/specifications/default/optparse-0.1.0.gemspec
%{gem_dir}/specifications/default/openssl-%{openssl_version}.gemspec
%{gem_dir}/specifications/default/ostruct-0.3.1.gemspec
%{gem_dir}/specifications/default/pathname-0.1.0.gemspec
%{gem_dir}/specifications/default/pp-0.1.0.gemspec
@ -1244,7 +1233,6 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
%exclude %{_bindir}/racc
%exclude %{gem_dir}/gems/racc-%{racc_version}/bin
%files -n rubygem-irb
%{_bindir}/irb
%{ruby_libdir}/irb*
@ -1286,14 +1274,6 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
%{gem_dir}/gems/json-%{json_version}
%{gem_dir}/specifications/json-%{json_version}.gemspec
%files -n rubygem-openssl
%{ruby_libdir}/openssl
%{ruby_libdir}/openssl.rb
%{ruby_libarchdir}/openssl.so
%{_libdir}/gems/%{name}/openssl-%{openssl_version}
%{gem_dir}/gems/openssl-%{openssl_version}
%{gem_dir}/specifications/openssl-%{openssl_version}.gemspec
%files -n rubygem-psych
%{ruby_libdir}/psych
%{ruby_libdir}/psych.rb
@ -1395,6 +1375,10 @@ MSPECOPTS="$MSPECOPTS -P 'raises TypeError if one of the passed exceptions is no
%changelog
* Mon Jan 25 2021 Vít Ondruch <vondruch@redhat.com> - 3.0.0-145
- Bundle OpenSSL into StdLib.
- Use proper path for plugin wrappers.
* Sat Jan 16 2021 Vít Ondruch <vondruch@redhat.com> - 3.0.0-144
- Fix SEGFAULT in rubygem-shoulda-matchers test suite.

View File

@ -0,0 +1,47 @@
From db4157e9aa7b7f720ee06fb866b53ad11879c016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@riseup.net>
Date: Mon, 25 Jan 2021 15:40:26 +0100
Subject: [PATCH] Generate plugin wrappers with relative requires
It shouldn't change behaviour and it fixes broken wrappers generated
with `--build-root` flag is used.
---
lib/rubygems/installer_uninstaller_utils.rb | 7 ++++++-
test/rubygems/test_gem_installer.rb | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/rubygems/installer_uninstaller_utils.rb b/lib/rubygems/installer_uninstaller_utils.rb
index e81ed4cba38..2c8b7c635e1 100644
--- a/lib/rubygems/installer_uninstaller_utils.rb
+++ b/lib/rubygems/installer_uninstaller_utils.rb
@@ -6,11 +6,16 @@
module Gem::InstallerUninstallerUtils
def regenerate_plugins_for(spec, plugins_dir)
+ plugins = spec.plugins
+ return if plugins.empty?
+
+ require 'pathname'
+
spec.plugins.each do |plugin|
plugin_script_path = File.join plugins_dir, "#{spec.name}_plugin#{File.extname(plugin)}"
File.open plugin_script_path, 'wb' do |file|
- file.puts "require '#{plugin}'"
+ file.puts "require_relative '#{Pathname.new(plugin).relative_path_from(Pathname.new(plugins_dir))}'"
end
verbose plugin_script_path
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 4ce7e92442a..5652d863316 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -821,6 +821,8 @@ def test_generate_plugins_with_build_root
assert !File.exist?(system_path), 'plugin written incorrect written to system plugins_dir'
assert File.exist?(build_root_path), 'plugin not written to build_root'
+
+ refute_includes File.read(build_root_path), build_root
end
def test_keeps_plugins_up_to_date