[packages/ruby-hpricot] build with rubygem provides

glen glen at pld-linux.org
Sat Oct 17 13:15:30 CEST 2015


commit 8ce02ba2360980f69c56275cbe69dc8dd5f6d8b8
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Oct 17 14:15:25 2015 +0300

    build with rubygem provides

 ruby-hpricot.spec | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/ruby-hpricot.spec b/ruby-hpricot.spec
index c4c2a4c..62c7a7f 100644
--- a/ruby-hpricot.spec
+++ b/ruby-hpricot.spec
@@ -2,11 +2,12 @@
 # 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-hpricot
+Name:		ruby-%{pkgname}
 Version:	0.8.6
-Release:	1
+Release:	2
 License:	MIT
 Group:		Development/Languages
 Source0:	http://github.com/hpricot/hpricot/tarball/%{version}/%{name}-%{version}.tar.gz
@@ -38,6 +39,12 @@ cd ext/hpricot_scan
 ls *.c *.h > MANIFEST
 
 %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'
+
 %{__ruby} setup.rb config \
 	--rbdir=%{ruby_vendorlibdir} \
 	--sodir=%{ruby_vendorarchdir}
@@ -54,10 +61,12 @@ ls *.c *.h > MANIFEST
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_archdir},%{ruby_ridir}}
+install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir}}
 %{__ruby} setup.rb install \
 	--prefix=$RPM_BUILD_ROOT
 
+cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+
 #cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
 
 %clean
@@ -69,3 +78,4 @@ rm -rf $RPM_BUILD_ROOT
 %{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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-hpricot.git/commitdiff/8ce02ba2360980f69c56275cbe69dc8dd5f6d8b8



More information about the pld-cvs-commit mailing list