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