3 %bcond_without tests # build without tests
5 %define pkgname hpricot
6 Summary: A fast and easy HTML parser
7 Summary(pl.UTF-8): Szybki i prosty analizator HTML-a
12 Group: Development/Languages
13 Source0: https://github.com/hpricot/hpricot/tarball/%{version}/%{name}-%{version}.tar.gz
14 # Source0-md5: e11ebb954ffebc56d54e3be7ada373ca
15 URL: https://rubygems.org/gems/hpricot
16 BuildRequires: rpmbuild(macros) >= 1.665
17 BuildRequires: ruby-devel
18 BuildRequires: ruby-modules
19 BuildRequires: setup.rb >= 3.4.1-6
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 Hpricot is a very flexible HTML parser, based on Tanaka Akira's HTree
24 and John Resig's JQuery, but with the scanner recoded in C (using
25 Ragel for scanning.) I've borrowed what I believe to be the best ideas
26 from these wares to make Hpricot heaps of fun to use.
28 %description -l pl.UTF-8
29 Hpricot to bardzo elastyczny analizator HTML-a, oparty na HTree Tanaka
30 Akiry i JQuery Johna Resiga, ale ze skanerem napisanym w C
31 (wykorzystującym Ragela). Z tych wyrobów zapożyczono najlepsze
32 pomysły, aby uczynić Hpricota najprzyjemniejszym w użyciu.
36 mv hpricot-hpricot-*/* .
38 cp %{_datadir}/setup.rb .
44 # make gemspec self-contained
45 ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
46 File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
47 file.puts spec.to_ruby_for_cache
50 %{__ruby} setup.rb config \
51 --rbdir=%{ruby_vendorlibdir} \
52 --sodir=%{ruby_vendorarchdir}
54 %{__ruby} setup.rb setup
57 %{__ruby} -Ilib -Iext/fast_xs -Iext/hpricot_scan -r hpricot -e 1
60 # rdoc crashes on _why's craaazy code.
62 #rdoc --ri --op ri lib
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir}}
67 %{__ruby} setup.rb install \
68 --prefix=$RPM_BUILD_ROOT
70 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
72 #cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
75 rm -rf $RPM_BUILD_ROOT
78 %defattr(644,root,root,755)
79 %{ruby_vendorlibdir}/hpricot.rb
80 %{ruby_vendorlibdir}/hpricot
81 %attr(755,root,root) %{ruby_vendorarchdir}/fast_xs.so
82 %attr(755,root,root) %{ruby_vendorarchdir}/hpricot_scan.so
83 %{ruby_specdir}/%{pkgname}-%{version}.gemspec