[packages/ruby-ohai/dev-8: 3/8] different way of writing .gemspec

glen glen at pld-linux.org
Wed Jun 1 22:21:50 CEST 2016


commit 2b26b7f00ed13d6a38b2ed6cea05ddd69e403c59
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Jun 1 23:07:59 2016 +0300

    different way of writing .gemspec

 ruby-ohai.spec | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/ruby-ohai.spec b/ruby-ohai.spec
index 8bd5baf..bb7fd2d 100644
--- a/ruby-ohai.spec
+++ b/ruby-ohai.spec
@@ -80,13 +80,15 @@ This package contains documentation for %{name}.
 rm spec/unit/plugins/darwin/system_profiler_spec.rb
 
 # can't figure how to fix -r rubygems does not help
-# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError)
+# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized constant Gem (NameError)
 rm spec/unit/plugins/ruby_spec.rb
 
 %build
-rake -Ilib gem
-%{__tar} -xmf pkg/ohai-%{version}*.gem
-%__gem_helper spec
+# 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'
 
 %if %{with tests}
 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-ohai.git/commitdiff/bde0a3a10206ff90937c4ac53c94b3ea316bb280



More information about the pld-cvs-commit mailing list