diff --git a/.gitignore b/.gitignore index feafd3e..bb5c82c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,2 @@ -nokogiri-1.4.2.gem -nokogiri-1.4.3.1.gem -/nokogiri-1.5.0.beta.2.gem -/nokogiri-1.5.0.beta.3.gem -/nokogiri-1.5.0.beta.4.gem -/nokogiri-1.5.0.gem -/nokogiri-1.5.2.gem -/nokogiri-1.5.5.gem -/nokogiri-1.5.6.gem -/nokogiri-1.5.9.gem -/nokogiri-1.5.11.gem -/nokogiri-1.6.0.gem -/nokogiri-1.6.1.gem +/nokogiri-*.gem +/rubygem-nokogiri-*-full.tar.gz diff --git a/nokogiri-1.6.1.gem b/nokogiri-1.6.1.gem deleted file mode 100644 index 8de96b6..0000000 Binary files a/nokogiri-1.6.1.gem and /dev/null differ diff --git a/nokogiri-create-full-tarball.sh b/nokogiri-create-full-tarball.sh new file mode 100644 index 0000000..1cb4822 --- /dev/null +++ b/nokogiri-create-full-tarball.sh @@ -0,0 +1,43 @@ +#!/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 " + exit 1 +fi + +set -x +set -e + +CURRDIR=$(pwd) + +TMPDIRPATH=$(mktemp -d /var/tmp/$1-tar-XXXXXX) +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 \ + "--exclude=nokogiri-$2/./.git" \ + $1-$2/./ + +popd + +rm -rf $TMPDIRPATH diff --git a/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch b/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch new file mode 100644 index 0000000..6a34634 --- /dev/null +++ b/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch @@ -0,0 +1,13 @@ +--- 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 = [] + + if libxml2? 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.6.1-CVE-2022-24836-backport.patch b/rubygem-nokogiri-1.6.1-CVE-2022-24836-backport.patch deleted file mode 100644 index 3ed8fe6..0000000 --- a/rubygem-nokogiri-1.6.1-CVE-2022-24836-backport.patch +++ /dev/null @@ -1,58 +0,0 @@ -From edb70d07af416aae9a51ce0d44e414b64ddefad0 Mon Sep 17 00:00:00 2001 -From: Troy Dawson -Date: Wed, 25 May 2022 09:47:36 -0700 -Subject: [PATCH] CVE-2022-24836-backport - ---- - lib/nokogiri/html/document.rb | 4 ++-- - test/html/test_document_encoding.rb | 12 ++++++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/lib/nokogiri/html/document.rb b/lib/nokogiri/html/document.rb -index ba10b7a..297c940 100644 ---- a/lib/nokogiri/html/document.rb -+++ b/lib/nokogiri/html/document.rb -@@ -173,7 +173,7 @@ module Nokogiri - if Nokogiri.jruby? && EncodingReader.is_jruby_without_fix? - return EncodingReader.detect_encoding_for_jruby_without_fix(chunk) - end -- m = chunk.match(/\A(<\?xml[ \t\r\n]+[^>]*>)/) and -+ m = chunk.match(/\A(<\?xml[ \t\r\n][^>]*>)/) and - return Nokogiri.XML(m[1]).encoding - - if Nokogiri.jruby? -@@ -196,7 +196,7 @@ module Nokogiri - end - - def self.detect_encoding_for_jruby_without_fix(chunk) -- m = chunk.match(/\A(<\?xml[ \t\r\n]+[^>]*>)/) and -+ m = chunk.match(/\A(<\?xml[ \t\r\n][^>]*>)/) and - return Nokogiri.XML(m[1]).encoding - - m = chunk.match(/( -Date: Wed, 25 May 2022 10:20:25 -0700 -Subject: [PATCH] CVE-2022-29181-backport - ---- - ext/nokogiri/html_sax_parser_context.c | 4 ++-- - ext/nokogiri/xml_sax_parser_context.c | 12 ++++++++++-- - lib/nokogiri/html/sax/parser.rb | 2 +- - test/html/sax/test_parser.rb | 8 +++++++- - test/html/sax/test_parser_context.rb | 9 +++++++++ - test/xml/sax/test_parser.rb | 8 +++++++- - test/xml/sax/test_parser_context.rb | 7 +++++++ - 7 files changed, 43 insertions(+), 7 deletions(-) - -diff --git a/ext/nokogiri/html_sax_parser_context.c b/ext/nokogiri/html_sax_parser_context.c -index 02172ad..8967cb0 100644 ---- a/ext/nokogiri/html_sax_parser_context.c -+++ b/ext/nokogiri/html_sax_parser_context.c -@@ -18,8 +18,8 @@ parse_memory(VALUE klass, VALUE data, VALUE encoding) - { - htmlParserCtxtPtr ctxt; - -- if (NIL_P(data)) -- rb_raise(rb_eArgError, "data cannot be nil"); -+ Check_Type(data, T_STRING); -+ - if (!(int)RSTRING_LEN(data)) - rb_raise(rb_eRuntimeError, "data cannot be empty"); - -diff --git a/ext/nokogiri/xml_sax_parser_context.c b/ext/nokogiri/xml_sax_parser_context.c -index d042e4f..d2e5f63 100644 ---- a/ext/nokogiri/xml_sax_parser_context.c -+++ b/ext/nokogiri/xml_sax_parser_context.c -@@ -2,6 +2,8 @@ - - VALUE cNokogiriXmlSaxParserContext ; - -+static ID id_read; -+ - static void deallocate(xmlParserCtxtPtr ctxt) - { - NOKOGIRI_DEBUG_START(handler); -@@ -25,6 +27,10 @@ parse_io(VALUE klass, VALUE io, VALUE encoding) - xmlParserCtxtPtr ctxt; - xmlCharEncoding enc = (xmlCharEncoding)NUM2INT(encoding); - -+ if (!rb_respond_to(io, id_read)) { -+ rb_raise(rb_eTypeError, "argument expected to respond to :read"); -+ } -+ - ctxt = xmlCreateIOParserCtxt(NULL, NULL, - (xmlInputReadCallback)io_read_callback, - (xmlInputCloseCallback)io_close_callback, -@@ -60,8 +66,8 @@ parse_memory(VALUE klass, VALUE data) - { - xmlParserCtxtPtr ctxt; - -- if (NIL_P(data)) -- rb_raise(rb_eArgError, "data cannot be nil"); -+ Check_Type(data, T_STRING); -+ - if (!(int)RSTRING_LEN(data)) - rb_raise(rb_eRuntimeError, "data cannot be empty"); - -@@ -219,4 +225,6 @@ void init_xml_sax_parser_context() - rb_define_method(klass, "replace_entities", get_replace_entities, 0); - rb_define_method(klass, "line", line, 0); - rb_define_method(klass, "column", column, 0); -+ -+ id_read = rb_intern("read"); - } -diff --git a/lib/nokogiri/html/sax/parser.rb b/lib/nokogiri/html/sax/parser.rb -index a1ee0cc..3b64ce3 100644 ---- a/lib/nokogiri/html/sax/parser.rb -+++ b/lib/nokogiri/html/sax/parser.rb -@@ -29,7 +29,7 @@ module Nokogiri - ### - # Parse html stored in +data+ using +encoding+ - def parse_memory data, encoding = 'UTF-8' -- raise ArgumentError unless data -+ raise TypeError unless String === data - return unless data.length > 0 - ctx = ParserContext.memory(data, encoding) - yield ctx if block_given? -diff --git a/test/html/sax/test_parser.rb b/test/html/sax/test_parser.rb -index 06099aa..bed52dd 100644 ---- a/test/html/sax/test_parser.rb -+++ b/test/html/sax/test_parser.rb -@@ -54,7 +54,7 @@ module Nokogiri - end - - def test_parse_memory_nil -- assert_raise ArgumentError do -+ assert_raise TypeError do - @parser.parse_memory(nil) - end - end -@@ -135,6 +135,12 @@ module Nokogiri - def test_empty_processing_instruction - @parser.parse_memory("this will segfault") - end -+ -+ it "handles invalid types gracefully" do -+ assert_raises(TypeError) { Nokogiri::HTML::SAX::Parser.new.parse(0xcafecafe) } -+ assert_raises(TypeError) { Nokogiri::HTML::SAX::Parser.new.parse_memory(0xcafecafe) } -+ assert_raises(TypeError) { Nokogiri::HTML::SAX::Parser.new.parse_io(0xcafecafe) } -+ end - end - end - end -diff --git a/test/html/sax/test_parser_context.rb b/test/html/sax/test_parser_context.rb -index 5d1f5aa..0b681f9 100644 ---- a/test/html/sax/test_parser_context.rb -+++ b/test/html/sax/test_parser_context.rb -@@ -39,6 +39,15 @@ module Nokogiri - ctx.parse_with parser - # end - end -+ -+ def test_graceful_handling_of_invalid_types -+ assert_raises(TypeError) { ParserContext.new(0xcafecafe) } -+ assert_raises(TypeError) { ParserContext.memory(0xcafecafe, "UTF-8") } -+ assert_raises(TypeError) { ParserContext.io(0xcafecafe, 1) } -+ assert_raises(TypeError) { ParserContext.io(StringIO.new("asdf"), "should be an index into ENCODINGS") } -+ assert_raises(TypeError) { ParserContext.file(0xcafecafe, "UTF-8") } -+ assert_raises(TypeError) { ParserContext.file("path/to/file", 0xcafecafe) } -+ end - end - end - end -diff --git a/test/xml/sax/test_parser.rb b/test/xml/sax/test_parser.rb -index 04c8cac..b993a35 100644 ---- a/test/xml/sax/test_parser.rb -+++ b/test/xml/sax/test_parser.rb -@@ -66,6 +66,12 @@ module Nokogiri - end - end - -+ def test_graceful_handling_of_invalid_types -+ assert_raises(TypeError) { Nokogiri::XML::SAX::Parser.new.parse(0xcafecafe) } -+ assert_raises(TypeError) { Nokogiri::XML::SAX::Parser.new.parse_memory(0xcafecafe) } -+ assert_raises(TypeError) { Nokogiri::XML::SAX::Parser.new.parse_io(0xcafecafe) } -+ end -+ - def test_namespace_declaration_order_is_saved - @parser.parse <<-eoxml - -@@ -261,7 +267,7 @@ module Nokogiri - end - - def test_render_parse_nil_param -- assert_raises(ArgumentError) { @parser.parse_memory(nil) } -+ assert_raises(TypeError) { @parser.parse_memory(nil) } - end - - def test_bad_encoding_args -diff --git a/test/xml/sax/test_parser_context.rb b/test/xml/sax/test_parser_context.rb -index ad6d994..33b484e 100644 ---- a/test/xml/sax/test_parser_context.rb -+++ b/test/xml/sax/test_parser_context.rb -@@ -65,6 +65,13 @@ world - assert_equal true, pc.replace_entities - end - -+ def test_graceful_handling_of_invalid_types -+ assert_raises(TypeError) { ParserContext.new(0xcafecafe) } -+ assert_raises(TypeError) { ParserContext.memory(0xcafecafe) } -+ assert_raises(TypeError) { ParserContext.io(0xcafecafe, 1) } -+ assert_raises(TypeError) { ParserContext.io(StringIO.new("asdf"), "should be an index into ENCODINGS") } -+ end -+ - def test_from_io - ctx = ParserContext.new StringIO.new('fo'), 'UTF-8' - assert ctx --- -2.31.1 - diff --git a/rubygem-nokogiri.spec b/rubygem-nokogiri.spec index 55c7752..b28fa64 100644 --- a/rubygem-nokogiri.spec +++ b/rubygem-nokogiri.spec @@ -1,78 +1,58 @@ -%if 0%{?fedora} <= 16 && 0%{?rhel} <= 6 -%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") -%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']") -%endif +%global mainver 1.19.0 +#%%global prever .rc4 -%global mainver 1.6.1 -#%%global prever .beta.4 - -%global mainrel 1 +%global baserelease 2 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') -%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) -%global gemname nokogiri -%global geminstdir %{gemdir}/gems/%{gemname}-%{mainver}%{?prever} +%global gem_name nokogiri -%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 -%if 0%{?fedora} < 19 -%global rubyabi 1.9.1 -%endif -%global ruby19 1 -%global gemdir %{gem_dir} -%global geminstdir %{gem_instdir} -%global gemsodir %{gem_extdir_mri}/lib -%else -%global ruby19 0 -%global gemsodir %{ruby_sitearch} -%endif -%global gem_name %{gemname} - -# Note for packager: -# Nokogiri 1.4.3.1 gem says that Nokogiri upstream will -# no longer support ruby 1.8.6 after 2010-08-01, so -# it seems that 1.4.3.1 is the last version for F-13 and below. +%undefine __brp_mangle_shebangs Summary: An HTML, XML, SAX, and Reader parser -Name: rubygem-%{gemname} +Name: rubygem-%{gem_name} Version: %{mainver} -Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.2 -Group: Development/Languages -License: MIT -URL: http://nokogiri.rubyforge.org/nokogiri/ -Source0: http://gems.rubyforge.org/gems/%{gemname}-%{mainver}%{?prever}.gem -# ./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 -# Fix for CVE-2022-24836, backported -Patch1: %{name}-1.6.1-CVE-2022-24836-backport.patch -# https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267 -# Fix for CVE-2022-24836, backported -Patch2: %{name}-1.6.1-CVE-2022-29181-backport.patch +Release: %{?prever:0.}%{baserelease}%{?prever:.%{prerpmver}}%{?dist} -%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 -Requires: ruby(release) +# SPDX confirmed +# MIT: see LICENSE.md +# 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 Apache-2.0 +Provides: bundled(gumbo-parser) = 0.10.1 + +URL: https://nokogiri.org +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 +# Shut down libxml2 version unmatching warning +Patch0: %{name}-1.11.0.rc4-shutdown-libxml2-warning.patch BuildRequires: ruby(release) -%else -Requires: ruby(abi) = %{rubyabi} -Requires: ruby -BuildRequires: ruby(abi) = %{rubyabi} -BuildRequires: ruby -%endif - 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-%{gemname} <= 1.5.2-2 +Obsoletes: ruby-%{gem_name} <= 1.5.2-2 #BuildRequires: ruby(racc) ## +# test suite uses EUC-JP, SHIFT-JIS, etc +BuildRequires: glibc-all-langpacks ## Others +BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel BuildRequires: ruby-devel -Requires: ruby(rubygems) -Provides: rubygem(%{gemname}) = %{version}-%{release} +# ruby27 needs this explicitly +BuildRequires: rubygem(racc) %description Nokogiri parses and searches XML/HTML very quickly, and also has @@ -81,112 +61,145 @@ 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} -Group: Development/Languages -Requires: %{name} = %{version}-%{release} - -%description jruby -This package contains JRuby support for %{name}. -%endif - - %package doc Summary: Documentation for %{name} -Group: Documentation Requires: %{name} = %{version}-%{release} %description doc This package contains documentation for %{name}. -%package -n ruby-%{gemname} -Summary: Non-Gem support package for %{gemname} -Group: Development/Languages +%package -n ruby-%{gem_name} +Summary: Non-Gem support package for %{gem_name} Requires: %{name} = %{version}-%{release} -Provides: ruby(%{gemname}) = %{version}-%{release} +Provides: ruby(%{gem_name}) = %{version}-%{release} -%description -n ruby-%{gemname} -This package provides non-Gem support for %{gemname}. +%description -n ruby-%{gem_name} +This package provides non-Gem support for %{gem_name}. + +%global version %{mainver}%{?prever} %prep -%setup -q -T -c - -# Gem repack -TOPDIR=$(pwd) -mkdir tmpunpackdir -pushd tmpunpackdir - -gem unpack %{SOURCE0} -cd %{gem_name}-%{version} +%setup -q -n %{gem_name}-%{version} -a 1 +cp -a %{gem_name}-%{version}/{.,*} . +mv ../%{gem_name}-%{version}.gemspec . # patches -#%%patch0 -p1 -%patch1 -p1 -%patch2 -p1 - -gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec +%patch -P0 -p1 # remove bundled external libraries -sed -i -e 's|, "ports/archives/[^"][^"]*"||g' \ - %{gem_name}.gemspec +sed -i \ + -e 's|, "ports/archives/[^"][^"]*"||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}.gemspec +sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec -# Ummm... -env LANG=ja_JP.UTF-8 gem build %{gem_name}.gemspec -mv %{gem_name}-%{version}.gem $TOPDIR +# Don't use mini_portile2, but build libgumbo.a first and +# tell extconf.rb the path to the archive +sed -i \ + ext/nokogiri/extconf.rb \ + -e "s@^\(def process_recipe.*\)\$@\1 ; return true@" \ + -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} -popd -rm -rf tmpunpackdir +# #line directive can confuse debuginfo, removing for now +sed -i \ + gumbo-parser/src/char_ref.c \ + -e '\@^#line [0-9]@s|^\(.*\)$|// \1|' + +# Compile libgumbo.a with -fPIC +sed -i \ + gumbo-parser/src/Makefile \ + -e 's|^\(CFLAGS.*=.*\)$|\1 -fPIC|' %build -mkdir -p ./%{gemdir} +# Ummm... +env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec + # 1.6.0 needs this export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes +%set_build_flags +# First build libgumbo.a +pushd gumbo-parser/src/ +make libgumbo.a +popd + %gem_install - # Permission -chmod 0644 .%{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem +chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem # Remove precompiled Java .jar file -rm -f .%{geminstdir}/lib/*.jar +find .%{gem_instdir}/lib/ -name '*.jar' -delete # For now remove JRuby support -rm -rf .%{geminstdir}/ext/java +rm -rf .%{gem_instdir}/ext/java %install -mkdir -p %{buildroot}%{gemdir} -cp -a ./%{gemdir}/* %{buildroot}%{gemdir} +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir} + +# Also first copy these, clean up later +cp -a ./gumbo-parser %{buildroot}%{gem_instdir}/ # Remove backup file find %{buildroot} -name \*.orig_\* | xargs rm -vf # move arch dependent files to %%gem_extdir -mkdir -p %{buildroot}%{gemsodir}/%{gemname} -mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \ - %{buildroot}%{gemsodir}/%{gemname}/ +mkdir -p %{buildroot}%{gem_extdir_mri} +cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/ + +pushd %{buildroot} +rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log} +popd + # move bin/ files mkdir -p %{buildroot}%{_bindir} cp -pa .%{_bindir}/* \ - %{buildroot}%{_bindir}/ + %{buildroot}%{_bindir}/ # remove all shebang -for f in $(find %{buildroot}%{geminstdir} -name \*.rb) +for f in $(find %{buildroot}%{gem_instdir} -name \*.rb) do sed -i -e '/^#!/d' $f chmod 0644 $f done -# cleanups -rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/ -rm -rf %{buildroot}%{geminstdir}/tmp/ -rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest,.travis.yml} -rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all} +# Copy document files from full source +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 \ + patches \ + ports \ + %{nil} +pushd gumbo-parser +find . -type f | \ + grep -v CHANGES.md | \ + grep -v THANKS | \ + grep -v README.md | \ + xargs rm -f + +popd +rm -f %{buildroot}%{gem_cache} %check # Ah.... @@ -194,15 +207,39 @@ rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all} # fails without TZ on sparc export TZ="Asia/Tokyo" #??? -LANG=ja_JP.UTF-8 +LANG=C.UTF-8 -pushd ./%{geminstdir} +# Copy test files from full tarball +cp -a test/ ./%{gem_instdir} +pushd ./%{gem_instdir} -# Need investigation. For now anyway build -ruby -I.:lib:test \ +# Remove unneeded simplecov coverage test +sed -i test/helper.rb \ + -e '\@^ require.*simplecov@,\@^ end$@s|^|#|' + +# Remove minitest-reporters. It does not provide any additional value while +# it blows up the dependency chain. +sed -i '/require..minitest.reporters./ s/^/#/' test/helper.rb +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 +%endif +%ifarch s390x +# With ruby 3.2 GC_LEVEL=compact seems to cause segfault: +# change to major for now +if pkg-config --atleast-version 3.2 ruby ; then +export NOKOGIRI_TEST_GC_LEVEL=major +fi +%endif + +env \ + RUBYLIB=".:lib:test:%{buildroot}%{gem_extdir_mri}" \ + ruby \ -e \ "require 'test/helper' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \ - echo "Please investigate this" + exit 1 for f in $SKIPTEST do @@ -212,38 +249,466 @@ done popd %files -%defattr(-,root, root,-) -%{_bindir}/%{gemname} +%{_bindir}/%{gem_name} %{gem_extdir_mri}/ -%dir %{geminstdir}/ -%doc %{geminstdir}/[A-Z]* -#%%doc %{geminstdir}/nokogiri_help_responses.md -%exclude %{geminstdir}/Rakefile -%exclude %{geminstdir}/Gemfile -%{geminstdir}/bin/ -%{geminstdir}/lib/ -%{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem -%{gemdir}/specifications/%{gemname}-%{mainver}%{?prever}.gemspec -%if 0 -%files jruby -%defattr(-,root,root,-) -%{geminstdir}/ext/java/ -%endif +%dir %{gem_instdir}/ +%license %{gem_instdir}/LICENSE*.md +%doc %{gem_instdir}/CHANGELOG.md +%doc %{gem_instdir}/README.md + +%{gem_instdir}/bin/ +%{gem_instdir}/lib/ + +%dir %{gem_instdir}/gumbo-parser +%dir %{gem_instdir}/gumbo-parser/src +%doc %{gem_instdir}/gumbo-parser/[A-Z]* +%license %{gem_instdir}/gumbo-parser/src/README.md + +%{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec %files doc %defattr(-,root,root,-) -%{geminstdir}/Rakefile -#%%{geminstdir}/deps.rip -#%%{geminstdir}/spec/ -%{geminstdir}/tasks/ -%{geminstdir}/test/ -%{gemdir}/doc/%{gemname}-%{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 -* Wed May 25 2022 Troy Dawson - 1.6.1-1.2 -- Backport CVE-2022-24836 (#2074347) -- Backport CVE-2022-29181 (#2088685) +* 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 + +* Thu Oct 20 2022 Mamoru TASAKA - 1.13.9-2 +- s390x: change GC_LEVEL to major on ruby3.2 for now + +* Thu Oct 20 2022 Mamoru TASAKA - 1.13.9-1 +- 1.13.9 + +* Wed Jul 27 2022 Mamoru TASAKA - 1.13.8-1 +- 1.13.8 + +* Sat Jul 23 2022 Fedora Release Engineering - 1.13.7-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 13 2022 Mamoru TASAKA - 1.13.7-2 +- Bump release + +* Wed Jul 13 2022 Mamoru TASAKA - 1.13.7-1 +- 1.13.7 + +* Tue May 10 2022 Mamoru TASAKA - 1.13.6-1 +- 1.13.6 +- Addresses CVE-2022-29181 + +* Thu May 5 2022 Mamoru TASAKA - 1.13.5-1 +- 1.13.5 + +* Thu Apr 14 2022 Mamoru TASAKA - 1.13.4-1 +- 1.13.4 +- Addresses CVE-2022-24836 + +* Tue Feb 22 2022 Mamoru TASAKA - 1.13.3-1 +- 1.13.3 + +* Wed Jan 26 2022 Mamoru TASAKA - 1.13.1-2 +- Set NOKOGIRI_TEST_GC_LEVEL to major on ppc64le as + ruby31 does not seem to support GC.compat on the platform + +* Wed Jan 26 2022 Mamoru TASAKA - 1.13.1-1.2 +- F-36: rebuild against ruby31 + +* Fri Jan 21 2022 Fedora Release Engineering - 1.13.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jan 14 2022 Mamoru TASAKA - 1.13.1-1 +- 1.13.1 + +* Sun Jan 9 2022 Mamoru TASAKA - 1.13.0-1 +- 1.13.0 + +* Tue Sep 28 2021 Mamoru TASAKA - 1.12.5-1 +- 1.12.5 + +* Wed Sep 1 2021 Mamoru TASAKA - 1.12.4-1 +- 1.12.4 + +* Thu Aug 12 2021 Mamoru TASAKA - 1.12.3-1 +- 1.12.3 + +* Sat Aug 7 2021 Mamoru TASAKA - 1.12.2-1 +- 1.12.2 + +* Sat Aug 7 2021 Mamoru TASAKA - 1.12.1-1 +- 1.12.1 + +* Fri Jul 23 2021 Fedora Release Engineering - 1.11.7-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Jun 19 2021 Mamoru TASAKA - 1.11.7-1 +- 1.11.7 + +* Sun May 16 2021 Mamoru TASAKA - 1.11.4-1 +- 1.11.4 + +* Fri May 07 2021 Vít Ondruch - 1.11.3-2 +- Remove rubygem(minitest-reporters) dependency. + +* Thu Apr 8 2021 Mamoru TASAKA - 1.11.3-1 +- 1.11.3 + +* Fri Mar 12 2021 Mamoru TASAKA - 1.11.2-1 +- 1.11.2 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.11.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 8 2021 Mamoru TASAKA - 1.11.1-1 +- 1.11.1 + +* Wed Jan 06 2021 Mamoru TASAKA - 1.11.0-1.1 +- F-34: rebuild against ruby 3.0 + +* Wed Jan 6 2021 Mamoru TASAKA - 1.11.0-1 +- 1.11.0 + +* Thu Dec 31 2020 Mamoru TASAKA - 1.11.0-0.1.rc4 +- 1.11.0.rc4 + +* Thu Oct 22 2020 Vít Ondruch - 1.10.10-2 +- Drop unnecessary rubygem(pkg-config) dependency. + +* Sat Aug 8 2020 Mamoru TASAKA - 1.10.10-1 +- 1.10.10 + +* Wed Jul 29 2020 Fedora Release Engineering - 1.10.9-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Mar 6 2020 Mamoru TASAKA - 1.10.9-1 +- 1.10.9 + +* Thu Feb 13 2020 Mamoru TASAKA - 1.10.8-1 +- 1.10.8 + +* Fri Jan 31 2020 Mamoru TASAKA - 1.10.7-3 +- Also Requires rubygem(racc) + +* Thu Jan 30 2020 Fedora Release Engineering - 1.10.7-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jan 17 2020 Mamoru TASAKA - 1.10.7-2 +- F-32: rebuild against ruby27 + +* Fri Dec 6 2019 Mamoru TASAKA - 1.10.7-1 +- 1.10.7 + +* Tue Nov 5 2019 Mamoru TASAKA - 1.10.5-1 +- 1.10.5 + +* Fri Aug 16 2019 Mamoru TASAKA - 1.10.4-1 +- 1.10.4 + +* Fri Jul 26 2019 Fedora Release Engineering - 1.10.3-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Apr 23 2019 Mamoru TASAKA - 1.10.3-1 +- 1.10.3 + +* Tue Mar 26 2019 Mamoru TASAKA - 1.10.2-1 +- 1.10.2 + +* Sat Feb 02 2019 Fedora Release Engineering - 1.10.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jan 29 2019 Mamoru TASAKA - 1.10.1-1 +- 1.10.1 + +* Mon Jan 21 2019 Mamoru TASAKA - 1.10.0-2 +- F-30: rebuild against ruby26 + +* Wed Jan 9 2019 Mamoru TASAKA - 1.10.0-1 +- 1.10.0 + +* Mon Dec 31 2018 Mamoru TASAKA - 1.9.1-1 +- 1.9.1 + +* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek - 1.8.5-1.1 +- Use C.UTF-8 locale + See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot + +* Tue Oct 9 2018 Mamoru TASAKA - 1.8.5-1 +- 1.8.5 + +* Sat Jul 14 2018 Fedora Release Engineering - 1.8.4-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jul 6 2018 Mamoru TASAKA - 1.8.4-1 +- 1.8.4 + +* Mon Jun 18 2018 Mamoru TASAKA - 1.8.3-1 +- 1.8.3 + +* Tue Feb 6 2018 Mamoru TASAKA - 1.8.2-1 +- 1.8.2 + +* Thu Jan 25 2018 Yaakov Selkowitz - 1.8.1-1.3 +- Drop compatibility with old releases + +* Sat Jan 20 2018 Björn Esser - 1.8.1-1.2 +- Rebuilt for switch to libxcrypt + +* Wed Jan 03 2018 Mamoru TASAKA - 1.8.1-1.1 +- F-28: rebuild for ruby25 + +* Wed Sep 20 2017 Mamoru TASAKA - 1.8.1-1 +- 1.8.1 + +* Thu Aug 03 2017 Fedora Release Engineering - 1.8.0-1.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.8.0-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jun 12 2017 Mamoru TASAKA - 1.8.0-1 +- 1.8.0 + +* Fri May 12 2017 Mamoru TASAKA - 1.7.2-1 +- 1.7.2 + +* Tue Mar 21 2017 Mamoru TASAKA - 1.7.1-1 +- 1.7.1 + +* Sat Feb 11 2017 Fedora Release Engineering - 1.7.0.1-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 11 2017 Mamoru TASAKA - 1.7.0.1-2 +- F-26: rebuild for ruby24 + +* Thu Jan 5 2017 Mamoru TASAKA - 1.7.0.1-1 +- 1.7.0.1 + +* Thu Dec 29 2016 Mamoru TASAKA - 1.7.0-1 +- 1.7.0 + +* Mon Oct 10 2016 Mamoru TASAKA - 1.6.8.1-1 +- 1.6.8.1 + +* Fri Jul 1 2016 Mamoru TASAKA - 1.6.8-3 +- Kill pkg-config runtime redundant dependency (bug 1349893) + +* Mon Jun 20 2016 Mamoru TASAKA - 1.6.8-2 +- 1.6.8 + +* Thu Feb 04 2016 Fedora Release Engineering - 1.6.7.2-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 28 2016 Mamoru TASAKA - 1.6.7.2-1 +- 1.6.7.2 + +* Mon Jan 11 2016 Mamoru TASAKA - 1.6.7-0.4.rc4 +- F-24: rebuild against ruby23 + +* Fri Dec 11 2015 Mamoru TASAKA - 1.6.7-0.3.rc3 +- Shutdown libxml2 version mismatch warning + +* Tue Dec 8 2015 Mamoru TASAKA - 1.6.7-0.2.rc3 +- Rebuild against new libxml2, to make rspec test succeed + +* Thu Sep 24 2015 Mamoru TASAKA - 1.6.7-0.1.rc3 +- 1.6.7.rc3 + +* Thu Jun 18 2015 Fedora Release Engineering - 1.6.6.2-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Jan 25 2015 Mamoru TASAKA - 1.6.6.2-1 +- 1.6.6.2 + +* Fri Jan 23 2015 Mamoru TASAKA - 1.6.6.1-1 +- 1.6.6.1 + +* Thu Jan 15 2015 Mamoru TASAKA - 1.6.5-2 +- Rebuild for ruby 2.2 + +* Mon Dec 1 2014 Mamoru TASAKA - 1.6.5-1 +- 1.6.5 + +* Fri Nov 7 2014 Mamoru TASAKA - 1.6.4.1-1 +- 1.6.4.1 + +* Mon Aug 18 2014 Fedora Release Engineering - 1.6.3.1-1.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Aug 12 2014 Mamoru TASAKA - 1.6.3.1-1 +- 1.6.3.1 + +* Sun Jun 08 2014 Fedora Release Engineering - 1.6.2.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 14 2014 Mamoru TASAKA - 1.6.2.1-1 +- 1.6.2.1 + +* Thu Apr 17 2014 Mamoru TASAKA - 1.6.1-2 +- F-21: rebuild for ruby 2.1 / rubygems 2.2 * Wed Dec 25 2013 Mamoru TASAKA - 1.6.1-1 - 1.6.1 diff --git a/sources b/sources index 7786dfe..52222fb 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -ecab2ea5ec330c8bb25fe5f13dfd8ab4 nokogiri-1.6.1.gem +SHA512 (rubygem-nokogiri-1.19.0-full.tar.gz) = 29dd894b176857d55eb5e670f50e69762e74c0a13e6949030af17e3c84b65f9dfe0087210b84a7c77749d3d1a4a33292d62f7005003745e8f087d822ee64f4b1 +SHA512 (nokogiri-1.19.0.gem) = d9326a2e60b6ea3152c5f9d53df738610f18ca57cffcd3bf2f8b07a2b08b30085d0fce2ca8206279ad6a0f1a613e9e76821c09aef45cf5e5b2d00ff766734872