%global gem_name ox Name: rubygem-%{gem_name} Version: 2.4.11 Release: 5.5%{?dist} Summary: Fast XML parser and object serializer Group: Development/Languages License: MIT URL: http://www.ohler.com/ox Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone https://github.com/ohler55/ox && cd ox # git checkout v2.4.11 # tar -czf rubygem-ox-2.4.11-test.tgz test/ Source1: %{name}-%{version}-test.tgz # Patch from upstream to revert for ruby < 2.4 (missing RSTRUCT_GET symbol) # https://github.com/ohler55/ox/commit/22838b8c07dd99bc2c575d2c3318861a53db028e # https://github.com/ohler55/ox/commit/258d089207a14927cf7ffccef13efe05ac181f39 Patch0: %{gem_name}-ruby24-upstream.patch # https://github.com/ohler55/ox/commit/e4565dbc167f0d38c3f93243d7a4fcfc391cbfc8 Patch1: %{gem_name}-CVE-2017-15928.patch # https://github.com/ohler55/ox/commit/0708ae44faf2ffc3d9330daf6ae023859a8b168b # https://github.com/ohler55/ox/commit/855e781242db2b14af68fe3b62bc20b462370fab Patch2: %{gem_name}-CVE-2017-16229.patch BuildRequires: gcc BuildRequires: rubygems-devel BuildRequires: ruby-devel BuildRequires: rubygem(bigdecimal) %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: rubygem(minitest5) %else BuildRequires: rubygem(minitest) >= 5 %endif # not automagically detected (from the compiled part) Requires: rubygem(bigdecimal) %if 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(release) Requires: ruby(rubygems) Provides: rubygem(%{gem_name}) = %{version} %endif %description A fast XML parser and object serializer that uses only standard C lib. Optimized XML (Ox), as the name implies was written to provide speed optimized XML handling. It was designed to be an alternative to Nokogiri and other Ruby XML parsers for generic XML parsing and as an alternative to Marshal for Object serialization. %package doc Summary: Documentation for %{name} Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc Documentation for %{name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} -a1 %if 0%{?rhel} && 0%{?rhel} <= 7 %patch0 -p1 -R %endif %patch1 -p1 %patch2 -p1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %if 0%{?rhel} && 0%{?rhel} <= 7 mkdir -p %{buildroot}%{gem_extdir_mri}/lib/ox mv %{buildroot}%{gem_instdir}/lib/ox.so %{buildroot}%{gem_extdir_mri}/lib/ox/ %else mkdir -p %{buildroot}%{gem_extdir_mri}/ox cp -a .%{gem_extdir_mri}/gem.build_complete %{buildroot}%{gem_extdir_mri}/ cp -a .%{gem_extdir_mri}/*.so %{buildroot}%{gem_extdir_mri}/ox/ %endif rm -rf %{buildroot}%{gem_instdir}/ext/ %check cp -pr test/ ./%{gem_instdir} pushd ./%{gem_instdir} # always use minitest (tests.rb requires it anyway) sed -i -e 's/\(use_minitest\) = .*/\1 = 1/' test/sax/sax_test.rb test/sax/smart_test.rb ruby -Ilib:test test/tests.rb ruby -Ilib:test test/sax/sax_test.rb rm -rf test popd %files %dir %{gem_instdir}/ %license %{gem_instdir}/LICENSE %{gem_extdir_mri}/ %{gem_libdir}/ %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir}/ %doc %{gem_instdir}/README.md %changelog * Mon Jan 06 2020 František Dvořák - 2.4.11-5 - Security fix for CVE-2017-16229 (#1549442) - more patches * Sun Jan 05 2020 František Dvořák - 2.4.11-4 - Security fix for CVE-2017-16229 (#1549442) * Fri Nov 03 2017 František Dvořák - 2.4.11-3 - Revert to 2.4.11 (#1449029) - Security fix for CVE-2017-15928 (#1509206) * Fri Apr 28 2017 František Dvořák - 2.4.13-1 - Update to 2.4.13 (#1441440) * Thu Mar 23 2017 František Dvořák - 2.4.11-2 - Patch for ruby 2.4 to revert on EPEL 7 (missing RSTRUCT_GET symbol) * Wed Mar 22 2017 František Dvořák - 2.4.11-1 - Update to 2.4.11 (#1433806) * Tue Feb 21 2017 František Dvořák - 2.4.9-1 - Update to 2.4.9 (#1413428) - Add gcc BR as required by C and C++ guidelines * Sat Feb 11 2017 Fedora Release Engineering - 2.4.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Jan 11 2017 Vít Ondruch - 2.4.7-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.4 * Mon Jan 09 2017 František Dvořák - 2.4.7-1 - Update to 2.4.7 (#1400215) * Wed Nov 23 2016 Vít Ondruch - 2.4.5-2 - Bump the release to get ppc64 builds. * Fri Oct 28 2016 František Dvořák - 2.4.5-1 - Update to 2.4.5 (#1365703) - Move README.md to doc subpackage (package review #1344101) * Tue Jul 05 2016 František Dvořák - 2.4.3-1 - Update to 2.4.3 (#1352504) - Enable tests on EPEL 7 * Sun Jun 19 2016 František Dvořák - 2.4.1-2 - Add bigdecimal runtime dependency * Tue May 10 2016 František Dvořák - 2.4.1-1 - Update to 2.4.1 (#1327571) * Sat Mar 19 2016 František Dvořák - 2.3.0-1 - Update to 2.3.0 (#1310639) * Sun Feb 07 2016 František Dvořák - 2.2.4-1 - Update to 2.2.4 - Removed F20 from macros - Add bigdecimal BR * Thu Feb 04 2016 Fedora Release Engineering - 2.2.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Wed Jan 06 2016 František Dvořák - 2.2.3-1 - Update to 2.2.3 * Thu Jun 18 2015 Fedora Release Engineering - 2.1.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Mar 27 2015 František Dvořák - 2.1.8-2 - Use the %%license tag - Move README.md to the main package * Tue Feb 17 2015 František Dvořák - 2.1.8-1 - Update to 2.1.8 * Tue Feb 10 2015 František Dvořák - 2.1.7-1 - Update to 2.1.7 * Wed Dec 31 2014 František Dvořák - 2.1.6-1 - Update to 2.1.6 - Changed license from BSD to MIT (https://github.com/ohler55/ox/issues/104) - Tests added * Fri Oct 03 2014 František Dvořák - 2.1.3-1 - Initial package