[PATCH misc-ethiopic] install: Test if font directory is set before calling mkfont[dir/scale]

Egbert Eich eich at freedesktop.org
Mon Jul 29 03:32:15 PDT 2013


This package contains two font versions: TrueType and OpenType.
One may want to install only one of them by specifying an empty
font directory for the other one: ie by adding '--with-<fonttype>-fontdir='
to configure.

The macro-defined installation rules already check if the directory
variable is set before copying files.
Do so also when (re)generating the font.scale files.

Signed-off-by: Egbert Eich <eich at freedesktop.org>
---
 Makefile.am | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1903423..2144367 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,14 +33,18 @@ EXTRA_DIST = $(ttffont_DATA) $(otffont_DATA) license.txt
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
 install-data-hook:
-	@rm -f $(DESTDIR)$(ttffontdir)/fonts.scale
-	$(MKFONTSCALE) $(DESTDIR)$(ttffontdir)
-	@rm -f $(DESTDIR)$(ttffontdir)/font.dir
-	$(MKFONTDIR) $(DESTDIR)$(ttffontdir)
-	@rm -f $(DESTDIR)$(otffontdir)/fonts.scale
-	$(MKFONTSCALE) $(DESTDIR)$(otffontdir)
-	@rm -f $(DESTDIR)$(otffontdir)/font.dir
-	$(MKFONTDIR) $(DESTDIR)$(otffontdir)
+	@if test -n "$(ttffontdir)"; then \
+		rm -f $(DESTDIR)$(ttffontdir)/fonts.scale; \
+		$(MKFONTSCALE) $(DESTDIR)$(ttffontdir); \
+		rm -f $(DESTDIR)$(ttffontdir)/font.dir; \
+		$(MKFONTDIR) $(DESTDIR)$(ttffontdir); \
+	fi
+	@if test -n "$(otffontdir)"; then \
+		rm -f $(DESTDIR)$(otffontdir)/fonts.scale; \
+		$(MKFONTSCALE) $(DESTDIR)$(otffontdir); \
+		rm -f $(DESTDIR)$(otffontdir)/font.dir; \
+		$(MKFONTDIR) $(DESTDIR)$(otffontdir); \
+	fi
 	@RUN_FCCACHE@
 
 distuninstallcheck:
-- 
1.8.1.4



More information about the xorg-devel mailing list