rubygem-nokogiri/rubygem-nokogiri.spec

359 lines
9.7 KiB
RPMSpec
Raw Normal View History

2012-12-31 15:36:33 +00:00
%if 0%{?fedora} <= 16 && 0%{?rhel} <= 6
2012-06-25 09:16:59 +00:00
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
2012-01-24 09:04:16 +00:00
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
2012-12-31 08:40:01 +00:00
%endif
2009-01-20 04:10:53 +00:00
2013-12-25 09:07:03 +00:00
%global mainver 1.6.1
2012-01-18 07:53:43 +00:00
#%%global prever .beta.4
2010-10-17 16:39:43 +00:00
2013-03-28 03:27:33 +00:00
%global mainrel 1
2010-10-17 16:39:43 +00:00
%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}
2009-01-20 04:10:53 +00:00
2012-12-31 08:40:01 +00:00
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
2013-03-28 03:27:33 +00:00
%if 0%{?fedora} < 19
%global rubyabi 1.9.1
%endif
%global ruby19 1
2012-01-24 09:04:16 +00:00
%global gemdir %{gem_dir}
%global geminstdir %{gem_instdir}
%global gemsodir %{gem_extdir_mri}/lib
2012-01-24 09:04:16 +00:00
%else
%global ruby19 0
2012-01-24 09:04:16 +00:00
%global gemsodir %{ruby_sitearch}
%endif
2012-12-31 16:28:09 +00:00
%global gem_name %{gemname}
2012-01-24 09:04:16 +00:00
2009-07-28 18:13:48 +00:00
# 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.
2009-07-28 18:13:48 +00:00
2009-01-20 04:10:53 +00:00
Summary: An HTML, XML, SAX, and Reader parser
Name: rubygem-%{gemname}
2010-10-17 16:39:43 +00:00
Version: %{mainver}
Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.1
2009-01-20 04:10:53 +00:00
Group: Development/Languages
License: MIT
URL: http://nokogiri.rubyforge.org/nokogiri/
2010-10-17 16:39:43 +00:00
Source0: http://gems.rubyforge.org/gems/%{gemname}-%{mainver}%{?prever}.gem
2010-12-06 19:55:04 +00:00
# ./test/html/test_element_description.rb:62 fails, as usual......
2011-01-29 16:58:22 +00:00
# Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch
2012-04-09 09:27:08 +00:00
#Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
2013-03-28 03:27:33 +00:00
%if 0%{?fedora} >= 19
Requires: ruby(release)
BuildRequires: ruby(release)
2013-03-28 03:27:33 +00:00
%else
Requires: ruby(abi) = %{rubyabi}
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby
%endif
2009-01-20 04:10:53 +00:00
BuildRequires: ruby(rubygems)
2011-01-29 16:58:22 +00:00
##
## For %%check
BuildRequires: rubygem(minitest)
2012-01-24 09:04:16 +00:00
BuildRequires: rubygems-devel
2012-05-28 08:18:24 +00:00
Obsoletes: ruby-%{gemname} <= 1.5.2-2
#BuildRequires: ruby(racc)
2011-01-29 16:58:22 +00:00
##
## Others
2009-01-20 04:10:53 +00:00
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: ruby-devel
Requires: ruby(rubygems)
Provides: rubygem(%{gemname}) = %{version}-%{release}
%description
Nokogiri parses and searches XML/HTML very quickly, and also has
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.
2010-10-17 16:39:43 +00:00
%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
2009-01-20 04:10:53 +00:00
%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
Requires: %{name} = %{version}-%{release}
Provides: ruby(%{gemname}) = %{version}-%{release}
%description -n ruby-%{gemname}
This package provides non-Gem support for %{gemname}.
%prep
%setup -q -T -c
2012-12-31 15:22:36 +00:00
# Gem repack
TOPDIR=$(pwd)
mkdir tmpunpackdir
pushd tmpunpackdir
gem unpack %{SOURCE0}
cd %{gem_name}-%{version}
# patches
#%%patch0 -p1
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
2013-10-04 10:00:22 +00:00
# remove bundled external libraries
sed -i -e 's|, "ports/archives/[^"][^"]*"||g' \
%{gem_name}.gemspec
# Actually not needed when using system libraries
sed -i -e '\@mini_portile@d' %{gem_name}.gemspec
2012-12-31 15:22:36 +00:00
# Ummm...
env LANG=ja_JP.UTF-8 gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR
popd
rm -rf tmpunpackdir
%build
2009-01-20 04:10:53 +00:00
mkdir -p ./%{gemdir}
2013-10-04 10:00:22 +00:00
# 1.6.0 needs this
export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
%gem_install
2009-01-20 04:10:53 +00:00
2010-12-06 19:55:04 +00:00
2010-10-17 16:39:43 +00:00
# Permission
chmod 0644 .%{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem
# Remove precompiled Java .jar file
rm -f .%{geminstdir}/lib/*.jar
# For now remove JRuby support
rm -rf .%{geminstdir}/ext/java
2009-01-20 04:10:53 +00:00
%install
mkdir -p %{buildroot}%{gemdir}
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
2010-05-25 17:24:27 +00:00
# Remove backup file
find %{buildroot} -name \*.orig_\* | xargs rm -vf
2012-01-24 09:04:16 +00:00
# move arch dependent files to %%gem_extdir
mkdir -p %{buildroot}%{gemsodir}/%{gemname}
2009-01-20 04:10:53 +00:00
mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
2012-01-24 09:04:16 +00:00
%{buildroot}%{gemsodir}/%{gemname}/
2009-01-20 04:10:53 +00:00
2009-06-10 19:53:39 +00:00
# move bin/ files
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
2009-06-10 19:53:39 +00:00
2009-01-20 04:10:53 +00:00
# remove all shebang
for f in $(find %{buildroot}%{geminstdir} -name \*.rb)
do
sed -i -e '/^#!/d' $f
chmod 0644 $f
done
# cleanups
2010-10-17 16:39:43 +00:00
rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/
rm -rf %{buildroot}%{geminstdir}/tmp/
2013-10-04 10:00:22 +00:00
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest,.travis.yml}
rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all}
2009-01-20 04:10:53 +00:00
2009-03-11 15:35:33 +00:00
%check
2011-01-29 16:58:22 +00:00
# Ah....
2009-08-21 17:33:20 +00:00
# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
# fails without TZ on sparc
export TZ="Asia/Tokyo"
2012-01-24 09:04:16 +00:00
#???
LANG=ja_JP.UTF-8
2009-08-21 17:33:20 +00:00
2009-03-11 15:35:33 +00:00
pushd ./%{geminstdir}
2012-04-09 09:27:08 +00:00
2012-05-28 09:04:04 +00:00
# Need investigation. For now anyway build
2012-06-25 08:59:57 +00:00
ruby -I.:lib:test \
-e \
2013-10-04 10:00:22 +00:00
"require 'test/helper' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \
2012-05-28 09:04:04 +00:00
echo "Please investigate this"
2012-04-09 09:27:08 +00:00
for f in $SKIPTEST
2011-01-29 16:58:22 +00:00
do
2012-04-09 09:27:08 +00:00
mv $f.skip $f
2011-01-29 16:58:22 +00:00
done
2009-03-11 15:35:33 +00:00
popd
2009-01-20 04:10:53 +00:00
%files
%defattr(-,root, root,-)
2009-06-10 19:53:39 +00:00
%{_bindir}/%{gemname}
%{gem_extdir_mri}/
2009-01-20 04:10:53 +00:00
%dir %{geminstdir}/
%doc %{geminstdir}/[A-Z]*
2012-06-25 08:59:57 +00:00
#%%doc %{geminstdir}/nokogiri_help_responses.md
2009-06-10 19:53:39 +00:00
%exclude %{geminstdir}/Rakefile
2013-10-04 10:00:22 +00:00
%exclude %{geminstdir}/Gemfile
2010-10-17 16:39:43 +00:00
%{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
2009-01-20 04:10:53 +00:00
%files doc
%defattr(-,root,root,-)
2009-06-10 19:53:39 +00:00
%{geminstdir}/Rakefile
2012-01-18 07:53:43 +00:00
#%%{geminstdir}/deps.rip
2010-12-06 19:55:04 +00:00
#%%{geminstdir}/spec/
2009-03-11 15:35:33 +00:00
%{geminstdir}/tasks/
2009-01-20 04:10:53 +00:00
%{geminstdir}/test/
2010-10-17 16:39:43 +00:00
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/
2009-01-20 04:10:53 +00:00
%changelog
2013-12-25 09:07:03 +00:00
* Wed Dec 25 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.1-1
- 1.6.1
2013-10-04 10:00:22 +00:00
* Fri Oct 4 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.6.0-1
- 1.6.0
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.9-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2013-03-28 03:27:33 +00:00
* Thu Mar 28 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.5.9-1
- 1.5.9
* Tue Mar 26 2013 Vít Ondruch <vondruch@redhat.com> - 1.5.6-3
- Use %%{gem_extdir_mri} instead of %%{gem_extdir}.
* Sat Feb 23 2013 Vít Ondruch <vondruch@redhat.com> - 1.5.6-2
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.6-1.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2012-12-31 15:22:36 +00:00
* Tue Jan 1 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.5.6-1
- A Happy New Year
- 1.5.6
2012-08-17 18:34:08 +00:00
* Fri Aug 17 2012 Vít Ondruch <vondruch@redhat.com> - 1.5.5-2
- Rebuilt againts libxml2 2.9.
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.5-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2012-06-25 08:59:57 +00:00
* Mon Jun 25 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.5-1
- 1.5.5
2012-05-28 08:18:24 +00:00
* Mon May 28 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.2-3
- Fix Obsoletes (bug 822931)
2012-04-09 09:27:08 +00:00
* Mon Apr 9 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.2-1
- 1.5.2
* Tue Apr 03 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.5.0-3
- Fix conditionals for F17 to work for RHEL 7 as well.
2012-01-24 09:04:16 +00:00
* Tue Jan 24 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-2
- F-17: rebuild for ruby19
- For now aviod build failure by touching some files
2012-01-24 09:04:16 +00:00
2012-01-18 07:53:43 +00:00
* Thu Jan 18 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-1
- 1.5.0
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-0.5.beta4.1
2012-01-18 07:53:43 +00:00
- F-17: Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2011-06-25 16:18:01 +00:00
* Sun Jun 26 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-0.5.beta4
- Remove unneeded patch
* Thu Mar 18 2011 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-0.4.beta4
- Patch for newer rake to make testsuite run
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-0.3.beta4.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2011-01-29 16:58:22 +00:00
* Sun Jan 30 2011 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.3.beta4
- 1.5.0.beta.4
2010-12-06 19:55:04 +00:00
* Tue Dec 7 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.2.beta3
- 1.5.0.beta.3
2010-10-17 16:39:43 +00:00
* Sun Oct 17 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.0-0.1.beta2
- Try 1.5.0.beta.2
* Fri Jul 30 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.3.1-1
- 1.4.3.1
2010-05-25 17:24:27 +00:00
* Wed May 26 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.2-1
- 1.4.2
* Thu Apr 29 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.1-2
- Fix build failure with libxml2 >= 2.7.7
2009-12-15 07:09:01 +00:00
* Tue Dec 15 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.1-1
- 1.4.1
2009-11-08 16:21:12 +00:00
* Mon Nov 9 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.4.0-1
- 1.4.0
2009-08-21 17:33:20 +00:00
* Sat Aug 22 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.3-2
- Fix test failure on sparc
2009-07-28 18:13:48 +00:00
* Wed Jul 29 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.3-1
- 1.3.3
2009-07-25 07:07:57 +00:00
* Sat Jul 25 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-3
- F-12: Mass rebuild
2009-07-02 05:36:36 +00:00
* Thu Jul 2 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-2
- Enable test
- Recompile with -O2
2009-06-24 18:22:46 +00:00
* Thu Jun 25 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.2-1
- 1.3.2
2009-06-10 19:53:39 +00:00
* Thu Jun 11 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.3.1-1
- 1.3.1
2009-03-25 19:45:03 +00:00
* Thu Mar 26 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.3-1
- 1.2.3
2009-03-18 15:53:47 +00:00
* Thu Mar 19 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.2-1
- 1.2.2
2009-03-11 15:35:33 +00:00
* Thu Mar 12 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.1-1
- 1.2.1
2009-02-24 14:52:03 +00:00
* Tue Feb 24 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.1-2
- F-11: Mass rebuild
2009-01-20 04:10:53 +00:00
* Thu Jan 15 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.1-1
- 1.1.1
* Thu Dec 25 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.1.0-1
- Initial packaging