]> git.pld-linux.org Git - packages/ruby-hpricot.git/blob - ruby-hpricot.spec
81563ed905d631730082d7d2a0c47a5ec5213b2f
[packages/ruby-hpricot.git] / ruby-hpricot.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define pkgname hpricot
6 Summary:        A fast and easy HTML parser
7 Summary(pl.UTF-8):      Szybki i prosty analizator HTML-a
8 Name:           ruby-%{pkgname}
9 Version:        0.8.6
10 Release:        6
11 License:        MIT
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)
21
22 %description
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.
27
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.
33
34 %prep
35 %setup -qc
36 mv hpricot-hpricot-*/* .
37
38 cp %{_datadir}/setup.rb .
39
40 cd ext/hpricot_scan
41 ls *.c *.h > MANIFEST
42
43 %build
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
48 end'
49
50 %{__ruby} setup.rb config \
51         --rbdir=%{ruby_vendorlibdir} \
52         --sodir=%{ruby_vendorarchdir}
53
54 %{__ruby} setup.rb setup
55
56 %if %{with tests}
57 %{__ruby} -Ilib -Iext/fast_xs -Iext/hpricot_scan -r hpricot -e 1
58 %endif
59
60 # rdoc crashes on _why's craaazy code.
61 #rdoc --op rdoc lib
62 #rdoc --ri --op ri lib
63
64 %install
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
69
70 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
71
72 #cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77 %files
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
This page took 0.042521 seconds and 2 git commands to generate.