/[gentoo-x86]/eclass/font.eclass
Gentoo

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Oct 3 13:00:32 2004 UTC (9 years, 10 months ago) by usata
Branch: MAIN
Changes since 1.7: +10 -10 lines
Added a patch to fix an error with files or directories containing spaces in their names. Thanks to gna <gnagent2@yahoo.com.au>; bug #66206.

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.7 2004/09/15 23:10:21 kugelfang Exp $
4
5 # Author: foser <foser@gentoo.org>
6
7 # Font Eclass
8 #
9 # Eclass to make font installation more uniform
10
11 inherit eutils
12
13 ECLASS="font"
14 INHERITED="$INHERITED $ECLASS"
15
16 #
17 # Variable declarations
18 #
19
20 FONT_SUFFIX="" # Space delimited list of font suffixes to install
21
22 FONT_S="${S}" # Dir containing the fonts
23
24 DOCS="" # Docs to install
25
26 IUSE="${IUSE} X"
27
28 DEPEND="${DEPEND} \
29 X? ( virtual/x11 ) \
30 media-libs/fontconfig"
31
32 #
33 # Public functions
34 #
35
36 font_xfont_config() {
37
38 # create Xfont files
39 if use X ;
40 then
41 einfo "Creating fonts.scale & fonts.dir..."
42 mkfontscale "${D}/usr/share/fonts/${PN}"
43 mkfontdir \
44 -e /usr/share/fonts/encodings \
45 -e /usr/share/fonts/encodings/large \
46 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
47 "${D}/usr/share/fonts/${PN}"
48 if [ -e "${FONT_S}/fonts.alias" ] ;
49 then
50 doins "${FONT_S}/fonts.alias"
51 fi
52 fi
53
54 }
55
56 font_xft_config() {
57
58 # create fontconfig cache
59 einfo "Creating fontconfig cache..."
60 HOME="/root" /usr/bin/fc-cache -f "${D}/usr/share/fonts/${PN}"
61
62 }
63
64 #
65 # Public inheritable functions
66 #
67
68 font_src_install() {
69
70 local suffix
71
72 cd "${FONT_S}"
73
74 insinto "/usr/share/fonts/${PN}"
75
76 for suffix in ${FONT_SUFFIX}; do
77 doins *.${suffix}
78 done
79
80 rm -f fonts.{dir,scale} encodings.dir
81
82 font_xfont_config
83 font_xft_config
84
85 cd "${S}"
86 # try to install some common docs
87 DOCS="${DOCS} COPYRIGHT README NEWS"
88 for f in ${DOCS}; do
89 [[ -e "${f}" ]] && dodoc "${f}"
90 done
91 }
92
93 EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20