Unify Fedora and RHEL spec files.
This commit is contained in:
parent
db25f16e0c
commit
6ec7a0de06
55
copy-patches.sh
Executable file
55
copy-patches.sh
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash -
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Maintainer script to copy patches from the git repo to the current
|
||||||
|
# directory. Use it like this:
|
||||||
|
# ./copy-patches.sh
|
||||||
|
|
||||||
|
rhel_version=av-8.3.0
|
||||||
|
|
||||||
|
# Check we're in the right directory.
|
||||||
|
if [ ! -f virt-v2v.spec ]; then
|
||||||
|
echo "$0: run this from the directory containing 'virt-v2v.spec'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git_checkout=$HOME/d/virt-v2v-rhel-$rhel_version
|
||||||
|
if [ ! -d $git_checkout ]; then
|
||||||
|
echo "$0: $git_checkout does not exist"
|
||||||
|
echo "This script is only for use by the maintainer when preparing a"
|
||||||
|
echo "virt-v2v release on RHEL."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the base version of virt-v2v.
|
||||||
|
version=`grep '^Version:' virt-v2v.spec | awk '{print $2}'`
|
||||||
|
tag="v$version"
|
||||||
|
|
||||||
|
# Remove any existing patches.
|
||||||
|
git rm -f [0-9]*.patch ||:
|
||||||
|
rm -f [0-9]*.patch
|
||||||
|
|
||||||
|
# Get the patches.
|
||||||
|
(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N --submodule=diff $tag)
|
||||||
|
mv $git_checkout/[0-9]*.patch .
|
||||||
|
|
||||||
|
# Remove any not to be applied.
|
||||||
|
rm -f *NOT-FOR-RPM*.patch
|
||||||
|
|
||||||
|
# Add the patches.
|
||||||
|
git add [0-9]*.patch
|
||||||
|
|
||||||
|
# Print out the patch lines.
|
||||||
|
echo
|
||||||
|
echo "--- Copy the following text into virt-v2v.spec file"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "# Patches."
|
||||||
|
for f in [0-9]*.patch; do
|
||||||
|
n=`echo $f | awk -F- '{print $1}'`
|
||||||
|
echo "Patch$n: $f"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "--- End of text"
|
@ -10,7 +10,7 @@
|
|||||||
Name: virt-v2v
|
Name: virt-v2v
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 1.43.2
|
Version: 1.43.2
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Convert a virtual machine to run on KVM
|
Summary: Convert a virtual machine to run on KVM
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -23,6 +23,10 @@ Source1: http://download.libguestfs.org/virt-v2v/%{source_directory}/%{nam
|
|||||||
Source2: libguestfs.keyring
|
Source2: libguestfs.keyring
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Maintainer script which helps with handling patches.
|
||||||
|
Source3: copy-patches.sh
|
||||||
|
|
||||||
|
%if !0%{?rhel}
|
||||||
# libguestfs hasn't been built on i686 for a while since there is no
|
# libguestfs hasn't been built on i686 for a while since there is no
|
||||||
# kernel built for this architecture any longer and libguestfs rather
|
# kernel built for this architecture any longer and libguestfs rather
|
||||||
# fundamentally depends on the kernel. Therefore we must exclude this
|
# fundamentally depends on the kernel. Therefore we must exclude this
|
||||||
@ -30,6 +34,14 @@ Source2: libguestfs.keyring
|
|||||||
# expect that libguestfs or virt-v2v will be available on i686 so
|
# expect that libguestfs or virt-v2v will be available on i686 so
|
||||||
# there is nothing that needs fixing.
|
# there is nothing that needs fixing.
|
||||||
ExcludeArch: %{ix86}
|
ExcludeArch: %{ix86}
|
||||||
|
%else
|
||||||
|
# Architectures where virt-v2v is shipped on RHEL:
|
||||||
|
#
|
||||||
|
# not on aarch64 because it is not useful there
|
||||||
|
# not on %%{power64} because of RHBZ#1287826
|
||||||
|
# not on s390x because it is not useful there
|
||||||
|
ExclusiveArch: x86_64
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{patches_touch_autotools}
|
%if 0%{patches_touch_autotools}
|
||||||
BuildRequires: autoconf, automake, libtool
|
BuildRequires: autoconf, automake, libtool
|
||||||
@ -38,7 +50,7 @@ BuildRequires: autoconf, automake, libtool
|
|||||||
BuildRequires: /usr/bin/pod2man
|
BuildRequires: /usr/bin/pod2man
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: ocaml >= 4.01
|
BuildRequires: ocaml >= 4.01
|
||||||
BuildRequires: libguestfs-devel >= 1:1.40
|
BuildRequires: libguestfs-devel >= 1:1.42
|
||||||
|
|
||||||
BuildRequires: augeas-devel
|
BuildRequires: augeas-devel
|
||||||
BuildRequires: bash-completion
|
BuildRequires: bash-completion
|
||||||
@ -47,7 +59,6 @@ BuildRequires: gettext-devel
|
|||||||
BuildRequires: jansson-devel
|
BuildRequires: jansson-devel
|
||||||
BuildRequires: libosinfo-devel
|
BuildRequires: libosinfo-devel
|
||||||
BuildRequires: libvirt-devel
|
BuildRequires: libvirt-devel
|
||||||
BuildRequires: libvirt-daemon-qemu
|
|
||||||
BuildRequires: libvirt-daemon-kvm
|
BuildRequires: libvirt-daemon-kvm
|
||||||
BuildRequires: libxml2-devel
|
BuildRequires: libxml2-devel
|
||||||
BuildRequires: pcre-devel
|
BuildRequires: pcre-devel
|
||||||
@ -67,8 +78,13 @@ BuildRequires: nbdkit-python-plugin
|
|||||||
BuildRequires: gnupg2
|
BuildRequires: gnupg2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Requires: libguestfs%{?_isa} >= 1:1.40
|
Requires: libguestfs%{?_isa} >= 1:1.42
|
||||||
Requires: libguestfs-tools-c >= 1:1.40
|
Requires: libguestfs-tools-c >= 1:1.42
|
||||||
|
|
||||||
|
%if 0%{?rhel}
|
||||||
|
# For Windows conversions on RHEL.
|
||||||
|
Requires: libguestfs-winsupport >= 7.2
|
||||||
|
%endif
|
||||||
|
|
||||||
Requires: gawk
|
Requires: gawk
|
||||||
Requires: gzip
|
Requires: gzip
|
||||||
@ -76,11 +92,21 @@ Requires: unzip
|
|||||||
Requires: curl
|
Requires: curl
|
||||||
Requires: /usr/bin/virsh
|
Requires: /usr/bin/virsh
|
||||||
|
|
||||||
Recommends: nbdkit
|
# Ensure the UEFI firmware is available, to properly convert
|
||||||
Recommends: nbdkit-curl-plugin
|
# EFI guests (RHBZ#1429643).
|
||||||
Recommends: nbdkit-python-plugin
|
%ifarch x86_64
|
||||||
Recommends: nbdkit-ssh-plugin
|
Requires: edk2-ovmf
|
||||||
Recommends: nbdkit-vddk-plugin
|
%endif
|
||||||
|
%ifarch aarch64
|
||||||
|
Requires: edk2-aarch64
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Needed for -it vddk, and -o rhv-upload.
|
||||||
|
Requires: nbdkit
|
||||||
|
Requires: nbdkit-curl-plugin
|
||||||
|
Requires: nbdkit-python-plugin
|
||||||
|
Requires: nbdkit-ssh-plugin
|
||||||
|
Requires: nbdkit-vddk-plugin
|
||||||
|
|
||||||
# For rhsrvany.exe, used to install firstboot scripts in Windows guests.
|
# For rhsrvany.exe, used to install firstboot scripts in Windows guests.
|
||||||
Requires: mingw32-srvany >= 1.0-13
|
Requires: mingw32-srvany >= 1.0-13
|
||||||
@ -132,14 +158,21 @@ for %{name}.
|
|||||||
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
||||||
%endif
|
%endif
|
||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%if 0%{patches_touch_autotools}
|
%if 0%{patches_touch_autotools}
|
||||||
autoreconf -i
|
autoreconf -i
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure
|
%configure \
|
||||||
make %{?_smp_mflags}
|
%if !0%{?rhel}
|
||||||
|
--with-extra="fedora=%{fedora},release=%{release}" \
|
||||||
|
%else
|
||||||
|
--with-extra="rhel=%{rhel},release=%{release}" \
|
||||||
|
%endif
|
||||||
|
|
||||||
|
make V=1 %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -155,9 +188,10 @@ pushd $RPM_BUILD_ROOT%{_datadir}/virt-tools
|
|||||||
ln -sf /usr/i686-w64-mingw32/sys-root/mingw/bin/rhsrvany.exe
|
ln -sf /usr/i686-w64-mingw32/sys-root/mingw/bin/rhsrvany.exe
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Delete the v2v test harness (except for the man page).
|
# Delete the v2v test harness.
|
||||||
rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/v2v_test_harness
|
rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/v2v_test_harness
|
||||||
rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness*
|
rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness*
|
||||||
|
rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-test-harness.1*
|
||||||
|
|
||||||
# Find locale files.
|
# Find locale files.
|
||||||
%find_lang %{name}
|
%find_lang %{name}
|
||||||
@ -193,7 +227,7 @@ rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness*
|
|||||||
|
|
||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
%license COPYING
|
%license COPYING
|
||||||
#doc README
|
%doc README
|
||||||
%{_bindir}/virt-v2v
|
%{_bindir}/virt-v2v
|
||||||
%{_bindir}/virt-v2v-copy-to-local
|
%{_bindir}/virt-v2v-copy-to-local
|
||||||
%{_mandir}/man1/virt-v2v.1*
|
%{_mandir}/man1/virt-v2v.1*
|
||||||
@ -206,7 +240,6 @@ rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness*
|
|||||||
%{_mandir}/man1/virt-v2v-output-rhv.1*
|
%{_mandir}/man1/virt-v2v-output-rhv.1*
|
||||||
%{_mandir}/man1/virt-v2v-release-notes-1.42.1*
|
%{_mandir}/man1/virt-v2v-release-notes-1.42.1*
|
||||||
%{_mandir}/man1/virt-v2v-support.1*
|
%{_mandir}/man1/virt-v2v-support.1*
|
||||||
%{_mandir}/man1/virt-v2v-test-harness.1*
|
|
||||||
%{_datadir}/virt-tools
|
%{_datadir}/virt-tools
|
||||||
|
|
||||||
|
|
||||||
@ -227,6 +260,9 @@ rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness*
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Dec 02 2020 Richard W.M. Jones <rjones@redhat.com> - 1:1.43.2-2
|
||||||
|
- Unify Fedora and RHEL spec files.
|
||||||
|
|
||||||
* Tue Dec 01 2020 Richard W.M. Jones <rjones@redhat.com> - 1:1.43.2-1
|
* Tue Dec 01 2020 Richard W.M. Jones <rjones@redhat.com> - 1:1.43.2-1
|
||||||
- New upstream version 1.43.2.
|
- New upstream version 1.43.2.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user