diff --git a/rubygem-nokogiri.spec b/rubygem-nokogiri.spec index f1a9c38..829e6b2 100644 --- a/rubygem-nokogiri.spec +++ b/rubygem-nokogiri.spec @@ -1,7 +1,7 @@ -%global mainver 1.11.7 +%global mainver 1.12.1 #%%global prever .rc4 -%global mainrel 1 +%global mainrel 0.101 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global gem_name nokogiri @@ -12,8 +12,15 @@ Summary: An HTML, XML, SAX, and Reader parser Name: rubygem-%{gem_name} Version: %{mainver} -Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.1 -License: MIT +Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist} + +# MIT: see LICENSE.md +# ASL 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 + URL: https://nokogiri.org Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem # %%{SOURCE2} %%{name} %%{version} @@ -39,6 +46,8 @@ BuildRequires: glibc-all-langpacks BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel +# From 1.12.0 need this to compile internal gumbo +BuildRequires: rubygem(mini_portile2) >= 2.6 BuildRequires: ruby-devel # ruby27 needs this explicitly BuildRequires: rubygem(racc) @@ -93,14 +102,38 @@ sed -i \ # Actually not needed when using system libraries sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec +# We install C extension module into different path +sed -i \ + lib/nokogiri/extension.rb \ + -e 's@require_relative "@require "nokogiri/@' + +# Don't clean up files used when building bundled gumbo, +# otherwise debuginfo rpm will become imcomplete +sed -i \ + ext/nokogiri/extconf.rb \ + -e '\@Pathname\.glob.*ports@s@ports@ports_ignore@' + +# Make gumbo build process verbose +sed -i \ + ext/nokogiri/extconf.rb \ + -e '\@execute.*compile.*make_cmd@s@env: env@env: env, debug: true@' + +# #line directive can confuse debuginfo, removing for now +sed -i \ + gumbo-parser/src/char_ref.c \ + -e '\@^#line [0-9]@s|^\(.*\)$|// \1|' + # Ummm... env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec %build # 1.6.0 needs this export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes +export V=1 +%set_build_flags %gem_install +find . -name compile.log | xargs cat # Permission chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem @@ -143,6 +176,7 @@ done cp -p %{gem_name}-%{version}/[A-Z]* %{buildroot}%{gem_instdir}/ # cleanups +# Remove bundled gumbo parser pushd %{buildroot}%{gem_instdir} rm -rf \ Gemfile* \ @@ -152,9 +186,19 @@ rm -rf \ patches \ ports \ %{nil} +pushd gumbo-parser +rm \ + Makefile \ + %{nil} +find src -type f | \ + grep -v README.md | \ + xargs rm -f + popd rm -f %{buildroot}%{gem_cache} +# Remove bundled gumbo parser + %check # Ah.... # test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93] @@ -201,6 +245,12 @@ popd %{gem_instdir}/bin/ %{gem_instdir}/lib/ + +%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 + %{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec %files doc @@ -208,6 +258,9 @@ popd %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %changelog +* 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