[projects/template-specs] ruby: sample how to write self-contained gemspec

glen glen at pld-linux.org
Sat Jan 24 14:24:26 CET 2015


commit 76d858efecedfcbb8bf193c205f3a30b50bd9849
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Dec 14 16:34:57 2014 +0200

    ruby: sample how to write self-contained gemspec

 ruby.spec | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/ruby.spec b/ruby.spec
index 8490485..363df34 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -73,6 +73,12 @@ find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 # write .gemspec
 %__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 old
 cp %{_datadir}/setup.rb .
 %{__ruby} setup.rb config \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/76d858efecedfcbb8bf193c205f3a30b50bd9849



More information about the pld-cvs-commit mailing list