Add a new install function that abstracts away the repetitive task of
installing fonts into PKGDIR.

Signed-off-by: Florian Bäuerle <[email protected]>
---
 rules/post/ptxd_make_world_fonts.make | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 rules/post/ptxd_make_world_fonts.make

diff --git a/rules/post/ptxd_make_world_fonts.make 
b/rules/post/ptxd_make_world_fonts.make
new file mode 100644
index 000000000..1713ebbe0
--- /dev/null
+++ b/rules/post/ptxd_make_world_fonts.make
@@ -0,0 +1,30 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 Florian Bäuerle <[email protected]>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+world/install-fonts = \
+       DIR=$($(strip $(1)_DIR)); \
+       PKGDIR=$($(strip $(1)_PKGDIR)); \
+       PKGFONTDIR=$${PKGDIR}$($(strip $(1)_FONTDIR)); \
+       FILTER=$(strip $(2)); \
+       rm -rf $($(1)_PKGDIR); \
+       mkdir -p $${PKGFONTDIR}; \
+       find $${DIR} -name "$${FILTER}" | \
+               while read file; do \
+                       install -m 644 $${file} $${PKGFONTDIR}; \
+                       if [ "$(PTXCONF_XORG_FONTS_QT4_LINKS)" = "y" ]; then \
+                               name=$$(basename $${file}); \
+                               mkdir -p $${PKGDIR}/usr/lib/fonts; \
+                               ln -s ../../..$${PKGFONTDIR}/$${name} 
$${PKGDIR}/usr/lib/fonts/$${name}; \
+                       fi; \
+               done; \
+       mkfontdir $${PKGFONTDIR}; \
+       mkfontscale $${PKGFONTDIR}
+
+# vim: syntax=make
-- 
2.19.0


_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to