diff --git a/nokogiri-1.14.4.gem b/nokogiri-1.16.7.gem similarity index 38% rename from nokogiri-1.14.4.gem rename to nokogiri-1.16.7.gem index 628f3366a5b0f6e5463c9de97e252ad885262087..545efa3a88bfa316766150f6c017cfa9395d18d8 100644 Binary files a/nokogiri-1.14.4.gem and b/nokogiri-1.16.7.gem differ diff --git a/rubygem-nokogiri-1.14.4-full.tar.gz b/rubygem-nokogiri-1.16.7-full.tar.gz similarity index 83% rename from rubygem-nokogiri-1.14.4-full.tar.gz rename to rubygem-nokogiri-1.16.7-full.tar.gz index abac1e4e6d09ea525edfaa3f9a6a3fb85ab00433..f5761eaff07b8d19d6f90704f1e6a302b545f153 100644 Binary files a/rubygem-nokogiri-1.14.4-full.tar.gz and b/rubygem-nokogiri-1.16.7-full.tar.gz differ diff --git a/rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch b/rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7b2b1c69c87931846a94fd72b0e5a91d7de4a21 --- /dev/null +++ b/rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch @@ -0,0 +1,31 @@ +From 26e5ba521208706ae68f19062d4ad24ad257aa47 Mon Sep 17 00:00:00 2001 +From: Jun Aruga +Date: Mon, 15 Apr 2024 15:46:30 +0200 +Subject: [PATCH] Make a test depending on the rubyzip gem optional. + +Because I still want to pass the nokogiri's unit tests in a downstream nokogiri +package on a Linux distro such as CentOS 10 Stream and RHEL 10, where we don't +want to manage the rubyzip gem[1]. + +[1] https://rubygems.org/gems/rubyzip +--- + test/xml/test_document_encoding.rb | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/test/xml/test_document_encoding.rb b/test/xml/test_document_encoding.rb +index cd8b1b4da2..c0cb93b283 100644 +--- a/test/xml/test_document_encoding.rb ++++ b/test/xml/test_document_encoding.rb +@@ -91,7 +91,11 @@ class TestDocumentEncoding < Nokogiri::TestCase + describe "pseudo-IO" do + it "serializes correctly with Zip::OutputStream objects" do + # https://github.com/sparklemotion/nokogiri/issues/2773 +- require "zip" ++ begin ++ require "zip" ++ rescue LoadError ++ skip("rubyzip is not installed") ++ end + + xml = <<~XML + diff --git a/rubygem-nokogiri.spec b/rubygem-nokogiri.spec index 4ed570641364547e7831ac942d2b7df5945b5f87..ecfe69102ae48ee020c05b1a87deaa399aa90c5a 100644 --- a/rubygem-nokogiri.spec +++ b/rubygem-nokogiri.spec @@ -1,9 +1,7 @@ -%global mainver 1.14.4 -%global mainrel 1 +%global mainver 1.16.7 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global gem_name nokogiri -%undefine __brp_mangle_shebangs -%undefine _changelog_trimtime +%undefine __brp_mangle_shebangs Summary: An HTML, XML, SAX, and Reader parser Name: rubygem-%{gem_name} Version: %{mainver} @@ -12,6 +10,10 @@ License: MIT and Apache-2.0 URL: https://nokogiri.org Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem Source1: rubygem-%{gem_name}-%{version}%{?prever}-full.tar.gz +Source2: nokogiri-create-full-tarball.sh +# https://github.com/sparklemotion/nokogiri/pull/3177 +# Make rubygem-minizip dependency optional +Patch0: %{name}-pr3177-rubyzip-dep-optional.patch BuildRequires: ruby(release) ruby(rubygems) rubygem(minitest) rubygems-devel rubygem(rubyzip) BuildRequires: rubygem(did_you_mean) @@ -24,14 +26,6 @@ Nokogiri parses and searches XML/HTML very quickly, and also has 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} @@ -49,11 +43,17 @@ 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 . +%patch -P0 -p1 sed -i \ -e 's|, "ports/archives/[^"][^"]*"||g' \ - -e 's|, "ports/patches/[^"][^"]*"||g' \ + -e 's|, "patches/[^"][^"]*"||g' \ %{gem_name}-%{version}.gemspec +rm -rf \ + ports \ + patches \ + %{nil} sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec sed -i \ ext/nokogiri/extconf.rb \ @@ -68,11 +68,9 @@ sed -i \ sed -i \ gumbo-parser/src/Makefile \ -e 's|^\(CFLAGS.*=.*\)$|\1 -fPIC|' -env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec -#CVE-2022-40303 https://gitlab.gnome.org/GNOME/libxml2/-/commit/c846986 -sed -i 's/assert_predicate(handler.errors, :empty?)/assert_match(\/CData section too big\/, handler.errors.first)/g' nokogiri-1.14.4/test/xml/sax/test_parser.rb %build +env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes %set_build_flags pushd gumbo-parser/src/ @@ -80,7 +78,7 @@ make libgumbo.a popd %gem_install chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem -rm -f .%{gem_instdir}/lib/*.jar +find .%{gem_instdir}/lib/ -name '*.jar' -delete rm -rf .%{gem_instdir}/ext/java %install @@ -95,16 +93,18 @@ rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log} popd mkdir -p %{buildroot}%{_bindir} cp -pa .%{_bindir}/* \ - %{buildroot}%{_bindir}/ + %{buildroot}%{_bindir}/ for f in $(find %{buildroot}%{gem_instdir} -name \*.rb) do sed -i -e '/^#!/d' $f chmod 0644 $f done -cp -p %{gem_name}-%{version}/[A-Z]* %{buildroot}%{gem_instdir}/ +cp -p [A-Z]* %{buildroot}%{gem_instdir}/ pushd %{buildroot}%{gem_instdir} rm -rf \ Gemfile* \ + Rakefile \ + Vagrantfile \ dependencies.yml \ ext \ *gemspec \ @@ -112,10 +112,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 popd @@ -124,10 +123,10 @@ rm -f %{buildroot}%{gem_cache} %check export TZ="Asia/Tokyo" LANG=C.UTF-8 -cp -a %{gem_name}-%{version}/test/ ./%{gem_instdir} +cp -a test/ ./%{gem_instdir} pushd ./%{gem_instdir} sed -i test/helper.rb \ - -e '\@require.*simplecov@,\@^end$@s|^|#|' + -e '\@^ require.*simplecov@,\@^ end$@s|^|#|' sed -i '/require..minitest.reporters./ s/^/#/' test/helper.rb sed -i '/Minitest::Reporters/ s/^/#/' test/helper.rb env \ @@ -136,7 +135,7 @@ env \ -e \ "require 'test/helper' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \ exit 1 - echo "Please investigate this" + for f in $SKIPTEST do mv $f.skip $f @@ -163,6 +162,9 @@ popd %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %changelog +* Mon Aug 05 2024 jiangxinyu - 1.16.7-1 +- Update package to version 1.16.7 + * Tue Aug 01 2023 jiangxinyu - 1.14.4-1 - Update to 1.14.4