diff --git a/.gitignore b/.gitignore index dcf5c8f..79fb8fd 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ rubygems-1.3.7.tgz /rubygems-2.1.10.tgz /rubygems-2.1.11.tgz /rubygems-2.2.2.tgz +/rubygems-2.4.8.tgz diff --git a/load.inc b/load.inc deleted file mode 100644 index bf9c07e..0000000 --- a/load.inc +++ /dev/null @@ -1,30 +0,0 @@ -%{lua: - -function source_macros(file) - local macro = nil - - for line in io.lines(file) do - if not macro and line:match("^%%") then - macro = line:match("^%%(.*)$") - line = nil - end - - if macro then - if line and macro:match("^.-%s*\\%s*$") then - macro = macro .. '\n' .. line - end - - if not macro:match("^.-%s*\\%s*$") then - rpm.define(macro) - macro = nil - end - end - end -end - -} - -# Include the constants defined in macros files. Could be dropped as soon as -# RPM supports the %%load macro (RPM 4.12+ probably). -# http://lists.rpm.org/pipermail/rpm-maint/2014-February/003659.html -%define load() %{lua:source_macros(rpm.expand("%1"))} diff --git a/operating_system.rb b/operating_system.rb index 079564f..ed653fd 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -6,6 +6,8 @@ module Gem # E.g. for '/usr/share/ruby', 'ruby', it returns '/usr' def previous_but_one_dir_to(path, dir) + return unless path + split_path = path.split(File::SEPARATOR) File.join(split_path.take_while { |one_dir| one_dir !~ /^#{dir}$/ }[0..-2]) end @@ -27,8 +29,8 @@ module Gem def default_locations @default_locations ||= { - :system => previous_but_one_dir_to(ConfigMap[:vendordir], ConfigMap[:RUBY_INSTALL_NAME]), - :local => previous_but_one_dir_to(ConfigMap[:sitedir], ConfigMap[:RUBY_INSTALL_NAME]) + :system => previous_but_one_dir_to(RbConfig::CONFIG['vendordir'], RbConfig::CONFIG['RUBY_INSTALL_NAME']), + :local => previous_but_one_dir_to(RbConfig::CONFIG['sitedir'], RbConfig::CONFIG['RUBY_INSTALL_NAME']) } end @@ -39,18 +41,30 @@ module Gem def default_dirs @libdir ||= case RUBY_PLATFORM when 'java' - ConfigMap[:datadir] + RbConfig::CONFIG['datadir'] else - ConfigMap[:libdir] + RbConfig::CONFIG['libdir'] end - @default_dirs ||= Hash[default_locations.collect do |destination, path| - [destination, { - :bin_dir => File.join(path, ConfigMap[:bindir].split(File::SEPARATOR).last), - :gem_dir => File.join(path, ConfigMap[:datadir].split(File::SEPARATOR).last, 'gems'), - :ext_dir => File.join(path, @libdir.split(File::SEPARATOR).last, 'gems') - }] - end] + @default_dirs ||= default_locations.inject(Hash.new) do |hash, location| + destination, path = location + + hash[destination] = if path + { + :bin_dir => File.join(path, RbConfig::CONFIG['bindir'].split(File::SEPARATOR).last), + :gem_dir => File.join(path, RbConfig::CONFIG['datadir'].split(File::SEPARATOR).last, 'gems'), + :ext_dir => File.join(path, @libdir.split(File::SEPARATOR).last, 'gems') + } + else + { + :bin_dir => '', + :gem_dir => '', + :ext_dir => '' + } + end + + hash + end end ## diff --git a/rubygem-2.4.8-Increase-DH-key-size-fixes-1289.patch b/rubygem-2.4.8-Increase-DH-key-size-fixes-1289.patch new file mode 100644 index 0000000..be5e72f --- /dev/null +++ b/rubygem-2.4.8-Increase-DH-key-size-fixes-1289.patch @@ -0,0 +1,28 @@ +From d000290a675745d9fb8a4658b8b5922f6a734522 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 16 Jun 2015 08:22:47 +0200 +Subject: [PATCH] Increase DH key size (fixes #1289). + +This fixes compatibility with OpenSLL 1.0.2c+: + +https://www.openssl.org/blog/blog/2015/05/20/logjam-freak-upcoming-changes/ +--- + test/rubygems/test_gem_remote_fetcher.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb +index 6b29e18..c318870 100644 +--- a/test/rubygems/test_gem_remote_fetcher.rb ++++ b/test/rubygems/test_gem_remote_fetcher.rb +@@ -898,7 +898,7 @@ gems: + server.mount_proc("/insecure_redirect") { |req, res| + res.set_redirect(WEBrick::HTTPStatus::MovedPermanently, req.query['to']) + } +- server.ssl_context.tmp_dh_callback = proc { OpenSSL::PKey::DH.new 128 } ++ server.ssl_context.tmp_dh_callback = proc { OpenSSL::PKey::DH.new 2048 } + t = Thread.new do + begin + server.start +-- +2.4.3 + diff --git a/rubygems.attr b/rubygems.attr index f711775..f033d43 100644 --- a/rubygems.attr +++ b/rubygems.attr @@ -1,3 +1,5 @@ %__rubygems_requires %{_rpmconfigdir}/rubygems.req %__rubygems_provides %{_rpmconfigdir}/rubygems.prov -%__rubygems_path ^%{gem_spec}$ +# In non-gem packages, the %%{gem_name} macro is not available and the macro +# stays unexpanded which leads to "invalid regex" error (rhbz#1154067). +%__rubygems_path ^%{?gem_name:%{gem_spec}}%{!?gem_name:this_should_never_match_anything}$ diff --git a/rubygems.spec b/rubygems.spec index 4c17b5a..988a2f8 100644 --- a/rubygems.spec +++ b/rubygems.spec @@ -24,8 +24,8 @@ Summary: The Ruby standard for packaging ruby libraries Name: rubygems -Version: 2.2.2 -Release: 101%{?dist} +Version: 2.4.8 +Release: 100%{?dist} Group: Development/Libraries License: Ruby or MIT @@ -48,12 +48,11 @@ Source11: check_CVE-2013-4287.rb # http://seclists.org/oss-sec/2013/q3/605 Source12: check_CVE-2013-4363.rb -# %%load function should be supported in RPM 4.12+. -# http://lists.rpm.org/pipermail/rpm-maint/2014-February/003659.html -Source100: load.inc -%include %{SOURCE100} +# Fix test suite failure with openssl-1.0.2c+. +# https://github.com/rubygems/rubygems/issues/1289 +Patch0: rubygem-2.4.8-Increase-DH-key-size-fixes-1289.patch -%{load %{SOURCE5}} +%{?load:%{SOURCE5}} Requires: ruby(release) Requires: rubygem(rdoc) >= 4.0.0 @@ -68,9 +67,11 @@ BuildRequires: rubygem(rake) BuildRequires: rubygem(rdoc) >= 4.0.0 BuildRequires: rubygem(io-console) >= 0.4.1 BuildRequires: rubygem(psych) >= 2.0.0 -%endif # TestGemExtCmakeBuilder -BuildRequires: cmake +BuildRequires: %{_bindir}/cmake +BuildRequires: git +BuildRequires: rubygem(builder) +%endif BuildArch: noarch Provides: ruby(rubygems) = %{version}-%{release} Provides: gem = %{version}-%{release} @@ -80,14 +81,14 @@ RubyGems is the Ruby standard for publishing and managing third party libraries. %package devel -Summary: Macros and development tools for packagin RubyGems +Summary: Macros and development tools for packaging RubyGems Group: Development/Libraries License: Ruby or MIT Requires: ruby(%{name}) = %{version}-%{release} BuildArch: noarch %description devel -Macros and development tools for packagin RubyGems. +Macros and development tools for packaging RubyGems. %package doc Summary: Documentation for %{name} @@ -97,32 +98,28 @@ Requires: ruby(%{name}) = %{version}-%{release} BuildArch: noarch %description doc -Documentation for %{name} +Documentation for %{name}. %prep %setup -q -# Some of the library files start with #! which rpmlint doesn't like -# and doesn't make much sense -for f in `find lib -name \*.rb` ; do - head -1 $f | grep -q '^#!/usr/bin/env ruby' && sed -i -e '1d' $f -done +%patch0 -p1 %build # Nothing %install -# LANG=C does not work -env \ - LANG=en_US.UTF-8 \ - GEM_HOME=%{buildroot}/%{gem_dir} \ +GEM_HOME=%{buildroot}/%{gem_dir} \ ruby setup.rb \ -%if 0 - --rdoc \ -%endif + --document rdoc,ri \ --prefix=/ \ --backtrace \ - --destdir=%{buildroot}/%{rubygems_dir}/ + --destdir=%{buildroot}/%{rubygems_dir}/ + +# Remove original filenames from *.gz files. +# https://github.com/rdoc/rdoc/pull/341 +find %{buildroot}/%{gem_dir}/ -name *.gz \ + -exec sh -c "gzip -dc '{}' | gzip > '{}.new' && mv '{}.new' '{}'" \; mkdir -p %{buildroot}/%{_bindir} mv %{buildroot}/%{rubygems_dir}/bin/gem %{buildroot}/%{_bindir}/gem @@ -137,7 +134,9 @@ for cert in \ Class3PublicPrimaryCertificationAuthority.pem \ DigiCertHighAssuranceEVRootCA.pem \ EntrustnetSecureServerCertificationAuthority.pem \ - GeoTrustGlobalCA.pem + GeoTrustGlobalCA.pem \ + AddTrustExternalCARoot.pem \ + AddTrustExternalCARoot-2048.pem do rm %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/$cert done @@ -174,22 +173,21 @@ touch lib/rubygems/defaults/operating_system.rb # It is necessary to specify the paths using RUBYOPT to let the test suite pass." export GEM_PATH=%{gem_dir} -RUBYOPT="-Itest -Ilib" +RUBYOPT="-Ilib:test" for module in \ - io-console \ - json \ - psych + json; \ do for dir in \ %{gem_dir}/gems/$module-*/lib \ %{buildtime_libdir}/gems/ruby/$module-* do - RUBYOPT="$RUBYOPT -I$dir" + RUBYOPT="$RUBYOPT:$dir" done done export RUBYOPT -testrb test +# TODO: Not sure why Builder is not required by rubygems/indexer :/ +ruby -rbuilder/xchar -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' # CVE vulnerability check ruby -Ilib %{SOURCE11} @@ -237,6 +235,9 @@ ruby -Ilib %{SOURCE12} %changelog +* Fri Jul 10 2015 Vít Ondruch - 2.4.8-100 +- Update to RubyGems 2.4.8. + * Sun Jun 08 2014 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild diff --git a/sources b/sources index f00a636..71255a9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f297a3fa7b1f3b693a11183a31668b9b rubygems-2.2.2.tgz +dc77b51449dffe5b31776bff826bf559 rubygems-2.4.8.tgz