On 10/13/2014 06:06 AM, Zhou Zheng Sheng wrote:
on 2014/10/11 05:16, Aline Manera wrote:
> spice-html5 is present in almost all supported Linux distributions
> (RHEL6.5, Fedora20 and Ubuntu 14.04). So in those cases we should not package
> the spice-html5 code into Kimchi and instead of that uses the spice-html5 package
> as dependency.
>
> This patch change the build process to check the spice-html5 package
> availability in order to decide to package or not the spice-html5 code.
>
> spice-html5 package is not available for RHEL7 and openSUSE 13.1. So
> for those distributions, you must run the following command to Kimchi
> includes the spice-html5 into its package.
>
> ./autogen.sh --with-spice-html5
>
> Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
> ---
> contrib/DEBIAN/control.in | 3 ++-
> contrib/kimchi.spec.fedora.in | 8 ++++++++
> contrib/kimchi.spec.suse.in | 2 +-
> docs/README.md | 10 +++++++++-
> src/kimchi/Makefile.am | 11 +++++++++--
> src/kimchi/config.py.in | 33 ++++++++++++++++++++++++++-------
> tests/test_config.py.in | 15 ++++++++++++++-
> ui/js/src/kimchi.api.js | 2 +-
> 8 files changed, 70 insertions(+), 14 deletions(-)
>
> diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
> index 7372a58..08ef72d 100644
> --- a/contrib/DEBIAN/control.in
> +++ b/contrib/DEBIAN/control.in
> @@ -27,7 +27,8 @@ Depends: python-cherrypy3 (>= 3.2.0),
> firewalld,
> nginx,
> python-guestfs,
> - libguestfs-tools
> + libguestfs-tools,
> + spice-html5
> Build-Depends: libxslt,
> python-libxml2,
> python-requests
> diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
> index 29583e4..8c3c264 100644
> --- a/contrib/kimchi.spec.fedora.in
> +++ b/contrib/kimchi.spec.fedora.in
> @@ -35,6 +35,10 @@ BuildRequires: libxslt
> BuildRequires: libxml2-python
> BuildRequires: python-requests
>
> +%if 0%{?rhel} == 6 || 0%{?fedora} >= 19
> +Requires: spice-html5
> +%endif
> +
> %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
> %global with_systemd 1
> %endif
> @@ -66,7 +70,11 @@ Web server application to manage KVM/Qemu virtual machines
>
>
> %build
> +%if 0%{?rhel} != 6 || 0%{?fedora} < 19
> +%configure --with-spice-html5
It seems this condition is wrong. Suppose I'm on Fedora 20, then
"0%{?rhel}" would be 0, so "0 != 6", then it would use
"%configure
--with-spice-html5"
Considering the following is correct,
%if 0%{?rhel} == 6 || 0%{?fedora} >= 19
Requires: spice-html5
%endif,
according to De Morgan's laws, to express the opposite condition for
using "--with-spice-html5",
maybe we should change
0%{?rhel} != 6 || 0%{?fedora} < 19
to
0%{?rhel} != 6 && 0%{?fedora} < 19
?
Yeap! Thanks for it!
You could also use the same condition on both places.
%if 0%{?rhel} == 6 || 0%{?fedora} >= 19
Requires: spice-html5
%endif
%if 0%{?rhel} == 6 || 0%{?fedora} >= 19
%configure
%else
%configure --with-spice-html5
%endif
I will update on V2.