]> git.pld-linux.org Git - packages/ruby-nokogiri.git/blame - ruby-nokogiri.spec
- rebuild with fixed ruby ridir path
[packages/ruby-nokogiri.git] / ruby-nokogiri.spec
CommitLineData
13e8ce0f
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
bcd96893 4%bcond_without doc # don't build ri/rdoc
fc664ae1 5
b5fcf745
ER
6# NOTE
7# - changelog https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.rdoc
8
c48d5933 9%define pkgname nokogiri
e64ac3c3 10Summary: An HTML, XML, SAX, and Reader parser
c48d5933 11Name: ruby-%{pkgname}
f276e0b0 12Version: 1.6.5
51a69d1e 13Release: 9
13e8ce0f 14License: MIT
88473d40 15Group: Development/Languages
c48d5933 16Source0: http://gems.rubyforge.org/gems/%{pkgname}-%{version}.gem
f276e0b0 17# Source0-md5: ac570aa0120b92185606919818d6ff92
b5fcf745 18Patch0: deps.patch
e9e55949 19Patch1: nogem.patch
fc664ae1 20URL: http://nokogiri.org/
bdd6be79
JR
21BuildRequires: libxml2-devel
22BuildRequires: libxslt-devel
13e8ce0f 23BuildRequires: rpm-rubyprov
c48d5933 24BuildRequires: rpmbuild(macros) >= 1.665
a0b9e84a 25BuildRequires: ruby-devel
b5fcf745
ER
26BuildRequires: ruby-mini_portile < 0.7
27BuildRequires: ruby-mini_portile >= 0.6.0
7805d793 28BuildRequires: ruby-rdoc
b5fcf745 29BuildRequires: sed >= 4.0
fb43a511 30BuildRequires: setup.rb >= 3.4.1-6
88473d40 31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
e64ac3c3 34Nokogiri is an HTML parser with XPath support for document searching,
35CSS3 selector support for document searching, an XML/HTML builder, and
36drop in replacement for Hpricot (though not bug for bug).
88473d40 37
e64ac3c3 38Nokogiri parses and searches XML/HTML very quickly, and also has
39correctly implemented CSS3 selector support as well as XPath support.
88473d40 40
41It also features an Hpricot compatibility layer to help ease the
a0b9e84a 42change to using correct CSS and XPath.
88473d40 43
bdd6be79 44%package rdoc
6a425bbc
JR
45Summary: HTML documentation for %{pkgname}
46Summary(pl.UTF-8): Dokumentacja w formacie HTML dla %{pkgname}
bdd6be79
JR
47Group: Documentation
48Requires: ruby >= 1:1.8.7-4
bcd96893
ER
49%if "%{_rpmversion}" >= "5"
50BuildArch: noarch
51%endif
bdd6be79
JR
52
53%description rdoc
6a425bbc
JR
54HTML documentation for %{pkgname}.
55
56%description rdoc -l pl.UTF-8
57Dokumentacja w formacie HTML dla %{pkgname}.
58
59%package ri
60Summary: ri documentation for %{pkgname}
61Summary(pl.UTF-8): Dokumentacja w formacie ri dla %{pkgname}
62Group: Documentation
63Requires: ruby
bcd96893
ER
64%if "%{_rpmversion}" >= "5"
65BuildArch: noarch
66%endif
6a425bbc
JR
67
68%description ri
69ri documentation for %{pkgname}.
70
71%description ri -l pl.UTF-8
72Dokumentacji w formacie ri dla %{pkgname}.
bdd6be79 73
88473d40 74%prep
c48d5933 75%setup -q -n %{pkgname}-%{version}
e9e55949 76%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
e9e55949 77%patch1 -p1
b5fcf745
ER
78
79cp -p %{_datadir}/setup.rb .
13e8ce0f
ER
80
81%build
c48d5933 82%__gem_helper spec
b5fcf745
ER
83
84# yes. this is after writing gemspec.
85# making gemspec from source is hard
86%patch0 -p1
87
fed122e7
ER
88# 1.6.0 needs this
89export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
90
6c46a214 91%{__ruby} setup.rb config \
13e8ce0f 92 --rbdir=%{ruby_vendorlibdir} \
6c46a214
ER
93 --sodir=%{ruby_vendorarchdir}/%{pkgname}
94%{__ruby} setup.rb setup
88473d40 95
13e8ce0f
ER
96%if %{with tests}
97# Ah....
98# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
99# fails without TZ on sparc
100export TZ="Asia/Tokyo"
101#???
102LANG=ja_JP.UTF-8
103
104# Some files are missing and due to it some tests fail, skip
105SKIPTEST="test/xml/test_xinclude.rb"
106for f in $SKIPTEST; do
107 mv $f $f.skip
108done
109
110# Observed fail on test_subclass_parse(Nokogiri::XML::TestDocument)
111# Need investigation. For now anyway build
6c46a214 112%{__ruby} -I.:ext:lib:test \
13e8ce0f
ER
113 -rubygems \
114 -e \
115 "require 'minitest/autorun' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \
116 echo "Please investigate this"
117
118for f in $SKIPTEST; do
119 mv $f.skip $f
120done
121%endif
fc664ae1 122
bcd96893 123%if %{with doc}
bdd6be79
JR
124rdoc --op rdoc lib
125rdoc --ri --op ri lib
f276e0b0
ER
126rm ri/Object/Nokogiri-i.ri
127rm ri/Object/cdesc-Object.ri
128rm ri/lib/nokogiri/css/page-tokenizer_rex.ri
6a425bbc 129rm ri/created.rid
13e8ce0f 130rm ri/cache.ri
bcd96893 131%endif
88473d40 132
133%install
134rm -rf $RPM_BUILD_ROOT
c48d5933 135install -d $RPM_BUILD_ROOT{%{ruby_archdir},%{ruby_rubylibdir},%{ruby_ridir},%{ruby_rdocdir},%{ruby_specdir}}
6c46a214 136%{__ruby} setup.rb install \
88473d40 137 --prefix=$RPM_BUILD_ROOT
138
c48d5933 139cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
bcd96893
ER
140
141%if %{with doc}
bdd6be79
JR
142cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
143cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
bcd96893 144%endif
88473d40 145
146%clean
147rm -rf $RPM_BUILD_ROOT
148
149%files
150%defattr(644,root,root,755)
bdd6be79 151%doc CHANGELOG.rdoc README.rdoc
6c46a214 152%lang(ja) %doc CHANGELOG.ja.rdoc
a9482b14
ER
153%attr(755,root,root) %{_bindir}/nokogiri
154%{ruby_vendorlibdir}/nokogiri.rb
155%{ruby_vendorlibdir}/nokogiri
156%{ruby_vendorlibdir}/xsd
6c46a214
ER
157%dir %{ruby_vendorarchdir}/nokogiri
158%attr(755,root,root) %{ruby_vendorarchdir}/nokogiri/nokogiri.so
c48d5933 159%{ruby_specdir}/%{pkgname}-%{version}.gemspec
bdd6be79 160
bcd96893 161%if %{with doc}
bdd6be79
JR
162%files rdoc
163%defattr(644,root,root,755)
164%{ruby_rdocdir}/%{name}-%{version}
6a425bbc
JR
165
166%files ri
167%defattr(644,root,root,755)
bdd6be79 168%{ruby_ridir}/Nokogiri
6a425bbc 169%{ruby_ridir}/XSD
bcd96893 170%endif
This page took 0.128358 seconds and 4 git commands to generate.