[Kimchi-devel] [PATCH 2/2] Add option to add/remove fonts files in rpm packages

alinefm at linux.vnet.ibm.com alinefm at linux.vnet.ibm.com
Fri Jul 11 22:49:16 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

By default font files will be added.
To disable it, run "./autogen.sh --disable-fonts"

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Signed-off-by: Leonardo Garcia <lagarcia at br.ibm.com>
---
 Makefile.am                   |  8 +++++++-
 configure.ac                  | 12 ++++++++++++
 contrib/kimchi.spec.fedora.in | 18 ++++++++++++++----
 contrib/kimchi.spec.suse.in   | 10 ++++++++++
 ui/css/Makefile.am            |  6 +++++-
 ui/css/fonts/Makefile.am      |  2 +-
 6 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9785de9..44c2515 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,12 @@
 
 SUBDIRS = src ui docs contrib tests po config plugins
 
+if FONTS
+DEFINE_FONTS = --define "with_fonts 1"
+else
+DEFINE_FONTS = --define "with_fonts 0"
+endif
+
 ACLOCAL_AMFLAGS = --install -I m4
 
 EXTRA_DIST = \
@@ -134,7 +140,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 $(DEFINE_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..a260f7d 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=yes@:>@]
+    )],
+    ,
+    [enable_fonts="yes"]
+)
+
+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 f15efb8..ca3f7e1 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -1,7 +1,3 @@
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-%global with_systemd 1
-%endif
-
 Name:		kimchi
 Version:	@PACKAGE_VERSION@
 Release:	@PACKAGE_RELEASE@%{?dist}
@@ -34,6 +30,14 @@ Requires:	policycoreutils-python
 BuildRequires:	libxslt
 BuildRequires:	libxml2-python
 
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%global with_systemd 1
+%endif
+
+%if %{undefined with_fonts}
+%define with_fonts 1
+%endif
+
 %if 0%{?rhel} == 6
 Requires:	python-ordereddict
 Requires:	python-imaging
@@ -61,7 +65,11 @@ Web server application to manage KVM/Qemu virtual machines
 
 
 %build
+%if %{with_fonts} == 0
+%configure --disable-fonts
+%else
 %configure
+%endif
 make
 
 
@@ -154,7 +162,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/kimchi/doc/kimchi-templates.png
 %{_datadir}/kimchi/mo/*/LC_MESSAGES/kimchi.mo
 %{_datadir}/kimchi/config/ui/*.xml
+%if %{with_fonts} == 1
 %{_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/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 3955211..73304c2 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -33,6 +33,10 @@ BuildRequires:	python-libxml2
 Requires:       python-ordereddict
 %endif
 
+%if %{undefined with_fonts}
+%define with_fonts 1
+%endif
+
 %description
 Web server application to manage KVM/Qemu virtual machines
 
@@ -40,7 +44,11 @@ Web server application to manage KVM/Qemu virtual machines
 %setup
 
 %build
+%if %{with_fonts} == 0
+%configure --disable-fonts
+%else
 %configure
+%endif
 make
 
 %install
@@ -75,7 +83,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/kimchi/doc/kimchi-templates.png
 %{_datadir}/kimchi/mo/*/LC_MESSAGES/kimchi.mo
 %{_datadir}/kimchi/config/ui/*.xml
+%if %{with_fonts} == 1
 %{_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/Makefile.am b/ui/css/Makefile.am
index db65799..9a2a29f 100644
--- a/ui/css/Makefile.am
+++ b/ui/css/Makefile.am
@@ -15,7 +15,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SUBDIRS = novnc fonts
+SUBDIRS = novnc
+
+if FONTS
+SUBDIRS += fonts
+endif
 
 EXTRA_DIST = theme-default
 
diff --git a/ui/css/fonts/Makefile.am b/ui/css/fonts/Makefile.am
index 0dc9d5e..1687952 100644
--- a/ui/css/fonts/Makefile.am
+++ b/ui/css/fonts/Makefile.am
@@ -15,4 +15,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SUBDIRS = novnc
\ No newline at end of file
+SUBDIRS = novnc
-- 
1.9.3




More information about the Kimchi-devel mailing list