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.3.gem
/nokogiri-1.5.0.beta.4.gem /nokogiri-1.5.0.beta.4.gem
/nokogiri-1.5.0.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_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']") %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
%global rubyabi 1.8 %global rubyabi 1.8
%global mainver 1.5.0 %global mainver 1.5.2
#%%global prever .beta.4 #%%global prever .beta.4
%global mainrel 1 %global mainrel 1
@ -12,6 +12,18 @@
%global gemname nokogiri %global gemname nokogiri
%global geminstdir %{gemdir}/gems/%{gemname}-%{mainver}%{?prever} %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: # Note for packager:
# Nokogiri 1.4.3.1 gem says that Nokogiri upstream will # Nokogiri 1.4.3.1 gem says that Nokogiri upstream will
# no longer support ruby 1.8.6 after 2010-08-01, so # 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 Source0: http://gems.rubyforge.org/gems/%{gemname}-%{mainver}%{?prever}.gem
# ./test/html/test_element_description.rb:62 fails, as usual...... # ./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.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(abi) = %{rubyabi}
BuildRequires: ruby(rubygems) BuildRequires: ruby(rubygems)
## ##
## For %%check ## For %%check
BuildRequires: rubygem(hoe)
# Not available yet
# BuildRequires: rubygem(hoe-debugging)
BuildRequires: rubygem(rake)
BuildRequires: rubygem(rake-compiler)
BuildRequires: rubygem(minitest) BuildRequires: rubygem(minitest)
%if 0%{?ruby19} > 0
BuildRequires: rubygems-devel
%endif
#BuildRequires: ruby(racc)
## ##
## Others ## Others
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
@ -46,6 +57,7 @@ BuildRequires: ruby-devel
Requires: ruby(abi) = %{rubyabi} Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems) Requires: ruby(rubygems)
Provides: rubygem(%{gemname}) = %{version}-%{release} Provides: rubygem(%{gemname}) = %{version}-%{release}
Obsoletes: ruby-%{gemname} <= 1.5.0-2
%description %description
Nokogiri parses and searches XML/HTML very quickly, and also has Nokogiri parses and searches XML/HTML very quickly, and also has
@ -95,7 +107,7 @@ gem install \
# patches # patches
pushd .%{geminstdir} pushd .%{geminstdir}
%patch0 -p1 #%%patch0 -p1
popd popd
# Permission # Permission
@ -107,24 +119,18 @@ rm -f .%{geminstdir}/lib/*.jar
rm -rf .%{geminstdir}/ext/java rm -rf .%{geminstdir}/ext/java
%build %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 %install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir} mkdir -p %{buildroot}%{gemdir}
cp -a ./%{gemdir}/* %{buildroot}%{gemdir} cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
# Remove backup file # Remove backup file
find %{buildroot} -name \*.orig_\* | xargs rm -vf find %{buildroot} -name \*.orig_\* | xargs rm -vf
# move arch dependent files to %%ruby_sitearch # move arch dependent files to %%gem_extdir
mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname} mkdir -p %{buildroot}%{gemsodir}/%{gemname}
mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \ mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
%{buildroot}%{ruby_sitearch}/%{gemname}/ %{buildroot}%{gemsodir}/%{gemname}/
# move bin/ files # move bin/ files
mkdir -p %{buildroot}%{_prefix} mkdir -p %{buildroot}%{_prefix}
@ -142,6 +148,7 @@ rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/
rm -rf %{buildroot}%{geminstdir}/tmp/ rm -rf %{buildroot}%{geminstdir}/tmp/
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest} rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest}
%if 0%{?ruby19} < 1
# The following method is completely copied from rubygem-gettext # The following method is completely copied from rubygem-gettext
# spec file # spec file
# #
@ -202,41 +209,45 @@ popd
} }
create_symlink_rec %{geminstdir}/lib %{ruby_sitelib} create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
%endif
%clean
rm -rf %{buildroot}
%check %check
# Ah.... # 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] # test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
# fails without TZ on sparc # fails without TZ on sparc
export TZ="Asia/Tokyo" export TZ="Asia/Tokyo"
#???
%if 0%{?ruby19} > 0
LANG=ja_JP.UTF-8
%endif
pushd ./%{geminstdir} pushd ./%{geminstdir}
# Some files are missing and due to it some tests fail, skil # Some files are missing and due to it some tests fail, skip
for TEST in \ SKIPTEST="test/xml/test_xinclude.rb"
test_document_xhtml_enc for f in $SKIPTEST
do do
grep -l "def $TEST" test/*/*.rb | \ mv $f $f.skip
xargs sed -i.fail -e "/$TEST/a \ # Needed file does not exist\n return\n" 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 done
rake test --trace
# rake spec --trace
popd popd
%files %files
%defattr(-,root, root,-) %defattr(-,root, root,-)
%{_bindir}/%{gemname} %{_bindir}/%{gemname}
%{ruby_sitearch}/%{gemname}/ %if 0%{?ruby19} < 1
%{ruby_sitearch}/%{gemname}
%else
%{gem_extdir}/
%endif
%dir %{geminstdir}/ %dir %{geminstdir}/
%doc %{geminstdir}/[A-Z]* %doc %{geminstdir}/[A-Z]*
%doc %{geminstdir}/nokogiri_help_responses.md %doc %{geminstdir}/nokogiri_help_responses.md
@ -261,13 +272,25 @@ popd
%{geminstdir}/test/ %{geminstdir}/test/
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/ %{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/
%if 0%{?ruby19} < 1
%files -n ruby-%{gemname} %files -n ruby-%{gemname}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{ruby_sitelib}/*%{gemname}.rb %{ruby_sitelib}/*%{gemname}.rb
%{ruby_sitelib}/%{gemname}/ %{ruby_sitelib}/%{gemname}/
%{ruby_sitelib}/xsd/ %{ruby_sitelib}/xsd/
%endif
%changelog %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 * Thu Jan 18 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.5.0-1
- 1.5.0 - 1.5.0

View File

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