diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b92f1c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/thread_safe-0.3.5.gem diff --git a/.rh-ror50-rubygem-thread_safe.metadata b/.rh-ror50-rubygem-thread_safe.metadata new file mode 100644 index 0000000..1d921dd --- /dev/null +++ b/.rh-ror50-rubygem-thread_safe.metadata @@ -0,0 +1 @@ +c8d37f72d2c0f7949c89f62a47ad2daebf1f5311 SOURCES/thread_safe-0.3.5.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-thread_safe-0.3.5-optional-deps.patch b/SOURCES/rubygem-thread_safe-0.3.5-optional-deps.patch new file mode 100644 index 0000000..acab08e --- /dev/null +++ b/SOURCES/rubygem-thread_safe-0.3.5-optional-deps.patch @@ -0,0 +1,68 @@ +From cfd0933a6b784ac6bdca867777600137ff49ba5e Mon Sep 17 00:00:00 2001 +From: Ken Dreyer +Date: Tue, 24 Mar 2015 16:38:37 -0600 +Subject: [PATCH] tests: make simplecov/coveralls optional + +If we do not have SimpleCov or Coveralls installed, we should be able to +continue with the rest of the test suite. + +This allows the tests to run outside of Bundler if SimpleCov or +Coveralls are not installed. +--- + test/test_helper.rb | 42 +++++++++++++++++++++++------------------- + 1 file changed, 23 insertions(+), 19 deletions(-) + +diff --git a/test/test_helper.rb b/test/test_helper.rb +index 443aaae..3ddfce7 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -1,23 +1,27 @@ + unless defined?(JRUBY_VERSION) +- require 'simplecov' +- require 'coveralls' +- +- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ +- SimpleCov::Formatter::HTMLFormatter, +- Coveralls::SimpleCov::Formatter +- ] +- +- SimpleCov.start do +- project_name 'thread_safe' +- +- add_filter '/examples/' +- add_filter '/pkg/' +- add_filter '/test/' +- add_filter '/tasks/' +- add_filter '/yard-template/' +- add_filter '/yardoc/' +- +- command_name 'Mintest' ++ begin ++ require 'simplecov' ++ require 'coveralls' ++ ++ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ ++ SimpleCov::Formatter::HTMLFormatter, ++ Coveralls::SimpleCov::Formatter ++ ] ++ ++ SimpleCov.start do ++ project_name 'thread_safe' ++ ++ add_filter '/examples/' ++ add_filter '/pkg/' ++ add_filter '/test/' ++ add_filter '/tasks/' ++ add_filter '/yard-template/' ++ add_filter '/yardoc/' ++ ++ command_name 'Mintest' ++ end ++ rescue LoadError ++ warn "warning: simplecov/coveralls gems not found; skipping coverage" + end + end + +-- +1.9.3 + diff --git a/SOURCES/rubygem-thread_safe-0.3.5-suppress-Fixnum-warning-ruby2.4.patch b/SOURCES/rubygem-thread_safe-0.3.5-suppress-Fixnum-warning-ruby2.4.patch new file mode 100644 index 0000000..bbe49a2 --- /dev/null +++ b/SOURCES/rubygem-thread_safe-0.3.5-suppress-Fixnum-warning-ruby2.4.patch @@ -0,0 +1,15 @@ +diff --git a/lib/thread_safe/cache.rb b/lib/thread_safe/cache.rb +index 109cb98..265c0e5 100644 +--- a/lib/thread_safe/cache.rb ++++ b/lib/thread_safe/cache.rb +@@ -150,8 +150,8 @@ def populate_from(hash) + end + + def validate_options_hash!(options) +- if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(Fixnum) || initial_capacity < 0) +- raise ArgumentError, ":initial_capacity must be a positive Fixnum" ++ if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(0.class) || initial_capacity < 0) ++ raise ArgumentError, ":initial_capacity must be a positive #{0.class}" + end + if (load_factor = options[:load_factor]) && (!load_factor.kind_of?(Numeric) || load_factor <= 0 || load_factor > 1) + raise ArgumentError, ":load_factor must be a number between 0 and 1" diff --git a/SPECS/rubygem-thread_safe.spec b/SPECS/rubygem-thread_safe.spec new file mode 100644 index 0000000..274dc23 --- /dev/null +++ b/SPECS/rubygem-thread_safe.spec @@ -0,0 +1,178 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +# Generated from thread_safe-0.1.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name thread_safe + +# Perl auto-provides would generate a provide for 'package thread_safe;' +%if 0%{?rhel} > 6 +%global __provides_filter_from /perl(thread_safe)/ +%else +%{?filter_setup: +%filter_from_provides /perl(thread_safe)/d +%filter_setup +} +%endif + +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 0.3.5 +Release: 6%{?dist} +Summary: Thread-safe collections and utilities for Ruby +Group: Development/Languages +# jsr166e.LondAdder, jsr166e.Striped64, jsr166e.ConcurrentHashMapV8 +# and their Ruby ports are Public Domain +License: ASL 2.0 and Public Domain +URL: https://github.com/ruby-concurrency/thread_safe +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# Patch0 sent upstream at +# https://github.com/ruby-concurrency/thread_safe/pull/13 +Patch0: rubygem-thread_safe-0.3.5-optional-deps.patch +# Suppress deprecated Fixnum warnings on Ruby 2.4.0. +# https://github.com/ruby-concurrency/thread_safe/commit/8c929dc +Patch1: rubygem-thread_safe-0.3.5-suppress-Fixnum-warning-ruby2.4.patch + +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix_ruby}rubygem(minitest) +BuildRequires: %{?scl_prefix}rubygem(atomic) +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + +%description +A collection of data structures and utilities to make thread-safe +programming in Ruby easier. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%{?scl:scl enable %{scl} - << \EOF} +gem unpack %{SOURCE0} +%{?scl:EOF} + +%setup -q -D -T -n %{gem_name}-%{version} + +%{?scl:scl enable %{scl} - << \EOF} +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%{?scl:EOF} + +# Remove dependency on simplecov and coveralls: +%patch0 -p1 +%patch1 -p1 + +# Remove dependency on minitest-reporters: +sed -i -e "/minitest\/reporters/d" test/test_helper.rb +sed -i -e "/Minitest::Reporters/d" test/test_helper.rb + +%build +%{?scl:scl enable %{scl} - << \EOF} +set -e +gem build %{gem_name}.gemspec +%gem_install +%{?scl:EOF} + + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -pa .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd ./%{gem_instdir} +# Skip test_cache_loops.rb for MRI +# Apparantly still an issue on Ruby 2.0.0p247 (2013-06-27 revision 41674) +# http://bugs.ruby-lang.org/issues/8305 +# +# Skip test_hash.rb for MRI +# MRI issue/behaviour since thread_safe doesn't really modify MRI's Hash +# https://github.com/headius/thread_safe/issues/10 +%{?scl:scl enable %{scl} - << \EOF} +ruby -Ilib -e \ + 'Dir.glob "./test/test_{array,cache,helper,synchronized_delegator}.rb", &method(:require)' +%{?scl:EOF} +popd + + +%files +%{!?_licensedir:%global license %%doc} +%dir %{gem_instdir} +%{gem_libdir} +%{gem_spec} +%{gem_instdir}/LICENSE +%exclude %{gem_cache} +%exclude %{gem_instdir}/ext +%exclude %{gem_instdir}/.travis.yml + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.md +%{gem_instdir}/examples +%{gem_instdir}/Rakefile +%{gem_instdir}/Gemfile +%{gem_instdir}/%{gem_name}.gemspec +%{gem_instdir}/tasks +%{gem_instdir}/test +%{gem_instdir}/yard-template +%exclude %{gem_instdir}/.yardopts + +%changelog +* Mon Feb 13 2017 Jun Aruga - 0.3.5-6 +- Suppress deprecated Fixnum warnings on Ruby 2.4.0. + +* Fri Apr 08 2016 Pavel Valena - 0.3.5-5 +- Add missing 'popd' to %%check section + +* Mon Feb 22 2016 Pavel Valena - 0.3.5-4 +- Update to 0.3.5 + +* Fri Mar 20 2015 Josef Stribny - 0.3.4-3 +- Fix provides filtering on RHEL7 + - Related: rhbz#1203138 + +* Wed Mar 18 2015 Josef Stribny - 0.3.4-2 +- Fix: filter perl(thread_safe) provide out + - Resolves: rhbz#1203138 + +* Fri Jan 16 2015 Josef Stribny - 0.3.4-1 +- Update to 0.3.4 + +* Tue Feb 04 2014 Josef Stribny - 0.1.3-3 +- Add Public Domain to licenses + +* Mon Jan 27 2014 Josef Stribny - 0.1.3-2 +- Fix license to ASL 2.0 + - Resolves rhbz#1058281 + +* Wed Oct 30 2013 Josef Stribny - 0.1.3-1 +- Update to thread_safe 0.1.3 + +* Thu Oct 03 2013 Josef Stribny - 0.1.2-5 +- Fix macros for -doc sub-package + +* Thu Oct 03 2013 Josef Stribny - 0.1.2-4 +- Rebuild for scl + +* Tue Jul 30 2013 Josef Stribny - 0.1.2-3 +- Remove shebang from Rakefile +- Add BR: rubygem(atomic) + +* Mon Jul 29 2013 Josef Stribny - 0.1.2-2 +- Remove JRuby for now + +* Fri Jul 26 2013 Josef Stribny - 0.1.2-1 +- Update to 0.1.2 +- Add JRuby support + +* Thu May 09 2013 Josef Stribny - 0.1.0-1 +- Initial package