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 #Source0Download: https://github.com/hpricot/hpricot/releases
14 Source0: https://github.com/hpricot/hpricot/archive/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: 22cb09304283a1b9590385850bd462c1
16 URL: https://rubygems.org/gems/hpricot
17 BuildRequires: rpmbuild(macros) >= 1.665
18 BuildRequires: ruby-devel
19 BuildRequires: ruby-modules
20 BuildRequires: setup.rb >= 3.4.1-6
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Hpricot is a very flexible HTML parser, based on Tanaka Akira's HTree
25 and John Resig's JQuery, but with the scanner recoded in C (using
26 Ragel for scanning.) I've borrowed what I believe to be the best ideas
27 from these wares to make Hpricot heaps of fun to use.
29 %description -l pl.UTF-8
30 Hpricot to bardzo elastyczny analizator HTML-a, oparty na HTree Tanaka
31 Akiry i JQuery Johna Resiga, ale ze skanerem napisanym w C
32 (wykorzystującym Ragela). Z tych wyrobów zapożyczono najlepsze
33 pomysły, aby uczynić Hpricota najprzyjemniejszym w użyciu.
36 %setup -q -n hpricot-%{version}
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