[packages/ruby-hpricot] Rel 2
arekm
arekm at pld-linux.org
Fri Mar 20 20:53:10 CET 2026
commit 7065ed4429807c7855bdf36962b079efc840ee39
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Mar 20 20:52:47 2026 +0100
Rel 2
hpricot-ruby34.patch | 40 +++++++++++++++++
ruby-hpricot.spec | 123 +++++++++++++++++++++++++++++----------------------
2 files changed, 111 insertions(+), 52 deletions(-)
---
diff --git a/ruby-hpricot.spec b/ruby-hpricot.spec
index a7e7dfd..81ea159 100644
--- a/ruby-hpricot.spec
+++ b/ruby-hpricot.spec
@@ -1,83 +1,102 @@
-#
-# Conditional build:
-%bcond_without tests # build without tests
-
-%define pkgname hpricot
-Summary: A fast and easy HTML parser
-Summary(pl.UTF-8): Szybki i prosty analizator HTML-a
-Name: ruby-%{pkgname}
+Summary: A fast HTML parser
+Summary(pl.UTF-8): Szybki parser HTML-a
+Name: ruby-hpricot
Version: 0.8.6
-Release: 7
+Release: 8
License: MIT
Group: Development/Languages
-#Source0Download: https://github.com/hpricot/hpricot/releases
-Source0: https://github.com/hpricot/hpricot/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 22cb09304283a1b9590385850bd462c1
-URL: https://rubygems.org/gems/hpricot
+Source0: https://rubygems.org/downloads/hpricot-%{version}.gem
+# Source0-md5: b0f1f02448037f4f6243c33d5f818fa4
+Patch0: hpricot-ruby34.patch
+URL: https://github.com/hpricot/hpricot
+BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.665
BuildRequires: ruby-devel
-BuildRequires: ruby-modules
-BuildRequires: setup.rb >= 3.4.1-6
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Hpricot is a very flexible HTML parser, based on Tanaka Akira's HTree
-and John Resig's JQuery, but with the scanner recoded in C (using
-Ragel for scanning.) I've borrowed what I believe to be the best ideas
-from these wares to make Hpricot heaps of fun to use.
+Hpricot is a fast HTML parser, based on a small C-based scanner.
%description -l pl.UTF-8
-Hpricot to bardzo elastyczny analizator HTML-a, oparty na HTree Tanaka
-Akiry i JQuery Johna Resiga, ale ze skanerem napisanym w C
-(wykorzystującym Ragela). Z tych wyrobów zapożyczono najlepsze
-pomysły, aby uczynić Hpricota najprzyjemniejszym w użyciu.
+Hpricot to szybki parser HTML-a, oparty na niewielkim skanerze w C.
-%prep
-%setup -q -n hpricot-%{version}
+%package rdoc
+Summary: HTML documentation for %{name}
+Summary(pl.UTF-8): Dokumentacja w formacie HTML dla %{name}
+Group: Documentation
+Requires: ruby >= 1:1.8.7-4
+BuildArch: noarch
-cp %{_datadir}/setup.rb .
+%description rdoc
+HTML documentation for %{name}.
-cd ext/hpricot_scan
-ls *.c *.h > MANIFEST
+%description rdoc -l pl.UTF-8
+Dokumentacja w formacie HTML dla %{name}.
-%build
-# make gemspec self-contained
-ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
- File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
- file.puts spec.to_ruby_for_cache
-end'
+%package ri
+Summary: ri documentation for %{name}
+Summary(pl.UTF-8): Dokumentacja w formacie ri dla %{name}
+Group: Documentation
+Requires: ruby
+BuildArch: noarch
-%{__ruby} setup.rb config \
- --rbdir=%{ruby_vendorlibdir} \
- --sodir=%{ruby_vendorarchdir}
+%description ri
+ri documentation for %{name}.
-%{__ruby} setup.rb setup
+%description ri -l pl.UTF-8
+Dokumentacji w formacie ri dla %{name}.
-%if %{with tests}
-%{__ruby} -Ilib -Iext/fast_xs -Iext/hpricot_scan -r hpricot -e 1
-%endif
+%prep
+%setup -q -n hpricot-%{version}
+%patch -P0 -p1
-# rdoc crashes on _why's craaazy code.
-#rdoc --op rdoc lib
-#rdoc --ri --op ri lib
+%build
+cd ext/hpricot_scan
+%{__ruby} extconf.rb
+%{__make} \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+cd ../fast_xs
+%{__ruby} extconf.rb
+%{__make} \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+cd ../..
+rdoc --ri --op ri lib
+rdoc --op rdoc lib
+rm ri/created.rid
+rm ri/cache.ri
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir}}
-%{__ruby} setup.rb install \
- --prefix=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir},%{ruby_rdocdir}}
-cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+install -p ext/hpricot_scan/hpricot_scan.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
+install -p ext/fast_xs/fast_xs.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
-#cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
+cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
+cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
+%doc README.md CHANGELOG COPYING
+%attr(755,root,root) %{ruby_vendorarchdir}/hpricot_scan.so
+%attr(755,root,root) %{ruby_vendorarchdir}/fast_xs.so
%{ruby_vendorlibdir}/hpricot.rb
%{ruby_vendorlibdir}/hpricot
-%attr(755,root,root) %{ruby_vendorarchdir}/fast_xs.so
-%attr(755,root,root) %{ruby_vendorarchdir}/hpricot_scan.so
-%{ruby_specdir}/%{pkgname}-%{version}.gemspec
+
+%files rdoc
+%defattr(644,root,root,755)
+%{ruby_rdocdir}/%{name}-%{version}
+
+%files ri
+%defattr(644,root,root,755)
+%{ruby_ridir}/Hpricot
+%{ruby_ridir}/Kernel
+%{ruby_ridir}/Object
diff --git a/hpricot-ruby34.patch b/hpricot-ruby34.patch
new file mode 100644
index 0000000..67cd913
--- /dev/null
+++ b/hpricot-ruby34.patch
@@ -0,0 +1,40 @@
+--- hpricot-0.8.6/ext/hpricot_scan/hpricot_scan.c.orig 2026-03-20 15:35:12.213158771 +0100
++++ hpricot-0.8.6/ext/hpricot_scan/hpricot_scan.c 2026-03-20 15:35:12.225153045 +0100
+@@ -22,7 +22,7 @@
+ #define RSTRING_PTR(str) RSTRING(str)->ptr
+ #endif
+
+-VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE, VALUE);
++VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE);
+
+ #define NO_WAY_SERIOUSLY "*** This should not happen, please file a bug report with the HTML you're parsing at http://github.com/hpricot/hpricot/issues. So sorry!"
+
+@@ -6691,7 +6691,7 @@
+ static VALUE hpricot_struct_ref8(VALUE obj) {return H_ELE_GET(obj, 8);}
+ static VALUE hpricot_struct_ref9(VALUE obj) {return H_ELE_GET(obj, 9);}
+
+-static VALUE (*ref_func[10])() = {
++static VALUE (*ref_func[10])(VALUE) = {
+ hpricot_struct_ref0,
+ hpricot_struct_ref1,
+ hpricot_struct_ref2,
+@@ -6715,7 +6715,7 @@
+ static VALUE hpricot_struct_set8(VALUE obj, VALUE val) {return H_ELE_SET(obj, 8, val);}
+ static VALUE hpricot_struct_set9(VALUE obj, VALUE val) {return H_ELE_SET(obj, 9, val);}
+
+-static VALUE (*set_func[10])() = {
++static VALUE (*set_func[10])(VALUE, VALUE) = {
+ hpricot_struct_set0,
+ hpricot_struct_set1,
+ hpricot_struct_set2,
+--- hpricot-0.8.6/ext/fast_xs/fast_xs.c.orig 2026-03-20 15:36:22.563158753 +0100
++++ hpricot-0.8.6/ext/fast_xs/fast_xs.c 2026-03-20 15:36:22.568873737 +0100
+@@ -144,7 +144,7 @@
+ return rb_funcall(self, unpack_id, 1, U_fmt);
+ }
+
+-static VALUE unpack_uchar(VALUE self)
++static VALUE unpack_uchar(VALUE self, VALUE err)
+ {
+ return rb_funcall(self, unpack_id, 1, C_fmt);
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-hpricot.git/commitdiff/7065ed4429807c7855bdf36962b079efc840ee39
More information about the pld-cvs-commit
mailing list