[libvirt] [PATCH] mingw: Require Fedora

Andrea Bolognani posted 1 patch 6 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180320104238.20255-1-abologna@redhat.com
Test syntax-check passed
mingw-libvirt.spec.in | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
[libvirt] [PATCH] mingw: Require Fedora
Posted by Andrea Bolognani 6 years ago
Although it was never formally specified, it was always expected
that the mingw RPM build would happen on Fedora, if anything
because RHEL / CentOS don't ship the necessary mingw dependencies.

Make this fact explicit by erroring out if that's not the case,
the same way we already do in the main spec file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 mingw-libvirt.spec.in | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index 5e12bb1cae..8f3f26d2d9 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -1,5 +1,16 @@
 %{?mingw_package_header}
 
+# This spec file assumes you are building on a Fedora version
+# that's still supported by the vendor. It may work on other distros
+# or versions, but no effort will be made to ensure that going forward.
+%define min_fedora 26
+
+%if 0%{?fedora} && 0%{?fedora} >= %{min_fedora}
+    %define supported_platform 1
+%else
+    %define supported_platform 0
+%endif
+
 # Default to skipping autoreconf.  Distros can change just this one line
 # (or provide a command-line override) if they backport any patches that
 # touch configure.ac or Makefile.am.
@@ -124,6 +135,11 @@ MinGW Windows libvirt virtualization library, static version.
 %setup -q -n libvirt-%{version}
 
 %build
+%if ! %{supported_platform}
+echo "This RPM requires Fedora >= %{min_fedora}"
+exit 1
+%endif
+
 %if ! %{with_phyp}
     %define _without_phyp --without-phyp
 %endif
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] mingw: Require Fedora
Posted by Daniel P. Berrangé 6 years ago
On Tue, Mar 20, 2018 at 11:42:38AM +0100, Andrea Bolognani wrote:
> Although it was never formally specified, it was always expected
> that the mingw RPM build would happen on Fedora, if anything
> because RHEL / CentOS don't ship the necessary mingw dependencies.
> 
> Make this fact explicit by erroring out if that's not the case,
> the same way we already do in the main spec file.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  mingw-libvirt.spec.in | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list