Pull in upstream patches to remove echoe dependence

This commit is contained in:
Matthew Booth 2011-05-11 17:36:18 +01:00
parent dab11292e5
commit 55697cb1eb
4 changed files with 9478 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
commit e34a8c0911f53cff64f9a33d3802ac7361f3fe19
Author: Matthew Booth <mbooth@redhat.com>
Date: Wed May 11 16:05:18 2011 +0100
p2v-client: Drop echoe for build
echoe changes incompatibly from F14->F15. We're not using the vast majority of
its features, and it remains completely undocumented as far as I can tell. This
patch drops it in favour of a simple, explicit gem build task.
diff --git a/p2v/client/Rakefile b/p2v/client/Rakefile
index d190f08..23c26f5 100644
--- a/p2v/client/Rakefile
+++ b/p2v/client/Rakefile
@@ -14,24 +14,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-require 'rubygems'
-require 'echoe'
+require 'rake'
+require 'rake/gempackagetask'
-Echoe.new("virt-p2v") do |p|
- p.project = "Virt P2V"
- p.version = `../../Build version`
- p.author = "Matthew Booth"
- p.summary = "Send a machine's storage and metadata to virt-p2v-server"
- p.description = <<EOF
-virt-p2v is a client which connects to a virt-p2v-server and transfer's the host
-machine's storage and metadata. virt-p2v is intended to be run from a live
-image, so it is unlikely you want to install it.
-EOF
- p.url = "http://libguestfs.org"
- p.email = "libguestfs@redhat.com"
- p.runtime_dependencies = [
- 'gtk2',
- 'gettext',
- 'net-ssh'
- ]
-end
+task :default => :gem
+
+load 'virt-p2v.gemspec'
+Rake::GemPackageTask.new(GEMSPEC) {}
diff --git a/virt-v2v.spec.PL b/virt-v2v.spec.PL
index 2249b01..6a155e2 100644
--- a/virt-v2v.spec.PL
+++ b/virt-v2v.spec.PL
@@ -79,7 +79,6 @@ BuildRequires: perl-hivex >= 1.2.2
# virt-p2v build requirements
BuildRequires: rubygem(rake)
-BuildRequires: rubygem(echoe)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

View File

