[DRE-commits] [vagrant-lxc] 03/07: Try the path of least resistance wrt patching vagrant

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Feb 26 13:39:21 UTC 2014


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

terceiro pushed a commit to branch master
in repository vagrant-lxc.

commit 24d5f2d785d30c42a32c541b1268032980ee344a
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Wed Feb 26 10:00:10 2014 -0300

    Try the path of least resistance wrt patching vagrant
---
 debian/control                        |  2 +-
 debian/patches/expanded-gemspec.patch | 31 +++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 debian/refresh-gemspec                | 24 ++++++++++++++++++++++++
 debian/rules                          | 26 ++++++++++++++------------
 5 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/debian/control b/debian/control
index e85c03a..4e92b13 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders: Antonio Terceiro <terceiro at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.1~)
+Build-Depends: debhelper (>= 7.0.50~), ruby
 Standards-Version: 3.9.4
 #Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/vagrant-lxc.git
 #Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/vagrant-lxc.git;a=summary
diff --git a/debian/patches/expanded-gemspec.patch b/debian/patches/expanded-gemspec.patch
new file mode 100644
index 0000000..6e38ff8
--- /dev/null
+++ b/debian/patches/expanded-gemspec.patch
@@ -0,0 +1,31 @@
+--- /dev/null
++++ b/vagrant-lxc-0.8.0.gemspec
+@@ -0,0 +1,28 @@
++# -*- encoding: utf-8 -*-
++
++Gem::Specification.new do |s|
++  s.name = "vagrant-lxc"
++  s.version = "0.8.0"
++
++  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
++  s.authors = ["Fabio Rehm"]
++  s.date = "2014-02-26"
++  s.description = "Linux Containers provider for Vagrant"
++  s.email = ["fgrehm at gmail.com"]
++  s.files = [".gitignore", ".rspec", ".travis.yml", ".vimrc", "BOXES.md", "CHANGELOG.md", "CONTRIBUTING.md", "Gemfile", "Gemfile.lock", "Guardfile", "LICENSE.txt", "README.md", "Rakefile", "boxes/build-all.sh", "boxes/build-debian-box.sh", "boxes/build-openmandriva-box.sh", "boxes/build-ubuntu-box.sh", "boxes/common/cleanup", "boxes/common/install-babushka", "boxes/common/install-chef", "boxes/common/install-puppet", "boxes/common/install-salt", "boxes/common/install-salt-debian", "boxe [...]
++  s.homepage = "https://github.com/fgrehm/vagrant-lxc"
++  s.licenses = ["MIT"]
++  s.require_paths = ["lib"]
++  s.rubygems_version = "1.8.23"
++  s.summary = "Linux Containers provider for Vagrant"
++  s.test_files = ["spec/Vagrantfile", "spec/acceptance/sanity_check_spec.rb", "spec/acceptance/support/acceptance_example_group.rb", "spec/acceptance/support/machine_ext.rb", "spec/acceptance/support/test_ui.rb", "spec/acceptance_helper.rb", "spec/fixtures/sample-ip-addr-output", "spec/spec_helper.rb", "spec/support/.gitkeep", "spec/unit/action/clear_forwarded_ports_spec.rb", "spec/unit/action/compress_rootfs_spec.rb", "spec/unit/action/forward_ports_spec.rb", "spec/unit/action/handle_b [...]
++
++  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/patches/series b/debian/patches/series
new file mode 100644
index 0000000..beeea8e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+expanded-gemspec.patch
diff --git a/debian/refresh-gemspec b/debian/refresh-gemspec
new file mode 100755
index 0000000..819fa59
--- /dev/null
+++ b/debian/refresh-gemspec
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+version=$(dpkg-parsechangelog -SVersion | cut -d - -f 1)
+
+gemspec=vagrant-lxc-${version}.gemspec
+rm -f $gemspec
+
+patch=expanded-gemspec.patch
+
+if (quilt series | grep -q $patch); then
+  while ! (quilt top | grep -q $patch); do
+    quilt push
+  done
+else
+  mkdir debian/patches
+  quilt new $patch
+  quilt add $gemspec
+fi
+
+ruby -e 'spec = Gem::Specification.load("vagrant-lxc.gemspec"); spec.files.reject! { |f| f =~ /^debian/ }; puts spec.to_ruby' > $gemspec
+quilt refresh
+quilt pop -a
diff --git a/debian/rules b/debian/rules
index 82ddc0c..eaee347 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,15 +1,17 @@
 #!/usr/bin/make -f
-#export DH_VERBOSE=1
-#
-# Uncomment to ignore all test failures (but the tests will run anyway)
-#export DH_RUBY_IGNORE_TESTS=all
-#
-# Uncomment to ignore some test failures (but the tests will run anyway).
-# Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby1.9.1 ruby2.0 require-rubygems
-#
-# If you need to specify the .gemspec (eg there is more than one)
-#export DH_RUBY_GEMSPEC=gem.gemspec
 
 %:
-	dh $@ --buildsystem=ruby --with ruby
+	dh $@
+
+version = $(shell dpkg-parsechangelog -SVersion | cut -d - -f 1)
+
+gem = vagrant-lxc-$(version).gem
+gemspec = $(gem)spec
+
+override_dh_auto_install:
+	gem build $(gemspec)
+	gem install -i debian/vagrant-lxc/usr/share/vagrant-plugins $(gem)
+	dh_auto_install
+
+override_dh_auto_clean:
+	$(RM) $(gem)

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



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