[Kimchi-devel] [PATCH V2] add an option do not build fonts files in rpm packages

Sheldon shaohef at linux.vnet.ibm.com
Fri Jul 11 13:40:31 UTC 2014


test this patch:
$ ./autogen.sh
install the rpm and check the front files are not installed.

$ ./autogen.sh --enable-fonts
nstall the rpm and check the front files should be installed.

On 07/11/2014 09:38 PM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> ui/css/fonts/novnc/Makefile and ui/css/fonts/Makefile
> will not install fonts when build fonts are disabled.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
> ---
>   Makefile.am                    |  6 +++++-
>   configure.ac                   | 12 ++++++++++++
>   contrib/kimchi.spec.fedora.in  |  4 +++-
>   ui/css/fonts/Makefile.am       |  4 ++++
>   ui/css/fonts/novnc/Makefile.am |  4 ++++
>   5 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 9785de9..e6ff673 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -19,6 +19,10 @@
>
>   SUBDIRS = src ui docs contrib tests po config plugins
>
> +if FONTS
> +WITH_FONTS = --define="with_fonts 1"
> +endif
> +
>   ACLOCAL_AMFLAGS = --install -I m4
>
>   EXTRA_DIST = \
> @@ -134,7 +138,7 @@ rpm: dist kimchi.spec
>   	$(MKDIR_P) rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS
>   	cp $(top_srcdir)/kimchi.spec rpm/SPECS/kimchi.spec
>   	cp $(DIST_ARCHIVES) rpm/SOURCES
> -	rpmbuild -ba --define "_topdir `pwd`/rpm" rpm/SPECS/kimchi.spec
> +	rpmbuild -ba $(WITH_FONTS) --define "_topdir `pwd`/rpm" rpm/SPECS/kimchi.spec
>
>   fedora-rpm: contrib/kimchi.spec.fedora
>   	ln -sf contrib/kimchi.spec.fedora kimchi.spec
> diff --git a/configure.ac b/configure.ac
> index e5e6441..43cf35f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -64,6 +64,18 @@ else
>   AC_SUBST([ENABLE_SAMPLE], [False])
>   fi
>
> +AC_ARG_ENABLE(
> +    [fonts],
> +    [AS_HELP_STRING(
> +        [--enable-fonts],
> +        [Build fonts files in package @<:@default=no@:>@]
> +    )],
> +    ,
> +    [enable_fonts="no"]
> +)
> +
> +AM_CONDITIONAL([FONTS], [test "${enable_fonts}" = "yes"])
> +
>   AC_CONFIG_FILES([
>       po/Makefile.in
>       po/gen-pot
> diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
> index 993fd6f..4e863f5 100644
> --- a/contrib/kimchi.spec.fedora.in
> +++ b/contrib/kimchi.spec.fedora.in
> @@ -61,7 +61,7 @@ Web server application to manage KVM/Qemu virtual machines
>
>
>   %build
> -%configure
> +%configure %{?with_fonts:--enable-fonts}
>   make
>
>
> @@ -154,8 +154,10 @@ rm -rf $RPM_BUILD_ROOT
>   %{_datadir}/kimchi/doc/kimchi-templates.png
>   %{_datadir}/kimchi/mo/*/LC_MESSAGES/kimchi.mo
>   %{_datadir}/kimchi/config/ui/*.xml
> +%if 0%{?with_fonts}
>   %{_datadir}/kimchi/ui/css/fonts/fontawesome-webfont.*
>   %{_datadir}/kimchi/ui/css/fonts/novnc/Orbitron700.*
> +%endif
>   %{_datadir}/kimchi/ui/css/novnc/base.css
>   %{_datadir}/kimchi/ui/css/theme-default.min.css
>   %{_datadir}/kimchi/ui/images/*.png
> diff --git a/ui/css/fonts/Makefile.am b/ui/css/fonts/Makefile.am
> index 63df038..1de082f 100644
> --- a/ui/css/fonts/Makefile.am
> +++ b/ui/css/fonts/Makefile.am
> @@ -19,4 +19,8 @@ SUBDIRS = novnc
>
>   fontdir = $(datadir)/kimchi/ui/css/fonts
>
> +if FONTS
>   dist_font_DATA = fontawesome-webfont.*
> +else
> +dist_noinst_DATA = fontawesome-webfont.*
> +endif
> diff --git a/ui/css/fonts/novnc/Makefile.am b/ui/css/fonts/novnc/Makefile.am
> index 50f6050..31c428e 100644
> --- a/ui/css/fonts/novnc/Makefile.am
> +++ b/ui/css/fonts/novnc/Makefile.am
> @@ -17,4 +17,8 @@
>
>   fontdir = $(datadir)/kimchi/ui/css/fonts/novnc
>
> +if FONTS
>   dist_font_DATA = Orbitron700.*
> +else
> +dist_noinst_DATA = Orbitron700.*
> +endif


-- 
Thanks and best regards!

Sheldon Feng(冯少合)<shaohef at linux.vnet.ibm.com>
IBM Linux Technology Center




More information about the Kimchi-devel mailing list