Blame SPECS/rubygem-nokogiri.spec

e33147
%{?scl:%scl_package rubygem-%{gemname}}
e33147
%{!?scl:%global pkg_name %{name}}
e33147
e33147
%global	mainver		1.7.0.1
e33147
#%%global	prever		.rc3
e33147
e33147
%global	mainrel		1
e33147
%global	prerpmver		%(echo "%{?prever}" | sed -e 's|\\.||g')
e33147
e33147
%global	gemdir			%(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
e33147
%global	gemname		nokogiri
e33147
%global	geminstdir		%{gemdir}/gems/%{gemname}-%{mainver}%{?prever}
e33147
e33147
%global	gemdir		%{gem_dir}
e33147
%global	geminstdir	%{gem_instdir}
e33147
%global	gemsodir	%{gem_extdir_mri}/lib
e33147
%global	gem_name	%{gemname}
e33147
e33147
# Note for packager:
e33147
# Nokogiri 1.4.3.1 gem says that Nokogiri upstream will
e33147
# no longer support ruby 1.8.6 after 2010-08-01, so
e33147
# it seems that 1.4.3.1 is the last version for F-13 and below.
e33147
e33147
Summary:	An HTML, XML, SAX, and Reader parser
e33147
Name:		%{?scl_prefix}rubygem-%{gemname}
e33147
Version:	%{mainver}
e33147
Release:	%{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}
e33147
Group:		Development/Languages
e33147
License:	MIT
e33147
URL:		http://nokogiri.rubyforge.org/nokogiri/
e33147
Source0:	https://rubygems.org/gems/%{gemname}-%{mainver}%{?prever}.gem
e33147
# ./test/html/test_element_description.rb:62 fails, as usual......
e33147
# Patch0:		rubygem-nokogiri-1.5.0.beta3-test-failure.patch
e33147
#Patch0:		rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
e33147
# Shut down libxml2 version unmatching warning
e33147
Patch0:	%{pkg_name}-1.6.6.4-shutdown-libxml2-warning.patch
e33147
# Fix test suite for case of libxml2 < 2.9.
e33147
Patch10: %{pkg_name}-1.7.0.1-test-less-than-libxml2-2.9.patch
e33147
# Fix test suite for parsing white space.
e33147
Patch11: %{pkg_name}-1.7.0.1-test-space.patch
e33147
e33147
Requires:	%{?scl_prefix_ruby}ruby(release)
e33147
BuildRequires:	%{?scl_prefix_ruby}ruby(release)
e33147
BuildRequires:	%{?scl_prefix_ruby}ruby(rubygems)
e33147
##
e33147
## For %%check
e33147
BuildRequires:	%{?scl_prefix_ruby}rubygem(minitest)
e33147
BuildRequires:	%{?scl_prefix_ruby}rubygems-devel
e33147
Obsoletes:		%{?scl_prefix_ruby}ruby-%{gemname} <= 1.5.2-2
e33147
#BuildRequires:	%{?scl_prefix}ruby(racc)
e33147
##
e33147
## Others
e33147
BuildRequires:	libxml2-devel
e33147
BuildRequires:	libxslt-devel
e33147
BuildRequires:	%{?scl_prefix_ruby}ruby-devel
e33147
Requires:	%{?scl_prefix_ruby}ruby(rubygems)
e33147
Provides:	%{?scl_prefix}rubygem(%{gemname}) = %{version}-%{release}
e33147
e33147
# Explicitly require runtime subpackage, as long as older scl-utils do not generate it
e33147
%{?scl:Requires: %{?scl_prefix}runtime}
e33147
e33147
%description
e33147
Nokogiri parses and searches XML/HTML very quickly, and also has
e33147
correctly implemented CSS3 selector support as well as XPath support.
e33147
e33147
Nokogiri also features an Hpricot compatibility layer to help ease the change
e33147
to using correct CSS and XPath.
e33147
e33147
%if 0
e33147
e33147
%package	jruby
e33147
Summary:	JRuby support for %{pkg_name}
e33147
Group:		Development/Languages
e33147
Requires:	%{?scl_prefix}%{pkg_name} = %{version}-%{release}
e33147
e33147
%description	jruby
e33147
This package contains JRuby support for %{pkg_name}.
e33147
%endif
e33147
e33147
%package	doc
e33147
Summary:	Documentation for %{pkg_name}
e33147
Group:		Documentation
e33147
Requires:	%{?scl_prefix}%{pkg_name} = %{version}-%{release}
e33147
e33147
%description	doc
e33147
This package contains documentation for %{pkg_name}.
e33147
e33147
%package	-n %{?scl_prefix}ruby-%{gemname}
e33147
Summary:	Non-Gem support package for %{gemname}
e33147
Group:		Development/Languages
e33147
Requires:	%{?scl_prefix}%{pkg_name} = %{version}-%{release}
e33147
Provides:	%{?scl_prefix}ruby(%{gemname}) = %{version}-%{release}
e33147
e33147
%description	-n %{?scl_prefix}ruby-%{gemname}
e33147
This package provides non-Gem support for %{gemname}.
e33147
e33147
%global	version	%{mainver}%{?prever}
e33147
e33147
%prep
e33147
%setup -n %{pkg_name}-%{version} -q -T -c
e33147
e33147
# Gem repack
e33147
TOPDIR=$(pwd)
e33147
mkdir tmpunpackdir
e33147
pushd tmpunpackdir
e33147
e33147
%{?scl:scl enable %{scl} - << \EOF}
e33147
gem unpack %{SOURCE0}
e33147
%{?scl:EOF}
e33147
cd %{gem_name}-%{version}
e33147
e33147
# patches
e33147
%patch0 -p1
e33147
e33147
%{?scl:scl enable %{scl} - << \EOF}
e33147
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
e33147
%{?scl:EOF}
e33147
e33147
# remove bundled external libraries
e33147
sed -i \
e33147
	-e 's|, "ports/archives/[^"][^"]*"||g' \
e33147
	-e 's|, "ports/patches/[^"][^"]*"||g' \
e33147
	%{gem_name}.gemspec
e33147
# Actually not needed when using system libraries
e33147
sed -i -e '\@mini_portile@d' %{gem_name}.gemspec
e33147
e33147
# Ummm...
e33147
%{?scl:scl enable %{scl} - << \EOF}
e33147
env LANG=ja_JP.UTF-8 gem build %{gem_name}.gemspec
e33147
%{?scl:EOF}
e33147
mv %{gem_name}-%{version}.gem $TOPDIR
e33147
e33147
popd
e33147
rm -rf tmpunpackdir
e33147
e33147
%build
e33147
mkdir -p ./%{gemdir}
e33147
# 1.6.0 needs this
e33147
export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
e33147
e33147
%{?scl:scl enable %{scl} - << \EOF}
e33147
%gem_install
e33147
%{?scl:EOF}
e33147
e33147
e33147
# Permission
e33147
chmod 0644 .%{gem_cache}
e33147
e33147
# Remove precompiled Java .jar file
e33147
rm -f .%{geminstdir}/lib/*.jar
e33147
# For now remove JRuby support
e33147
rm -rf .%{geminstdir}/ext/java
e33147
e33147
%install
e33147
mkdir -p %{buildroot}%{gemdir}
e33147
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
e33147
e33147
# Remove backup file
e33147
find %{buildroot} -name \*.orig_\* | xargs rm -vf
e33147
e33147
# move arch dependent files to %%gem_extdir
e33147
mkdir -p %{buildroot}%{gem_extdir_mri}
e33147
cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
e33147
e33147
pushd %{buildroot}
e33147
rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log}
e33147
popd
e33147
e33147
# move bin/ files
e33147
mkdir -p %{buildroot}%{_bindir}
e33147
cp -pa .%{_bindir}/* \
e33147
        %{buildroot}%{_bindir}/
e33147
e33147
# remove all shebang
e33147
for f in $(find %{buildroot}%{geminstdir} -name \*.rb)
e33147
do
e33147
	sed -i -e '/^#!/d' $f
e33147
	chmod 0644 $f
e33147
done
e33147
e33147
# cleanups
e33147
rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/
e33147
rm -rf %{buildroot}%{geminstdir}/tmp/
e33147
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest,.travis.yml}
e33147
rm -f %{buildroot}%{geminstdir}/appveyor.yml
e33147
rm -f %{buildroot}%{geminstdir}/.cross_rubies
e33147
rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all}
e33147
rm -f %{buildroot}%{geminstdir}/.editorconfig
e33147
rm -rf %{buildroot}%{geminstdir}/suppressions/
e33147
rm -rf %{buildroot}%{geminstdir}/patches/
e33147
e33147
%check
e33147
# Ah....
e33147
# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
e33147
# fails without TZ on sparc
e33147
export TZ="Asia/Tokyo"
e33147
#???
e33147
LANG=ja_JP.UTF-8
e33147
e33147
pushd ./%{geminstdir}
e33147
e33147
# Skip failed test by libxml2 version difference from upstream.
e33147
sed -i '/^      def test_last_of_type$/,/^      end$/ s/^/#/' \
e33147
  test/css/test_nthiness.rb
e33147
sed -i '/^      def test_nth_of_type$/,/^      end$/ s/^/#/' \
e33147
  test/css/test_nthiness.rb
e33147
sed -i '/^      def test_nth_last_of_type$/,/^      end$/ s/^/#/' \
e33147
  test/css/test_nthiness.rb
e33147
sed -i '/^      def test_element_children_counts$/,/^      end$/ s/^/#/' \
e33147
  test/html/test_document_fragment.rb
e33147
sed -i '/^  def test_multiple_filters$/,/^  end$/ s/^/#/' \
e33147
  test/test_convert_xpath.rb
e33147
e33147
%if 0%{?rhel} && 0%{?rhel} < 7
e33147
cat %{PATCH10} | patch -p1
e33147
cat %{PATCH11} | patch -p1
e33147
%endif
e33147
e33147
# Need investigation. For now anyway build
e33147
%{?scl:scl enable %{scl} - << \EOF}
e33147
ruby \
e33147
	-I.:lib:test:ext \
e33147
	-e \
e33147
	"require 'test/helper' ; Dir.glob('test/**/test_*.rb'){|f| require f}"
e33147
%{?scl:EOF}
e33147
e33147
popd
e33147
e33147
%files
e33147
%defattr(-,root, root,-)
e33147
%{_bindir}/%{gemname}
e33147
%{gem_extdir_mri}/
e33147
%dir	%{geminstdir}/
e33147
%doc	%{geminstdir}/[A-Z]*
e33147
#%%doc	%{geminstdir}/nokogiri_help_responses.md
e33147
%exclude %{geminstdir}/Rakefile
e33147
%exclude %{geminstdir}/Gemfile
e33147
%{geminstdir}/bin/
e33147
%{geminstdir}/lib/
e33147
%exclude %{gem_cache}
e33147
%{gemdir}/specifications/%{gemname}-%{mainver}%{?prever}.gemspec
e33147
e33147
%if 0
e33147
e33147
%files	jruby
e33147
%defattr(-,root,root,-)
e33147
%{geminstdir}/ext/java/
e33147
%endif
e33147
e33147
%files	doc
e33147
%defattr(-,root,root,-)
e33147
%{geminstdir}/Rakefile
e33147
#%%{geminstdir}/deps.rip
e33147
#%%{geminstdir}/spec/
e33147
%{geminstdir}/tasks/
e33147
%{geminstdir}/test/
e33147
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/
e33147
e33147
%changelog
e33147
* Wed Jan 04 2017 Jun Aruga <jaruga@redhat.com> - 1.7.0.1-1
e33147
- Update to 1.7.0.1
e33147
e33147
* Mon Feb 22 2016 Pavel Valena <pvalena@redhat.com> - 1.6.7.2-2
e33147
- Add scl macros
e33147
e33147
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.7.2-1.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e33147
e33147
* Thu Jan 28 2016 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.7.2-1
e33147
- 1.6.7.2
e33147
e33147
* Mon Jan 11 2016 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.7-0.4.rc4
e33147
- F-24: rebuild against ruby23
e33147
e33147
* Fri Dec 11 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.7-0.3.rc3
e33147
- Shutdown libxml2 version mismatch warning
e33147
e33147
* Tue Dec  8 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.7-0.2.rc3
e33147
- Rebuild against new libxml2, to make rspec test succeed
e33147
e33147
* Thu Sep 24 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.7-0.1.rc3
e33147
- 1.6.7.rc3
e33147
e33147
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.6.2-1.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e33147
e33147
* Sun Jan 25 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.6.2-1
e33147
- 1.6.6.2
e33147
e33147
* Fri Jan 23 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.6.1-1
e33147
- 1.6.6.1
e33147
e33147
* Thu Jan 15 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.5-2
e33147
- Rebuild for ruby 2.2
e33147
e33147
* Mon Dec  1 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.5-1
e33147
- 1.6.5
e33147
e33147
* Fri Nov  7 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.4.1-1
e33147
- 1.6.4.1
e33147
e33147
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.3.1-1.2
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
e33147
e33147
* Tue Aug 12 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.3.1-1
e33147
- 1.6.3.1
e33147
e33147
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2.1-1.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e33147
e33147
* Wed May 14 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.2.1-1
e33147
- 1.6.2.1
e33147
e33147
* Thu Apr 17 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.1-2
e33147
- F-21: rebuild for ruby 2.1 / rubygems 2.2
e33147
e33147
* Wed Dec 25 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.1-1
e33147
- 1.6.1
e33147
e33147
* Fri Oct  4 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.0-1
e33147
- 1.6.0
e33147
e33147
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.9-1.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e33147
e33147
* Thu Mar 28 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.5.9-1
e33147
- 1.5.9
e33147
e33147
* Tue Mar 26 2013 Vít Ondruch <vondruch@redhat.com> - 1.5.6-3
e33147
- Use %%{gem_extdir_mri} instead of %%{gem_extdir}.
e33147
e33147
* Sat Feb 23 2013 Vít Ondruch <vondruch@redhat.com> - 1.5.6-2
e33147
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
e33147
e33147
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.6-1.2
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e33147
e33147
* Tue Jan  1 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.5.6-1
e33147
- A Happy New Year
e33147
- 1.5.6
e33147
e33147
* Fri Aug 17 2012 Vít Ondruch <vondruch@redhat.com> - 1.5.5-2
e33147
- Rebuilt againts libxml2 2.9.
e33147
e33147
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.5-1.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
e33147
e33147
* Mon Jun 25 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.5-1
e33147
- 1.5.5
e33147
e33147
* Mon May 28 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.2-3
e33147
- Fix Obsoletes (bug 822931)
e33147
e33147
* Mon Apr  9 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.2-1
e33147
- 1.5.2
e33147
e33147
* Tue Apr 03 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.5.0-3
e33147
- Fix conditionals for F17 to work for RHEL 7 as well.
e33147
e33147
* Tue Jan 24 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-2
e33147
- F-17: rebuild for ruby19
e33147
- For now aviod build failure by touching some files
e33147
e33147
* Thu Jan 18 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-1
e33147
- 1.5.0
e33147
e33147
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-0.5.beta4.1
e33147
- F-17: Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e33147
e33147
* Sun Jun 26 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-0.5.beta4
e33147
- Remove unneeded patch
e33147
e33147
* Thu Mar 18 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-0.4.beta4
e33147
- Patch for newer rake to make testsuite run
e33147
e33147
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-0.3.beta4.1
e33147
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e33147
e33147
* Sun Jan 30 2011 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.3.beta4
e33147
- 1.5.0.beta.4
e33147
e33147
* Tue Dec  7 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.2.beta3
e33147
- 1.5.0.beta.3
e33147
e33147
* Sun Oct 17 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.1.beta2
e33147
- Try 1.5.0.beta.2
e33147
e33147
* Fri Jul 30 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.3.1-1
e33147
- 1.4.3.1
e33147
e33147
* Wed May 26 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.2-1
e33147
- 1.4.2
e33147
e33147
* Thu Apr 29 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.1-2
e33147
- Fix build failure with libxml2 >= 2.7.7
e33147
e33147
* Tue Dec 15 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.1-1
e33147
- 1.4.1
e33147
e33147
* Mon Nov  9 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.0-1
e33147
- 1.4.0
e33147
e33147
* Sat Aug 22 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.3-2
e33147
- Fix test failure on sparc
e33147
e33147
* Wed Jul 29 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.3-1
e33147
- 1.3.3
e33147
e33147
* Sat Jul 25 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-3
e33147
- F-12: Mass rebuild
e33147
e33147
* Thu Jul  2 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-2
e33147
- Enable test
e33147
- Recompile with -O2
e33147
e33147
* Thu Jun 25 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-1
e33147
- 1.3.2
e33147
e33147
* Thu Jun 11 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.1-1
e33147
- 1.3.1
e33147
e33147
* Thu Mar 26 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.3-1
e33147
- 1.2.3
e33147
e33147
* Thu Mar 19 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.2-1
e33147
- 1.2.2
e33147
e33147
* Thu Mar 12 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.1-1
e33147
- 1.2.1
e33147
e33147
* Tue Feb 24 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.1-2
e33147
- F-11: Mass rebuild
e33147
e33147
* Thu Jan 15 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.1-1
e33147
- 1.1.1
e33147
e33147
* Thu Dec 25 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.0-1
e33147
- Initial packaging