On 10/14/2014 12:04 AM, Zhou Zheng Sheng wrote:
on 2014/10/14 01:38, Aline Manera wrote:
> On 10/13/2014 05:40 AM, Zhou Zheng Sheng wrote:
>> on 2014/10/11 05:16, Aline Manera wrote:
>>> By default Kimchi will not install the new spice-html5 code as
>>> almost all the supported Linux distributions already has it available
>>> in a
>>> package.
>>> If the system you are running Kimchi does not have a spice-html5, you
>>> can run: ./autogen.sh --with-spice-html5 to get it.
>>>
>>> Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
>>> ---
>>> autogen.sh | 2 ++
>>> configure.ac | 13 +++++++++++++
>>> contrib/kimchi.spec.fedora.in | 22 +---------------------
>>> contrib/kimchi.spec.suse.in | 22 +---------------------
>>> ui/Makefile.am | 2 +-
>>> ui/spice-html5/Makefile.am | 25 +++++++++++++++++++++++++
>>> ui/spice-html5/css/Makefile.am | 20 ++++++++++++++++++++
>>> ui/spice-html5/pages/Makefile.am | 20 ++++++++++++++++++++
>>> ui/spice-html5/thirdparty/Makefile.am | 20 ++++++++++++++++++++
>>> 9 files changed, 103 insertions(+), 43 deletions(-)
>>> create mode 100644 ui/spice-html5/Makefile.am
>>> create mode 100644 ui/spice-html5/css/Makefile.am
>>> create mode 100644 ui/spice-html5/pages/Makefile.am
>>> create mode 100644 ui/spice-html5/thirdparty/Makefile.am
>>>
>>> diff --git a/autogen.sh b/autogen.sh
>>> index 0f22dba..952b45e 100755
>>> --- a/autogen.sh
>>> +++ b/autogen.sh
>>> @@ -12,6 +12,8 @@ fi
>>>
>>> if [ "x$1" == "x--system" ]; then
>>> ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
>>> +elif [ "x$1" == "x--with-spice-html5" ]; then
>>> + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
>>> --with-spice-html5
>> It seems "--system" does not conflict with
"--with-spice-html5", this
>> two options are orthogonal. Maybe just the following is enough.
>>
>> if [ "x$1" == "x--system" ]; then
>> ./configure ... "$@"
>>
>> For example, when a RHEL7 developer wants to run Kimchi from source
>> code, he may want to use "./autogen.sh --with-spice-html5".
> It points to me a bug as config.py.in depends on %(datadir) for
> novnc/spice code and it may vary according to %(prefix) value but the
> novnc/spice are always installed under /usr/share
>
> For example, if I follow your suggestion Kimchi will setup
> /usr/local/share/novnc as the novnc directory which is wrong as novnc is
> installed under /usr/share/novnc
> So I need to ensure the prefix is /usr to use %(datadir) on config.py.in
>
> Should I hardcode the path to novnc/spice
> (/usr/share/<novnc/spice-html5>) when they are installed to avoid that
> problem?
> Or make autogen.sh always pass --prefix=/usr? What about if user pass a
> different prefix by command line?
>
I notice this problem as well when I tried "./autogen.sh", the
%{datadir} points to /usr/local/share, which does not contain novnc and
spice-html5.
I think of a solution. Now in "config.py".in, when "__with_spice" is
not
"yes", we set "self.spice_dir = '@datadir@/spice-html5'". To
avoid using
a wrong dir, we can firstly check if '@datadir@/spice-html5' exists, if
yes, use it; otherwise, set "self.spice_dir =
'/usr/share/spice-html5'".
Using AC_CHECK_FILE in "configure.ac" can do the similar thing, but it's
just checking the system where Kimchi was built. Placing the judgment it
in Python code, we can check it in the running system.
ACK. I will do it in V2.
Thanks!