[Kimchi-devel] [PATCH 3/6] Add new spice-html5 code to Kimchi build process

Aline Manera alinefm at linux.vnet.ibm.com
Mon Oct 13 17:38:58 UTC 2014


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 at 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?


>>   else
>>      if [ $# -gt 0 ]; then
>>           ./configure $@
>> diff --git a/configure.ac b/configure.ac
>> index 3f6f008..a69406b 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -64,6 +64,15 @@ else
>>   AC_SUBST([ENABLE_SAMPLE], [False])
>>   fi
>>
>> +AC_ARG_WITH(
>> +    [spice-html5],
>> +    [AS_HELP_STRING([--with-spice-html5],
>> +                    [Build Kimchi with spice-html5 @<:@default=no@:>@])],
>> +    ,
>> +    [with_spice_html5="no"]
>> +)
>> +AM_CONDITIONAL([WITH_SPICE], [test "x$with_spice_html5" = xyes])
>> +
>>   AC_CONFIG_FILES([
>>       po/Makefile.in
>>       po/gen-pot
>> @@ -90,6 +99,10 @@ AC_CONFIG_FILES([
>>       ui/images/theme-default/Makefile
>>       ui/js/Makefile
>>       ui/js/spice/Makefile
>> +    ui/spice-html5/Makefile
>> +    ui/spice-html5/css/Makefile
>> +    ui/spice-html5/pages/Makefile
>> +    ui/spice-html5/thirdparty/Makefile
>>       ui/libs/Makefile
>>       ui/libs/themes/Makefile
>>       ui/libs/themes/base/Makefile
>> diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
>> index 2ca3076..29583e4 100644
>> --- a/contrib/kimchi.spec.fedora.in
>> +++ b/contrib/kimchi.spec.fedora.in
>> @@ -160,27 +160,7 @@ rm -rf $RPM_BUILD_ROOT
>>   %{_datadir}/kimchi/doc/kimchi-templates.png
>>   %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
>>   %{_datadir}/kimchi/config/ui/*.xml
>> -%{_datadir}/kimchi/ui/css/spice/spice.css
>> -%{_datadir}/kimchi/ui/css/theme-default.min.css
>> -%{_datadir}/kimchi/ui/images/*.png
>> -%{_datadir}/kimchi/ui/images/*.ico
>> -%{_datadir}/kimchi/ui/images/theme-default/*.png
>> -%{_datadir}/kimchi/ui/images/theme-default/*.gif
>> -%{_datadir}/kimchi/ui/js/kimchi.min.js
>> -%{_datadir}/kimchi/ui/js/modernizr.custom.2.6.2.min.js
>> -%{_datadir}/kimchi/ui/js/spice/*.js
>> -%{_datadir}/kimchi/ui/libs/jquery-ui-i18n.min.js
>> -%{_datadir}/kimchi/ui/libs/jquery-ui.min.js
>> -%{_datadir}/kimchi/ui/libs/jquery-1.10.0.min.js
>> -%{_datadir}/kimchi/ui/libs/modernizr.custom.76777.js
>> -%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
>> -%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
>> -%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
>> -%{_datadir}/kimchi/ui/pages/*.tmpl
>> -%{_datadir}/kimchi/ui/pages/help/*/*.html
>> -%{_datadir}/kimchi/ui/pages/help/kimchi.css
>> -%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
>> -%{_datadir}/kimchi/ui/pages/websockify/*.html
>> +%{_datadir}/kimchi/ui/*
>>   %{_sysconfdir}/kimchi/kimchi.conf
>>   %{_sysconfdir}/kimchi/nginx.conf.in
>>   %{_sysconfdir}/kimchi/distros.d/debian.json
>> diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
>> index 9ea240c..2936787 100644
>> --- a/contrib/kimchi.spec.suse.in
>> +++ b/contrib/kimchi.spec.suse.in
>> @@ -81,27 +81,7 @@ rm -rf $RPM_BUILD_ROOT
>>   %{_datadir}/kimchi/doc/kimchi-templates.png
>>   %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
>>   %{_datadir}/kimchi/config/ui/*.xml
>> -%{_datadir}/kimchi/ui/css/spice/spice.css
>> -%{_datadir}/kimchi/ui/css/theme-default.min.css
>> -%{_datadir}/kimchi/ui/images/*.png
>> -%{_datadir}/kimchi/ui/images/*.ico
>> -%{_datadir}/kimchi/ui/images/theme-default/*.png
>> -%{_datadir}/kimchi/ui/images/theme-default/*.gif
>> -%{_datadir}/kimchi/ui/js/kimchi.min.js
>> -%{_datadir}/kimchi/ui/js/modernizr.custom.2.6.2.min.js
>> -%{_datadir}/kimchi/ui/js/spice/*.js
>> -%{_datadir}/kimchi/ui/libs/jquery-ui-i18n.min.js
>> -%{_datadir}/kimchi/ui/libs/jquery-ui.min.js
>> -%{_datadir}/kimchi/ui/libs/jquery-1.10.0.min.js
>> -%{_datadir}/kimchi/ui/libs/modernizr.custom.76777.js
>> -%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
>> -%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
>> -%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
>> -%{_datadir}/kimchi/ui/pages/*.tmpl
>> -%{_datadir}/kimchi/ui/pages/help/*/*.html
>> -%{_datadir}/kimchi/ui/pages/help/kimchi.css
>> -%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
>> -%{_datadir}/kimchi/ui/pages/websockify/*.html
>> +%{_datadir}/kimchi/ui/*
> It seems "ui/*" and "ui" is the same.

ACK

>
>>   %{_sysconfdir}/kimchi/kimchi.conf
>>   %{_sysconfdir}/kimchi/nginx.conf.in
>>   %{_sysconfdir}/kimchi/distros.d/debian.json
>> diff --git a/ui/Makefile.am b/ui/Makefile.am
>> index b5366c5..5192162 100644
>> --- a/ui/Makefile.am
>> +++ b/ui/Makefile.am
>> @@ -15,4 +15,4 @@
>>   # See the License for the specific language governing permissions and
>>   # limitations under the License.
>>
>> -SUBDIRS = css images js libs pages
>> +SUBDIRS = css images js libs pages spice-html5
>> diff --git a/ui/spice-html5/Makefile.am b/ui/spice-html5/Makefile.am
>> new file mode 100644
>> index 0000000..3a6558a
>> --- /dev/null
>> +++ b/ui/spice-html5/Makefile.am
>> @@ -0,0 +1,25 @@
>> +#
>> +# Kimchi
>> +#
>> +# Copyright IBM, Corp. 2014
>> +#
>> +# Licensed under the Apache License, Version 2.0 (the "License");
>> +# you may not use this file except in compliance with the License.
>> +# You may obtain a copy of the License at
>> +#
>> +#     http://www.apache.org/licenses/LICENSE-2.0
>> +#
>> +# Unless required by applicable law or agreed to in writing, software
>> +# distributed under the License is distributed on an "AS IS" BASIS,
>> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>> +# See the License for the specific language governing permissions and
>> +# limitations under the License.
>> +
>> +SUBDIRS = pages
>> +
>> +if WITH_SPICE
>> +SUBDIRS += css thirdparty
>> +
>> +spicehtml5dir = $(datadir)/kimchi/ui/spice-html5
>> +dist_spicehtml5_DATA = $(wildcard *.js) $(NULL)
>> +endif
>> diff --git a/ui/spice-html5/css/Makefile.am b/ui/spice-html5/css/Makefile.am
>> new file mode 100644
>> index 0000000..6106e0d
>> --- /dev/null
>> +++ b/ui/spice-html5/css/Makefile.am
>> @@ -0,0 +1,20 @@
>> +#
>> +# Kimchi
>> +#
>> +# Copyright IBM, Corp. 2014
>> +#
>> +# Licensed under the Apache License, Version 2.0 (the "License");
>> +# you may not use this file except in compliance with the License.
>> +# You may obtain a copy of the License at
>> +#
>> +#     http://www.apache.org/licenses/LICENSE-2.0
>> +#
>> +# Unless required by applicable law or agreed to in writing, software
>> +# distributed under the License is distributed on an "AS IS" BASIS,
>> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>> +# See the License for the specific language governing permissions and
>> +# limitations under the License.
>> +
>> +spicecssdir = $(datadir)/kimchi/ui/spice-html5
>> +
>> +dist_spicecss_DATA = $(wildcard *.css) $(NULL)
>> diff --git a/ui/spice-html5/pages/Makefile.am b/ui/spice-html5/pages/Makefile.am
>> new file mode 100644
>> index 0000000..45e67a5
>> --- /dev/null
>> +++ b/ui/spice-html5/pages/Makefile.am
>> @@ -0,0 +1,20 @@
>> +#
>> +# Kimchi
>> +#
>> +# Copyright IBM, Corp. 2014
>> +#
>> +# Licensed under the Apache License, Version 2.0 (the "License");
>> +# you may not use this file except in compliance with the License.
>> +# You may obtain a copy of the License at
>> +#
>> +#     http://www.apache.org/licenses/LICENSE-2.0
>> +#
>> +# Unless required by applicable law or agreed to in writing, software
>> +# distributed under the License is distributed on an "AS IS" BASIS,
>> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>> +# See the License for the specific language governing permissions and
>> +# limitations under the License.
>> +
>> +spicepagesdir = $(datadir)/kimchi/ui/spice-html5/pages
>> +
>> +dist_spicepages_DATA = $(wildcard *.html) $(NULL)
>> diff --git a/ui/spice-html5/thirdparty/Makefile.am b/ui/spice-html5/thirdparty/Makefile.am
>> new file mode 100644
>> index 0000000..b83a585
>> --- /dev/null
>> +++ b/ui/spice-html5/thirdparty/Makefile.am
>> @@ -0,0 +1,20 @@
>> +#
>> +# Kimchi
>> +#
>> +# Copyright IBM, Corp. 2014
>> +#
>> +# Licensed under the Apache License, Version 2.0 (the "License");
>> +# you may not use this file except in compliance with the License.
>> +# You may obtain a copy of the License at
>> +#
>> +#     http://www.apache.org/licenses/LICENSE-2.0
>> +#
>> +# Unless required by applicable law or agreed to in writing, software
>> +# distributed under the License is distributed on an "AS IS" BASIS,
>> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>> +# See the License for the specific language governing permissions and
>> +# limitations under the License.
>> +
>> +thirdpartydir = $(datadir)/kimchi/ui/spice-html5/thirdparty
>> +
>> +dist_thirdparty_DATA = $(wildcard *.js) $(NULL)
>>
>




More information about the Kimchi-devel mailing list