[Spice-devel] [vdagent-win PATCH] RFC spec: run tests during RPM build if possible
Christophe Fergeau
cfergeau at redhat.com
Fri Jul 21 09:10:48 UTC 2017
On Fri, Jul 21, 2017 at 09:54:10AM +0100, Frediano Ziglio wrote:
> Currently to fully run checks we need Wine for both 32 and 64 bit.
> Some distros (like RHEL 7) don't seem to allow installing
> both 32 and 64 bit versions so turn on checks based on distro
> versions.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> mingw-spice-vdagent.spec.in | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/mingw-spice-vdagent.spec.in b/mingw-spice-vdagent.spec.in
> index f874e66..19358d4 100644
> --- a/mingw-spice-vdagent.spec.in
> +++ b/mingw-spice-vdagent.spec.in
> @@ -2,6 +2,19 @@
>
> #define _version_suffix -e198
>
> +%if "%{_build_arch}" == "x86_64" && (0%{?fedora} && 0%{?fedora} >= 24)
> + %define can_do_check 1
> + %define can_do_check_x86 1
> +%else
> +%if "%{_build_arch}" == "x86_64" && (0%{?epel} && 0%{?epel} >= 7)
> + %define can_do_check 1
> + %define can_do_check_x86 0
> +%else
> + %define can_do_check 0
> + %define can_do_check_x86 0
> +%endif
> +%endif
> +
> Name: mingw-spice-vdagent
> Version: @VERSION@
> Release: 1%{?dist}%{?extra_release}
> @@ -22,6 +35,12 @@ BuildRequires: mingw64-zlib-static
> BuildRequires: mingw32-winpthreads-static
> BuildRequires: mingw64-winpthreads-static
> BuildRequires: pkgconfig
> +%if %{can_do_check}
> +BuildRequires: ImageMagick wine-core(x86-64)
> +%endif
> +%if %{can_do_check_x86}
> +BuildRequires: wine-core(x86-32)
> +%endif
>
> BuildArch: noarch
>
> @@ -73,6 +92,12 @@ Features:
> %mingw_configure --enable-debug
> %mingw_make %{?_smp_mflags} V=1
>
> +%if %{can_do_check}
> +%check
> +%define mingw_build_win32 %{can_do_check_x86}
> +%mingw_make check
> +%define mingw_build_win32 1
> +%endif
I believe you can make this all symmetric:
+%if %{can_do_check_x86_64}
+BuildRequires: ImageMagick wine-core(x86-64)
+%endif
+%if %{can_do_check_x86}
+BuildRequires: ImageMagick wine-core(x86-32)
+%endif
+%check
+%define mingw_build_win64 %{can_do_check_x86_64}
+%define mingw_build_win32 %{can_do_check_x86}
+%mingw_make check
+%define mingw_build_win32 1
+%define mingw_build_win64 1
+%endif
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170721/e94f8322/attachment-0001.sig>
More information about the Spice-devel
mailing list