First try to update to 1.12.1 - various modification for compiling gumbo

This commit is contained in:
Mamoru TASAKA 2021-08-07 16:05:43 +09:00
parent e689bc9238
commit 4e193aeb64

View File

@ -1,7 +1,7 @@
%global mainver 1.11.7 %global mainver 1.12.1
#%%global prever .rc4 #%%global prever .rc4
%global mainrel 1 %global mainrel 0.101
%global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g')
%global gem_name nokogiri %global gem_name nokogiri
@ -12,8 +12,15 @@
Summary: An HTML, XML, SAX, and Reader parser Summary: An HTML, XML, SAX, and Reader parser
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: %{mainver} Version: %{mainver}
Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.1 Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}
License: MIT
# 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 URL: https://nokogiri.org
Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem
# %%{SOURCE2} %%{name} %%{version} # %%{SOURCE2} %%{name} %%{version}
@ -39,6 +46,8 @@ BuildRequires: glibc-all-langpacks
BuildRequires: gcc BuildRequires: gcc
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libxslt-devel BuildRequires: libxslt-devel
# From 1.12.0 need this to compile internal gumbo
BuildRequires: rubygem(mini_portile2) >= 2.6
BuildRequires: ruby-devel BuildRequires: ruby-devel
# ruby27 needs this explicitly # ruby27 needs this explicitly
BuildRequires: rubygem(racc) BuildRequires: rubygem(racc)
@ -93,14 +102,38 @@ sed -i \
# Actually not needed when using system libraries # Actually not needed when using system libraries
sed -i -e '\@mini_portile@d' %{gem_name}-%{version}.gemspec 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... # Ummm...
env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec
%build %build
# 1.6.0 needs this # 1.6.0 needs this
export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
export V=1
%set_build_flags
%gem_install %gem_install
find . -name compile.log | xargs cat
# Permission # Permission
chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem 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}/ cp -p %{gem_name}-%{version}/[A-Z]* %{buildroot}%{gem_instdir}/
# cleanups # cleanups
# Remove bundled gumbo parser
pushd %{buildroot}%{gem_instdir} pushd %{buildroot}%{gem_instdir}
rm -rf \ rm -rf \
Gemfile* \ Gemfile* \
@ -152,9 +186,19 @@ rm -rf \
patches \ patches \
ports \ ports \
%{nil} %{nil}
pushd gumbo-parser
rm \
Makefile \
%{nil}
find src -type f | \
grep -v README.md | \
xargs rm -f
popd popd
rm -f %{buildroot}%{gem_cache} rm -f %{buildroot}%{gem_cache}
# Remove bundled gumbo parser
%check %check
# Ah.... # Ah....
# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93] # test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
@ -201,6 +245,12 @@ popd
%{gem_instdir}/bin/ %{gem_instdir}/bin/
%{gem_instdir}/lib/ %{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 %{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec
%files doc %files doc
@ -208,6 +258,9 @@ popd
%{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/
%changelog %changelog
* Sat Aug 7 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.12.1-1
- 1.12.1
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.7-1.1 * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.7-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild