From 1f79b238fa9185df2f4ea3dc891be537b94a7d1c Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 25 Apr 2024 15:06:32 +0900 Subject: [PATCH] Make rubygem-minizip testsuite dependency optional, drop on RHEL (Patch by Jun Aruga ) --- ...nokogiri-pr3177-rubyzip-dep-optional.patch | 31 +++++++++++++++++++ rubygem-nokogiri.spec | 14 ++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch diff --git a/rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch b/rubygem-nokogiri-pr3177-rubyzip-dep-optional.patch new file mode 100644 index 0000000..c7b2b1c --- /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 dd55f66..b07580f 100644 --- a/rubygem-nokogiri.spec +++ b/rubygem-nokogiri.spec @@ -1,7 +1,7 @@ %global mainver 1.16.4 #%%global prever .rc4 -%global baserelease 1 +%global baserelease 2 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global gem_name nokogiri @@ -29,12 +29,19 @@ 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 +# https://github.com/sparklemotion/nokogiri/pull/3177 +# Make rubygem-minizip dependency optional +Patch1: %{name}-pr3177-rubyzip-dep-optional.patch BuildRequires: ruby(release) BuildRequires: ruby(rubygems) ## ## For %%check BuildRequires: rubygem(minitest) +%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) @@ -81,6 +88,7 @@ mv ../%{gem_name}-%{version}.gemspec . # patches %patch -P0 -p1 +%patch -P1 -p1 # remove bundled external libraries sed -i \ @@ -266,6 +274,10 @@ popd %doc %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %changelog +* 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