@ -0,0 +1,111 @@
commit fadb1929b4a8447a719a34f07e5934badf694f45
Author: Matthew Booth <mbooth@redhat.com>
Date: Wed May 11 16:46:37 2011 +0100
p2v-client: Add missing gemspec
gemspec used to be auto-generated, so was explicitly ignored. It's no longer
auto-generated, so we need it.
diff --git a/p2v/client/virt-p2v.gemspec b/p2v/client/virt-p2v.gemspec
new file mode 100644
index 0000000..d8edde8
--- /dev/null
+++ b/p2v/client/virt-p2v.gemspec
@@ -0,0 +1,96 @@
+# Copyright (C) 2011 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+V2V_VERSION = `../../Build version`
+abort "Failed to get version" unless $? == 0
+
+GEMSPEC = Gem::Specification.new do |s|
+ s.name = %q{virt-p2v}
+ s.version = V2V_VERSION
+
+ s.authors = ["Matthew Booth"]
+ s.date = %q{2011-05-10}
+ s.summary = %q{Send a machine's storage and metadata to virt-p2v-server}
+ s.description = %q{
+ virt-p2v is a client which connects to a virt-p2v-server and transfer's
+ the host machine's storage and metadata. virt-p2v is intended to be run
+ from a live image, so it is unlikely you want to install it.
+ }
+ s.email = %q{libguestfs@redhat.com}
+ s.homepage = %q{http://libguestfs.org}
+
+ s.default_executable = %q{virt-p2v}
+ s.executables = ["virt-p2v"]
+ s.files = [
+ "Rakefile",
+ "bin/virt-p2v",
+ "lib/virt-p2v/blockdevice.rb",
+ "lib/virt-p2v/connection.rb",
+ "lib/virt-p2v/converter.rb",
+ "lib/virt-p2v/gtk-queue.rb",
+ "lib/virt-p2v/netdevice.rb",
+ "lib/virt-p2v/ui/connect.rb",
+ "lib/virt-p2v/ui/convert.rb",
+ "lib/virt-p2v/ui/main.rb",
+ "lib/virt-p2v/ui/network.rb",
+ "lib/virt-p2v/ui/p2v.ui",
+ "lib/virt-p2v/ui/success.rb",
+ "virt-p2v.gemspec",
+ "Manifest"
+ ]
+ s.require_paths = ["lib"]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<gtk2>, [">= 0"])
+ s.add_runtime_dependency(%q<gettext>, [">= 0"])
+ s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
+ else
+ s.add_dependency(%q<gtk2>, [">= 0"])
+ s.add_dependency(%q<gettext>, [">= 0"])
+ s.add_dependency(%q<net-ssh>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<gtk2>, [">= 0"])
+ s.add_dependency(%q<gettext>, [">= 0"])
+ s.add_dependency(%q<net-ssh>, [">= 0"])
+ end
+
+# Source doesn't contain any rdoc
+# s.extra_rdoc_files = [
+# "bin/virt-p2v",
+# "lib/virt-p2v/blockdevice.rb",
+# "lib/virt-p2v/connection.rb",
+# "lib/virt-p2v/converter.rb",
+# "lib/virt-p2v/gtk-queue.rb",
+# "lib/virt-p2v/netdevice.rb",
+# "lib/virt-p2v/ui/connect.rb",
+# "lib/virt-p2v/ui/convert.rb",
+# "lib/virt-p2v/ui/main.rb",
+# "lib/virt-p2v/ui/network.rb",
+# "lib/virt-p2v/ui/p2v.ui",
+# "lib/virt-p2v/ui/success.rb"
+# ]
+# s.rdoc_options = [
+# "--line-numbers",
+# "--inline-source",
+# "--title",
+# "Virt-p2v"
+# ]
+end

View File

@ -16,6 +16,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# local seq no: the order the patches should be applied in
# git commit: the first 8 characters of the git commit hash
Patch0: virt-v2v-0.8.1-00-44eb9021-modified.patch
Patch1: virt-v2v-0.8.1-01-e34a8c09.patch
Patch2: virt-v2v-0.8.1-02-fadb1929.patch
# Unfortunately, despite really being noarch, we have to make virt-v2v arch
# dependent to avoid build failures on architectures where libguestfs isn't
# available.
@ -53,7 +57,6 @@ BuildRequires: perl-hivex >= 1.2.2
# virt-p2v build requirements
BuildRequires: rubygem(rake)
BuildRequires: rubygem(echoe)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@ -135,11 +138,16 @@ virt-p2v-image-builder is a tool to create a bootable virt-p2v live image.
%prep
%setup -q -n %{name}-v%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%{__perl} Build.PL
./Build
pushd p2v-client
pushd p2v/client
rake gem
popd
@ -172,7 +180,7 @@ mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{gemdir}
gem install --local --install-dir %{buildroot}%{gemdir} \
--force --rdoc p2v-client/pkg/%{gemname}-%{version}.gem
--force --rdoc p2v/client/pkg/%{gemname}-%{version}.gem
mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
cp COPYING %{buildroot}/%{geminstdir}
@ -181,8 +189,8 @@ cp COPYING %{buildroot}/%{geminstdir}
%global builderdir %{_datadir}/virt-p2v-image-builder
builder=%{buildroot}/%{_bindir}/virt-p2v-image-builder
mkdir -p %{buildroot}%{builderdir}
cp p2v-image-builder/*.ks %{buildroot}%{builderdir}
cp p2v-image-builder/virt-p2v-image-builder $builder
cp p2v/image-builder/*.ks %{buildroot}%{builderdir}
cp p2v/image-builder/virt-p2v-image-builder $builder
# Set the default data directory
sed -i -e 's,^DEFAULT_DATADIR=.*,DEFAULT_DATADIR=%{builderdir},' $builder
@ -191,7 +199,7 @@ sed -i -e 's,^DEFAULT_DATADIR=.*,DEFAULT_DATADIR=%{builderdir},' $builder
%check
./Build test
pushd p2v-client
pushd p2v/client
# No tests yet
#rake test
popd