]> git.pld-linux.org Git - projects/template-specs.git/commitdiff
ruby: sample how to write self-contained gemspec
authorElan Ruusamäe <glen@delfi.ee>
Sun, 14 Dec 2014 14:34:57 +0000 (16:34 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 24 Jan 2015 13:24:24 +0000 (15:24 +0200)
ruby.spec

index 849048531c2948be246fb1068c2ad63938e79081..363df345efd17ded0aae2e90394b1fa86beb8cd3 100644 (file)
--- 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 \
This page took 0.084389 seconds and 4 git commands to generate.