[DRE-commits] [ruby-backports] 03/04: Create a static gemspec for proper gem integration

Jérémy Bobbio lunar at moszumanska.debian.org
Sun May 4 10:53:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-backports.

commit 126245845e6d490a608af5f2e6b491613560dd14
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Sun May 4 12:26:27 2014 +0200

    Create a static gemspec for proper gem integration
---
 debian/backports.gemspec | 27 +++++++++++++++++++++++++++
 debian/rules             | 24 ++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/debian/backports.gemspec b/debian/backports.gemspec
new file mode 100644
index 0000000..ce37f15
--- /dev/null
+++ b/debian/backports.gemspec
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+  s.name = "backports"
+  s.version = "3.6.0"
+
+  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+  s.authors = ["Marc-Andr\u{e9} Lafortune"]
+  s.date = "2014-05-04"
+  s.description = "Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions."
+  s.email = ["github at marc-andre.ca"]
+  s.files = [".document", ".gitignore", ".gitmodules", ".irbrc", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Gemfile.lock", "LICENSE.txt", "README.rdoc", "Rakefile", "backports.gemspec", "default.mspec", "lib/backports.rb", "lib/backports/1.8.7.rb", "lib/backports/1.8.7/argf.rb", "lib/backports/1.8.7/argf/bytes.rb", "lib/backports/1.8.7/argf/chars.rb", "lib/backports/1.8.7/argf/each.rb", "lib/backports/1.8.7/argf/each_byte.rb", "lib/backports/1.8.7/argf/each_char.rb", "lib/backports/1.8 [...]
+  s.homepage = "http://github.com/marcandre/backports"
+  s.require_paths = ["lib"]
+  s.rubygems_version = "1.8.23"
+  s.summary = "Backports of Ruby features for older Ruby."
+  s.test_files = ["spec/tags/1.8.6/core/argf/each_line_spec.rb", "spec/tags/1.8.6/core/argf/each_spec.rb", "spec/tags/1.8.6/core/argf/lines_spec.rb", "spec/tags/1.8.6/core/array/collect_spec.rb", "spec/tags/1.8.6/core/array/rotate_spec.rb", "spec/tags/1.8.6/core/array/uniq_spec.rb", "spec/tags/1.8.6/core/complex/to_r_spec.rb", "spec/tags/1.8.6/core/enumerable/each_entry_spec.rb", "spec/tags/1.8.6/core/enumerator/next_spec.rb", "spec/tags/1.8.6/core/env/to_h_spec.rb", "spec/tags/1.8.6/cor [...]
+
+  if s.respond_to? :specification_version then
+    s.specification_version = 3
+
+    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+    else
+    end
+  else
+  end
+end
diff --git a/debian/rules b/debian/rules
index 9b70672..eb5359d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,31 @@
 #!/usr/bin/make -f
 
+export DH_RUBY_GEMSPEC = debian/backports.gemspec
+
 %:
 	dh $@ --buildsystem=ruby --with ruby
 
 override_dh_installchangelogs:
 	dh_installchangelogs CHANGELOG.rdoc -O--buildsystem=ruby
+
+override_dh_auto_configure:
+	dh_auto_configure -O--buildsystem=ruby
+	ruby -Ilib -e ' \
+		require "backports/version"; \
+		spec = Gem::Specification.load(ENV["DH_RUBY_GEMSPEC"]); \
+		if spec.version.to_s != Backports::VERSION; \
+			$$stderr.puts "Static gemspec is outdated. Run: debian/rules clean"; \
+			exit 1; \
+		end \
+		'
+
+override_dh_clean:
+	dh_clean -O--buildsystem=ruby
+	# Let's create a static version of the gemspec as we don't build with git
+	if [ -d .git ]; then \
+		ruby -rrubygems -e ' \
+			spec = Gem::Specification.load("backports.gemspec"); \
+			spec.files.delete_if { |p| p.start_with? "debian/" }; \
+			File.write(ENV["DH_RUBY_GEMSPEC"], spec.to_ruby); \
+			'; \
+	fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-backports.git



More information about the Pkg-ruby-extras-commits mailing list