diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..99b68b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# RPM target directories +/x86_64 + +# Version-dependent build artifacts +/.build-*.log +/virt-v2v-v*/ +/virt-v2v-*.src.rpm +/results_virt-v2v/ + +# Source +/virt-v2v-v*.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index 70f5671..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Replaced by virt-v2v subpackage of libguestfs. diff --git a/sources b/sources new file mode 100644 index 0000000..aaf49ca --- /dev/null +++ b/sources @@ -0,0 +1 @@ +652decfdf85a6d9091de2c0d3cf59489 virt-v2v-v0.9.0.tar.gz diff --git a/virt-v2v-use-appliance-backend.patch b/virt-v2v-use-appliance-backend.patch new file mode 100644 index 0000000..ad461fb --- /dev/null +++ b/virt-v2v-use-appliance-backend.patch @@ -0,0 +1,15 @@ +--- virt-v2v-v0.9.0.old/lib/Sys/VirtConvert/GuestfsHandle.pm 2012-12-06 15:09:51.000000000 +0000 ++++ virt-v2v-v0.9.0/lib/Sys/VirtConvert/GuestfsHandle.pm 2013-07-03 14:48:53.049335387 +0100 +@@ -76,6 +76,12 @@ + my $interface = "ide"; + + $g = Sys::Guestfs->new(); ++ ++ # Fedora-specific patch: The libvirt backend used in Fedora >= ++ # 18 does not support setting iface parameters. Therefore ++ # ensure we are using the direct (appliance) backend. ++ $g->set_attach_method ("appliance"); ++ + foreach my $disk (@{$disks}) { + my ($name, $path, $format) = @$disk; + diff --git a/virt-v2v-v0.9.1-The-license-metadata-must-be-a-list.patch b/virt-v2v-v0.9.1-The-license-metadata-must-be-a-list.patch new file mode 100644 index 0000000..2feb69f --- /dev/null +++ b/virt-v2v-v0.9.1-The-license-metadata-must-be-a-list.patch @@ -0,0 +1,34 @@ +From 6ea7529da49959ff164f39eae4423fdc730f9753 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 27 Jun 2014 17:20:00 +0200 +Subject: [PATCH] The license metadata must be a list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +CPAN::Meta::Spec defines the license value must be an array reference. +However current Build.PL uses simple scalar. This breaks generating +META.* files which breaks tests with recent Module::Build 0.4205. + +https://bugzilla.redhat.com/show_bug.cgi?id=1083430 +Signed-off-by: Petr Písař +--- + Build.PL | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Build.PL b/Build.PL +index 55cee55..0ccace3 100644 +--- a/Build.PL ++++ b/Build.PL +@@ -316,7 +316,7 @@ my $build = $class->new ( + script_files => [ 'v2v/virt-v2v.pl', 'p2v/server/virt-p2v-server.pl' ], + meta_add => { + resources => { +- license => "http://www.gnu.org/licenses/gpl.html", ++ license => [ "http://www.gnu.org/licenses/gpl.html" ], + homepage => "http://people.redhat.com/mbooth/virt-v2v/", + repository => "git://git.fedorahosted.org/virt-v2v.git", + MailingList => "http://www.redhat.com/mailman/listinfo/libguestfs", +-- +1.9.3 + diff --git a/virt-v2v.spec b/virt-v2v.spec new file mode 100644 index 0000000..da697e0 --- /dev/null +++ b/virt-v2v.spec @@ -0,0 +1,269 @@ +Name: virt-v2v +Version: 0.9.0 +Release: 8%{?dist}%{?extra_release} +Summary: Convert a virtual machine to run on KVM + +License: GPLv2+ and LGPLv2+ +URL: http://git.fedorahosted.org/git/virt-v2v.git + +Source0: https://fedorahosted.org/releases/v/i/virt-v2v/%{name}-v%{version}.tar.gz + +# Non-upstream patch to default to using the appliance backend +# for Fedora >= 18. +Patch1: virt-v2v-use-appliance-backend.patch + +# Fix license metadata, bug #1083430 +Patch2: virt-v2v-v0.9.1-The-license-metadata-must-be-a-list.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. +%if 0%{?rhel} >= 6 +ExclusiveArch: x86_64 +%else +ExclusiveArch: %{ix86} x86_64 +%endif + +# Build system direct requirements +BuildRequires: gettext +BuildRequires: perl +BuildRequires: perl(Module::Build) +BuildRequires: perl(ExtUtils::Manifest) +BuildRequires: perl(Test::More) +BuildRequires: perl(Test::Pod) +BuildRequires: perl(Test::Pod::Coverage) +BuildRequires: perl(Module::Find) + +# Runtime perl modules also required at build time for use_ok test +BuildRequires: perl(Archive::Extract) +BuildRequires: perl(DateTime) +BuildRequires: perl(Digest::SHA1) +BuildRequires: perl(IO::String) +BuildRequires: perl(Locale::TextDomain) +BuildRequires: perl(Module::Pluggable) +BuildRequires: perl(Net::HTTPS) +BuildRequires: perl(Net::SSL) +BuildRequires: perl(Sys::Guestfs) +BuildRequires: perl(Sys::Syslog) +BuildRequires: perl(Sys::Virt) +BuildRequires: perl(Term::ProgressBar) +BuildRequires: perl(URI) +BuildRequires: perl(XML::DOM) +BuildRequires: perl(XML::DOM::XPath) +BuildRequires: perl(XML::Writer) + +BuildRequires: perl-Sys-Guestfs >= 1:1.14.0 +BuildRequires: perl-hivex >= 1.2.2 + +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +# Required for the name optional argument to add_drive_opts +Requires: perl-Sys-Guestfs >= 1:1.14.0 + +# Undocumented from antiquity +Requires: perl-hivex >= 1.2.2 + +# Required for passing flags to get_xml_description +Requires: perl(Sys::Virt) >= 0.2.4 + +# Net::SSL and Net::HTTPS are loaded with require rather than use, which +# rpmbuild doesn't seem to discover automatically. +Requires: perl(Net::SSL) +Requires: perl(Net::HTTPS) + +# Need >= 0.8.1 for rpc fix talking to RHEL 5 libvirt +Requires: libvirt >= 0.8.1 + +# For GuestOS transfer image +Requires: /usr/bin/mkisofs + +# For guest image inspection +Requires: /usr/bin/qemu-img + +# For ssh transfers +Requires: /usr/bin/ssh + + +%description +virt-v2v is a tool for converting and importing virtual machines to +libvirt-managed KVM, or Red Hat Enterprise Virtualization. It can import a +variety of guest operating systems from libvirt-managed hosts and VMware ESX. + + +%prep +%setup -q -n %{name}-v%{version} + +%patch1 -p1 +%patch2 -p1 + + +%build +%{__perl} Build.PL +./Build + +# perl doesn't need debuginfo +%define debug_package %{nil} + + +%install +./Build install \ + --destdir %{buildroot} \ + --installdirs vendor \ + --install_path locale=%{_datadir}/locale \ + --install_path confdoc=%{_mandir}/man5 + +# Create lib directory, used for holding software to be installed in guests +statedir=%{buildroot}%{_localstatedir}/lib/virt-v2v +mkdir -p $statedir/software + +# Copy Windows dependencies into place +windir=$statedir/software/windows +mkdir -p $windir + +cp windows/rhsrvany.exe windows/firstboot.bat $windir/ + +mkdir -p %{buildroot}%{_sysconfdir} +cp v2v/virt-v2v.conf %{buildroot}%{_sysconfdir}/ +cp v2v/virt-v2v.db $statedir/ + +%find_lang %{name} + +# Not clear why this is being created as there is nothing arch-specific in +# virt-v2v. It isn't packaged, though, so we need to delete it. +[ -d "%{buildroot}/%{perl_archlib}" ] && + find %{buildroot}/%{perl_archlib} -name .packlist -type f | xargs rm + + +%check +./Build test + + +%files -f %{name}.lang +%doc TODO.txt +%doc META.yml +%doc ChangeLog +%doc COPYING COPYING.LIB + +# For noarch packages: vendorlib +%{perl_vendorlib}/* + +# Man pages +%{_mandir}/man1/*.1* +%{_mandir}/man3/*.3* +%{_mandir}/man5/*.5* + +# Executables +%attr(0755,root,root) %{_bindir}/virt-v2v +%attr(0755,root,root) %{_bindir}/virt-p2v-server + +%dir %{_localstatedir}/lib/virt-v2v + +%config(noreplace) %{_sysconfdir}/virt-v2v.conf +%config %{_localstatedir}/lib/virt-v2v/virt-v2v.db +%config(noreplace) %{_localstatedir}/lib/virt-v2v/software + + +%changelog +* Mon Aug 18 2014 Fedora Release Engineering - 0.9.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jun 27 2014 Petr Pisar - 0.9.0-7 +- Fix license metadata (bug #1083430) + +* Sun Jun 08 2014 Fedora Release Engineering - 0.9.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Aug 08 2013 Petr Pisar - 0.9.0-5 +- Perl 5.18 rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 0.9.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 3 2013 Richard W.M. Jones - 0.9.0-3 +- Default to using the appliance backend, since in Fedora >= 18 the + libvirt backend doesn't support the 'iface' parameter which virt-v2v + requires. +- Add BR perl(Sys::Syslog), required to run the tests. +- Remove some cruft from the spec file. + +* Fri Feb 15 2013 Fedora Release Engineering - 0.9.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Dec 6 2012 Matthew Booth - 0.9.0-1 +- New upstream release 0.9.0 + +* Sun Jul 22 2012 Fedora Release Engineering - 0.8.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 10 2012 Petr Pisar - 0.8.8-2 +- Perl 5.16 rebuild + +* Mon Jun 25 2012 Matthew Booth - 0.8.8-1 +- Rebase to upstream version 0.8.8 + +* Sat Jan 14 2012 Fedora Release Engineering - 0.8.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Aug 22 2011 Richard W.M. Jones - 0.8.3-1 +- New upstream release 0.8.3. +- Include upstream patch to fix whitespace problems in PO files. +- Remove virt-p2v from build by synchronizing the spec file so it + almost matches the one in RHEL 6.2. Note that virt-p2v is built in + a separate SRPM called rubygem-virt-p2v. + +* Thu Jul 21 2011 Petr Sabata - 0.8.1-4 +- Perl mass rebuild + +* Tue Jul 19 2011 Petr Sabata - 0.8.1-3 +- Perl mass rebuild + +* Tue May 17 2011 Matthew Booth - 0.8.1-2 +- Remove echoe build dependency +- Fix YAML error during P2V (RHBZ#705113) + +* Tue Apr 26 2011 Matthew Booth - 0.8.1-1 +- Update to release 0.8.1 + +* Tue Apr 19 2011 Matthew Booth - 0.8.0-1 +- Update to release 0.8.0 +- Include virt-p2v + +* Mon Feb 07 2011 Fedora Release Engineering - 0.7.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Nov 4 2010 Matthew Booth - 0.7.0-1 +- Update to release 0.7.0 + +* Thu Jul 1 2010 Matthew Booth - 0.6.1-1 +- Only build virt-v2v on architectures where libguestfs is available + +* Mon Jun 21 2010 Matthew Booth - 0.6.1-0 +- Update to release 0.6.1 +- Disable building of debuginfo + +* Mon Feb 22 2010 Matthew Booth - 0.4.0-1 +- Update to release 0.4.0 +- Change dependency on genisofs to mkisofs +- Update libguestfs dependency to 1.0.84 +- Add perl module dependencies: LWP::UserAgent, Net::HTTPS, Net::SSL, Net::URI +- Remove perl module dependency: Config::Tiny +- Add explicit build dependency on perl +- Add patch: virt-v2v-0.4.0-remove-fr.patch +- Add patch: virt-v2v-0.4.0-exechelper-cleanup.patch +- Add patch: virt-v2v-0.4.0-exechelper-tmpfile.patch + +* Mon Dec 7 2009 Stepan Kasal - 0.3.2-2 +- rebuild against perl 5.10.1 + +* Mon Nov 9 2009 Matthew Booth - 0.3.2-1 +- Update to release 0.3.2 +- Add BuildRequires gettext + +* Mon Nov 9 2009 Matthew Booth - 0.3.0-1 +- Update to release 0.3.0 + +* Tue Sep 15 2009 Matthew Booth - 0.2.0-1 +- Update to release 0.2.0 + +* Fri Sep 4 2009 Matthew Booth - 0.1.0-1 +- Initial specfile