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 <[email protected]>
---
 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

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to