diff --git a/nokogiri-create-full-tarball.sh b/nokogiri-create-full-tarball.sh index d6fbd01..1cb4822 100644 --- a/nokogiri-create-full-tarball.sh +++ b/nokogiri-create-full-tarball.sh @@ -1,5 +1,17 @@ #!/bin/bash +git_restore_timestamp() +{ + set +x + echo "Restore timestamps" + git ls-tree -r --name-only HEAD | while read f + do + unixtime=$(git log -n 1 --pretty='%ct' -- $f) + touch -d "@${unixtime}" $f + done + set -x +} + if [ $# -lt 2 ] then echo "$0 " @@ -17,10 +29,14 @@ pushd $TMPDIRPATH git clone https://github.com/sparklemotion/$1.git pushd $1 git reset --hard v$2 +git_restore_timestamp popd ln -sf $1 $1-$2 -tar czf ${CURRDIR}/rubygem-$1-$2-full.tar.gz $1-$2/./ +tar czf \ + ${CURRDIR}/rubygem-$1-$2-full.tar.gz \ + "--exclude=nokogiri-$2/./.git" \ + $1-$2/./ popd diff --git a/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch b/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch index c1ed61c..6a34634 100644 --- a/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch +++ b/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch @@ -1,10 +1,13 @@ ---- nokogiri-1.11.0.rc4/lib/nokogiri/version/info.rb.warn 2020-12-31 16:56:11.533949657 +0900 -+++ nokogiri-1.11.0.rc4/lib/nokogiri/version/info.rb 2020-12-31 16:59:38.576697147 +0900 -@@ -58,6 +58,7 @@ module Nokogiri +--- nokogiri-1.18.5/lib/nokogiri/version/info.rb.warn 2023-11-29 01:25:54.000000000 +0900 ++++ nokogiri-1.18.5/lib/nokogiri/version/info.rb 2025-03-26 15:51:51.468291434 +0900 +@@ -70,6 +70,10 @@ module Nokogiri + end def warnings ++ [] ++ end ++ ++ def warnings_original warnings = [] -+ return warnings if libxml2? - if compiled_libxml_version != loaded_libxml_version diff --git a/rubygem-nokogiri-1.18.10-minitest6.patch b/rubygem-nokogiri-1.18.10-minitest6.patch new file mode 100644 index 0000000..f2e2b8f --- /dev/null +++ b/rubygem-nokogiri-1.18.10-minitest6.patch @@ -0,0 +1,11 @@ +diff -urp '--exclude=*~' nokogiri-1.18.10.orig/test/helper.rb nokogiri-1.18.10/test/helper.rb +--- nokogiri-1.18.10.orig/test/helper.rb 2025-12-24 12:29:06.569389292 +0900 ++++ nokogiri-1.18.10/test/helper.rb 2025-12-24 12:39:48.443826371 +0900 +@@ -41,6 +41,7 @@ warn + + require "minitest/autorun" + require "minitest/benchmark" ++require "minitest/mock" + + if !Nokogiri.jruby? && ENV["NCPU"].to_i > 1 + require "minitest/parallel_fork" diff --git a/rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch b/rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch deleted file mode 100644 index f45734b..0000000 --- a/rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- nokogiri-1.5.0/Rakefile.debug 2012-01-18 16:23:02.472224272 +0900 -+++ nokogiri-1.5.0/Rakefile 2012-01-18 16:23:29.935430496 +0900 -@@ -83,14 +83,21 @@ - HOE.spec.files += ['lib/nokogiri/nokogiri.jar'] - end - else -- require 'tasks/cross_compile' -+ do_cross_compile = true -+ begin -+ require 'tasks/cross_compile' -+ rescue RuntimeError => e -+ warn "WARNING: Could not perform some cross-compiling: #{e}" -+ do_cross_compile = false -+ end - require "rake/extensiontask" - -- HOE.spec.files.reject! { |f| f =~ %r{^ext/java|\.jar$} } -+ HOE.spec.files.reject! { |f| f =~ %r{^ext/java|\.jar$} } if do_cross_compile - - Rake::ExtensionTask.new("nokogiri", HOE.spec) do |ext| - ext.lib_dir = File.join(*['lib', 'nokogiri', ENV['FAT_DIR']].compact) - ext.config_options << ENV['EXTOPTS'] -+ next unless do_cross_compile - ext.cross_compile = true - ext.cross_platform = ["x86-mswin32-60", "x86-mingw32"] - ext.cross_config_options << "--with-xml2-include=#{File.join($recipes[:libxml2].path, 'include', 'libxml2')}" diff --git a/rubygem-nokogiri.spec b/rubygem-nokogiri.spec index 3a187b7..b28fa64 100644 --- a/rubygem-nokogiri.spec +++ b/rubygem-nokogiri.spec @@ -1,7 +1,7 @@ -%global mainver 1.13.10 +%global mainver 1.19.0 #%%global prever .rc4 -%global mainrel 1 +%global baserelease 2 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global gem_name nokogiri @@ -11,14 +11,15 @@ Summary: An HTML, XML, SAX, and Reader parser Name: rubygem-%{gem_name} Version: %{mainver} -Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist} +Release: %{?prever:0.}%{baserelease}%{?prever:.%{prerpmver}}%{?dist} +# SPDX confirmed # MIT: see LICENSE.md -# ASL 2.0 +# Apache-2.0 # 1.12.0 bundles forked and modified gumbo - # see gumbo-parser/src/attribute.c and ext/nokogiri/gumbo.c # also lib/nokogiri/html5 is licensed under ASL 2.0 -License: MIT and ASL 2.0 +License: MIT AND Apache-2.0 Provides: bundled(gumbo-parser) = 0.10.1 URL: https://nokogiri.org @@ -26,9 +27,6 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}%{?prever}-full.tar.gz Source2: nokogiri-create-full-tarball.sh -# ./test/html/test_element_description.rb:62 fails, as usual...... -# Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch -#Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch # Shut down libxml2 version unmatching warning Patch0: %{name}-1.11.0.rc4-shutdown-libxml2-warning.patch BuildRequires: ruby(release) @@ -36,6 +34,12 @@ BuildRequires: ruby(rubygems) ## ## For %%check BuildRequires: rubygem(minitest) +BuildRequires: rubygem(minitest-mock) +%if !0%{?rhel} +# For test/xml/test_document_encoding.rb +# Drop rubygem(rubyzip) build dependency in RHEL +BuildRequires: rubygem(rubyzip) +%endif BuildRequires: rubygems-devel Obsoletes: ruby-%{gem_name} <= 1.5.2-2 #BuildRequires: ruby(racc) @@ -49,7 +53,6 @@ BuildRequires: libxslt-devel BuildRequires: ruby-devel # ruby27 needs this explicitly BuildRequires: rubygem(racc) -Requires: rubygem(racc) %description Nokogiri parses and searches XML/HTML very quickly, and also has @@ -58,16 +61,6 @@ correctly implemented CSS3 selector support as well as XPath support. Nokogiri also features an Hpricot compatibility layer to help ease the change to using correct CSS and XPath. -%if 0 -%package jruby -Summary: JRuby support for %{name} -Requires: %{name} = %{version}-%{release} - -%description jruby -This package contains JRuby support for %{name}. -%endif - - %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} @@ -87,16 +80,23 @@ This package provides non-Gem support for %{gem_name}. %prep %setup -q -n %{gem_name}-%{version} -a 1 +cp -a %{gem_name}-%{version}/{.,*} . mv ../%{gem_name}-%{version}.gemspec . # patches -%patch0 -p1 +%patch -P0 -p1 # remove bundled external libraries sed -i \ -e 's|, "ports/archives/[^"][^"]*"||g' \ - -e 's|, "ports/patches/[^"][^"]*"||g' \ + -e 's|, "patches/[^"][^"]*"||g' \ %{gem_name}-%{version}.gemspec +# Make sure gem build will complain later if the previous regex is not enough. +rm -rf \ + ports \ + patches \ + %{nil} + # Actually not needed when using system libraries sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec @@ -105,7 +105,7 @@ sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec sed -i \ ext/nokogiri/extconf.rb \ -e "s@^\(def process_recipe.*\)\$@\1 ; return true@" \ - -e "s@^\(append_cppflags\).*gumbo.*\$@\1(\"-I$(pwd)/gumbo-parser/src\")@" \ + -e "s@^\([ \t]*append_cppflags\).*gumbo.*\$@\1(\"-I$(pwd)/gumbo-parser/src\")@" \ -e "\@libs.*gumbo@s@File\.join.*@\"$(pwd)/gumbo-parser/src/libgumbo.a\"@" \ -e "\@LIBPATH.*gumbo@s|^\(.*\)\$|# \1|" \ %{nil} @@ -120,10 +120,10 @@ sed -i \ gumbo-parser/src/Makefile \ -e 's|^\(CFLAGS.*=.*\)$|\1 -fPIC|' +%build # Ummm... env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec -%build # 1.6.0 needs this export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes @@ -176,13 +176,15 @@ do done # Copy document files from full source -cp -p %{gem_name}-%{version}/[A-Z]* %{buildroot}%{gem_instdir}/ +cp -p [A-Z]* %{buildroot}%{gem_instdir}/ # cleanups # Remove bundled gumbo parser pushd %{buildroot}%{gem_instdir} rm -rf \ Gemfile* \ + Rakefile \ + Vagrantfile \ dependencies.yml \ ext \ *gemspec \ @@ -190,10 +192,9 @@ rm -rf \ ports \ %{nil} pushd gumbo-parser -rm \ - Makefile \ - %{nil} -find src -type f | \ +find . -type f | \ + grep -v CHANGES.md | \ + grep -v THANKS | \ grep -v README.md | \ xargs rm -f @@ -209,12 +210,12 @@ export TZ="Asia/Tokyo" LANG=C.UTF-8 # Copy test files from full tarball -cp -a %{gem_name}-%{version}/test/ ./%{gem_instdir} +cp -a test/ ./%{gem_instdir} pushd ./%{gem_instdir} # Remove unneeded simplecov coverage test sed -i test/helper.rb \ - -e '\@require.*simplecov@,\@^end$@s|^|#|' + -e '\@^ require.*simplecov@,\@^ end$@s|^|#|' # Remove minitest-reporters. It does not provide any additional value while # it blows up the dependency chain. @@ -224,11 +225,6 @@ sed -i '/Minitest::Reporters/ s/^/#/' test/helper.rb # PPC64LE with ruby3.1 does not seem to support GC.compact %ifarch ppc64le export NOKOGIRI_TEST_GC_LEVEL=major -# F36 ruby has not implemented runtime GC compaction support yet -# c.f https://src.fedoraproject.org/rpms/ruby/pull-request/126 -%if 0%{?fedora} <= 36 -sed -i test/test_compaction.rb -e 's|skip unless GC.respond_to.*|skip|' -%endif %endif %ifarch s390x # With ruby 3.2 GC_LEVEL=compact seems to cause segfault: @@ -239,7 +235,7 @@ fi %endif env \ - RUBYLIB=".:lib:test:ext" \ + RUBYLIB=".:lib:test:%{buildroot}%{gem_extdir_mri}" \ ruby \ -e \ "require 'test/helper' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \ @@ -257,7 +253,9 @@ popd %{gem_extdir_mri}/ %dir %{gem_instdir}/ -%doc %{gem_instdir}/[A-Z]* +%license %{gem_instdir}/LICENSE*.md +%doc %{gem_instdir}/CHANGELOG.md +%doc %{gem_instdir}/README.md %{gem_instdir}/bin/ %{gem_instdir}/lib/ @@ -265,15 +263,178 @@ popd %dir %{gem_instdir}/gumbo-parser %dir %{gem_instdir}/gumbo-parser/src %doc %{gem_instdir}/gumbo-parser/[A-Z]* -%doc %{gem_instdir}/gumbo-parser/src/README.md +%license %{gem_instdir}/gumbo-parser/src/README.md %{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec %files doc %defattr(-,root,root,-) -%{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ +%doc %{gem_instdir}/CODE_OF_CONDUCT.md +%doc %{gem_instdir}/CONTRIBUTING.md +%doc %{gem_instdir}/ROADMAP.md +%doc %{gem_instdir}/SECURITY.md +%doc %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %changelog +* Thu Jan 08 2026 Mamoru TASAKA - 1.19.0-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_4.0 + +* Tue Dec 30 2025 Mamoru TASAKA - 1.19.0-1 +- 1.19.0 + +* Wed Dec 24 2025 Mamoru TASAKA - 1.18.10-2 +- Handle minitest 6 compatibility + +* Mon Sep 15 2025 Mamoru TASAKA - 1.18.10-1 +- 1.18.10 + +* Fri Jul 25 2025 Fedora Release Engineering - 1.18.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Mon Jul 21 2025 Mamoru TASAKA - 1.18.9-1 +- 1.18.9 + +* Wed Apr 23 2025 Mamoru TASAKA - 1.18.8-1 +- 1.18.8 + +* Mon Apr 07 2025 Mamoru TASAKA - 1.18.7-1 +- 1.18.7 + +* Sat Mar 29 2025 Mamoru TASAKA - 1.18.6-1 +- 1.18.6 + +* Wed Mar 26 2025 Mamoru TASAKA - 1.18.5-2 +- Suppress warnings from Nokogiri::VERSION_INFO (bug 2354787) + +* Thu Mar 20 2025 Mamoru TASAKA - 1.18.5-1 +- 1.18.5 + +* Sun Mar 16 2025 Mamoru TASAKA - 1.18.4-1 +- 1.18.4 + +* Wed Feb 19 2025 Mamoru TASAKA - 1.18.3-1 +- 1.18.3 + +* Mon Jan 20 2025 Mamoru TASAKA - 1.18.2-1 +- 1.18.2 + +* Sat Jan 18 2025 Fedora Release Engineering - 1.18.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Tue Jan 07 2025 Mamoru TASAKA - 1.18.1-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.4 + +* Mon Dec 30 2024 Mamoru TASAKA - 1.18.1-1 +- 1.18.1 + +* Sat Dec 28 2024 Mamoru TASAKA - 1.18.0-1 +- 1.18.0 + +* Fri Dec 13 2024 Mamoru TASAKA - 1.17.2-1 +- 1.17.2 + +* Wed Dec 11 2024 Mamoru TASAKA - 1.17.1-1 +- 1.17.1 + +* Mon Dec 09 2024 Mamoru TASAKA - 1.17.0-1 +- 1.17.0 + +* Thu Dec 05 2024 Mamoru TASAKA - 1.16.8-1 +- 1.16.8 + +* Wed Jul 31 2024 Mamoru TASAKA - 1.16.7-1 +- 1.16.7 + +* Fri Jul 19 2024 Fedora Release Engineering - 1.16.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sun Jun 16 2024 Mamoru TASAKA - 1.16.6-1 +- 1.16.6 + +* Tue May 14 2024 Mamoru TASAKA - 1.16.5-1 +- 1.16.5 + +* Thu Apr 25 2024 Mamoru TASAKA - 1.16.4-2 +- Make rubygem-minizip testsuite dependency optional, drop on RHEL + (Patch by Jun Aruga ) + +* Thu Apr 11 2024 Mamoru TASAKA - 1.16.4-1 +- 1.16.4 + +* Sun Mar 17 2024 Mamoru TASAKA - 1.16.3-1 +- 1.16.3 + +* Mon Feb 05 2024 Mamoru TASAKA - 1.16.2-1 +- 1.16.2 + +* Sun Feb 04 2024 Mamoru TASAKA - 1.16.1-1 +- 1.16.1 + +* Fri Jan 26 2024 Fedora Release Engineering - 1.16.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jan 03 2024 Mamoru TASAKA - 1.16.0-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.3 + +* Fri Dec 29 2023 Mamoru TASAKA - 1.16.0-1 +- 1.16.0 + +* Sat Nov 18 2023 Mamoru TASAKA - 1.15.5-1 +- 1.15.5 +- Backport upstream patch for libxml2 2.12.0 error handling change + +* Sat Aug 12 2023 Mamoru TASAKA - 1.15.4-1 +- 1.15.4 + +* Sun Aug 6 2023 Mamoru TASAKA - 1.15.3-4 +- Prefer upstream patch for the previous change + +* Fri Aug 4 2023 Mamoru TASAKA - 1.15.3-3 +- Support MiniTest 5.19+ + +* Fri Jul 21 2023 Fedora Release Engineering - 1.15.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jul 6 2023 Mamoru TASAKA - 1.15.3-1 +- 1.15.3 + +* Thu May 25 2023 Mamoru TASAKA - 1.15.2-1 +- 1.15.2 + +* Sun May 21 2023 Mamoru TASAKA - 1.15.1-1 +- 1.15.1 + +* Tue May 16 2023 Mamoru TASAKA - 1.15.0-1 +- 1.15.0 + +* Fri May 12 2023 Mamoru TASAKA - 1.14.4-1 +- 1.14.4 +- Note that CVE-2022-34169 is for vendored xalan-j, not affecting Fedora + nokogiri + +* Wed Apr 12 2023 Mamoru TASAKA - 1.14.3-1 +- 1.14.3 +- SPDX confirmed + +* Tue Feb 14 2023 Mamoru TASAKA - 1.14.2-1 +- 1.14.2 + +* Tue Jan 31 2023 Mamoru TASAKA - 1.14.1-1 +- 1.14.1 + +* Fri Jan 20 2023 Fedora Release Engineering - 1.14.0-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sun Jan 15 2023 Mamoru TASAKA - 1.14.0-1 +- 1.14.0 + +* Tue Jan 03 2023 Mamoru TASAKA - 1.13.10-2.1 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.2 + +* Sun Dec 25 2022 Mamoru TASAKA - 1.13.10-2 +- Use %%gem_extdir_mri instead of ext for %%check due to ruby3.2 change + for ext cleanup during build + * Fri Dec 9 2022 Mamoru TASAKA - 1.13.10-1 - 1.13.10 - Address CVE-2022-23476 diff --git a/sources b/sources index 89c1e92..52222fb 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nokogiri-1.13.10.gem) = aee3417d99a07c522d3fa479eddc952c4ec215a96e0dec9b6109af02855d5313d4b62d54544d36ed1a50f7993510d8fdc6fb93af4ae4bb289cc85f5d7ebb1556 -SHA512 (rubygem-nokogiri-1.13.10-full.tar.gz) = 780eae99316289c3365a383d20f3da20e52af8a636b4c403942ad8a65487f8da5bb22d48df85aab0ec9cb934c52f40478554d56868022077336fad434c6dadc2 +SHA512 (rubygem-nokogiri-1.19.0-full.tar.gz) = 29dd894b176857d55eb5e670f50e69762e74c0a13e6949030af17e3c84b65f9dfe0087210b84a7c77749d3d1a4a33292d62f7005003745e8f087d822ee64f4b1 +SHA512 (nokogiri-1.19.0.gem) = d9326a2e60b6ea3152c5f9d53df738610f18ca57cffcd3bf2f8b07a2b08b30085d0fce2ca8206279ad6a0f1a613e9e76821c09aef45cf5e5b2d00ff766734872