This commit is contained in:
TASAKA Mamoru 2012-04-10 15:58:56 +09:00
parent f462b6acbe
commit 3802e6e489
3 changed files with 62 additions and 38 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ nokogiri-1.4.3.1.gem
/nokogiri-1.5.0.beta.3.gem
/nokogiri-1.5.0.beta.4.gem
/nokogiri-1.5.0.gem
/nokogiri-1.5.2.gem

View File

@ -1,8 +1,8 @@
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
%global rubyabi 1.8
%global mainver 1.5.0
%global mainver 1.5.2
#%%global prever .beta.4
%global mainrel 1
@ -12,6 +12,18 @@
%global gemname nokogiri
%global geminstdir %{gemdir}/gems/%{gemname}-%{mainver}%{?prever}
%if %{?fedora:0%{fedora} >= 17}%{?rhel:0%{rhel} >= 7}
%global ruby19 1
%global rubyabi 1.9.1
%global gemdir %{gem_dir}
%global gem_name %{gemname}
%global geminstdir %{gem_instdir}
%global gemsodir %{gem_extdir}/lib
%else
%global ruby19 0
%global gemsodir %{ruby_sitearch}
%endif
# 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
@ -27,17 +39,16 @@ URL: http://nokogiri.rubyforge.org/nokogiri/
Source0: http://gems.rubyforge.org/gems/%{gemname}-%{mainver}%{?prever}.gem
# ./test/html/test_element_description.rb:62 fails, as usual......
# Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch
Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
#Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby(rubygems)
##
## For %%check
BuildRequires: rubygem(hoe)
# Not available yet
# BuildRequires: rubygem(hoe-debugging)
BuildRequires: rubygem(rake)
BuildRequires: rubygem(rake-compiler)
BuildRequires: rubygem(minitest)
%if 0%{?ruby19} > 0
BuildRequires: rubygems-devel
%endif
#BuildRequires: ruby(racc)
##
## Others
BuildRequires: libxml2-devel
@ -46,6 +57,7 @@ BuildRequires: ruby-devel
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Provides: rubygem(%{gemname}) = %{version}-%{release}
Obsoletes: ruby-%{gemname} <= 1.5.0-2
%description
Nokogiri parses and searches XML/HTML very quickly, and also has
@ -95,7 +107,7 @@ gem install \
# patches
pushd .%{geminstdir}
%patch0 -p1
#%%patch0 -p1
popd
# Permission
@ -107,24 +119,18 @@ rm -f .%{geminstdir}/lib/*.jar
rm -rf .%{geminstdir}/ext/java
%build
# cflags wrong (-O3 passed), recompiling
pushd ./%{geminstdir}
sed -i.flags -e 's|-O3||' ext/nokogiri/extconf.rb
find . -name \*.so -or -name \*.o -exec rm -f {} \;
rake -v compile --trace
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir}
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
# Remove backup file
find %{buildroot} -name \*.orig_\* | xargs rm -vf
# move arch dependent files to %%ruby_sitearch
mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname}
# move arch dependent files to %%gem_extdir
mkdir -p %{buildroot}%{gemsodir}/%{gemname}
mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
%{buildroot}%{ruby_sitearch}/%{gemname}/
%{buildroot}%{gemsodir}/%{gemname}/
# move bin/ files
mkdir -p %{buildroot}%{_prefix}
@ -142,6 +148,7 @@ rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/
rm -rf %{buildroot}%{geminstdir}/tmp/
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest}
%if 0%{?ruby19} < 1
# The following method is completely copied from rubygem-gettext
# spec file
#
@ -202,41 +209,45 @@ popd
}
create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
%endif
%clean
rm -rf %{buildroot}
%check
# Ah....
rm -rf TMPBINDIR
mkdir -p TMPBINDIR
pushd TMPBINDIR
ln -sf /bin/true sudo
export PATH=$(pwd):$PATH
popd
# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
# fails without TZ on sparc
export TZ="Asia/Tokyo"
#???
%if 0%{?ruby19} > 0
LANG=ja_JP.UTF-8
%endif
pushd ./%{geminstdir}
# Some files are missing and due to it some tests fail, skil
for TEST in \
test_document_xhtml_enc
# Some files are missing and due to it some tests fail, skip
SKIPTEST="test/xml/test_xinclude.rb"
for f in $SKIPTEST
do
grep -l "def $TEST" test/*/*.rb | \
xargs sed -i.fail -e "/$TEST/a \ # Needed file does not exist\n return\n"
mv $f $f.skip
done
ruby -I.:lib:test -rubygems -e \
"require 'minitest/autorun' ; Dir.glob('test/**/test_*.rb'){|f| require f}"
for f in $SKIPTEST
do
mv $f.skip $f
done
rake test --trace
# rake spec --trace
popd
%files
%defattr(-,root, root,-)
%{_bindir}/%{gemname}
%{ruby_sitearch}/%{gemname}/
%if 0%{?ruby19} < 1
%{ruby_sitearch}/%{gemname}
%else
%{gem_extdir}/
%endif
%dir %{geminstdir}/
%doc %{geminstdir}/[A-Z]*
%doc %{geminstdir}/nokogiri_help_responses.md
@ -261,13 +272,25 @@ popd
%{geminstdir}/test/
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/
%if 0%{?ruby19} < 1
%files -n ruby-%{gemname}
%defattr(-,root,root,-)
%{ruby_sitelib}/*%{gemname}.rb
%{ruby_sitelib}/%{gemname}/
%{ruby_sitelib}/xsd/
%endif
%changelog
* 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.
* 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
* Thu Jan 18 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-1
- 1.5.0

View File

@ -1 +1 @@
91aef0c0d912554f0abfbd82666a0504 nokogiri-1.5.0.gem
38ce6d3bf4020667de8816bcd3daeacc nokogiri-1.5.2.gem