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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Jun 23 22:04:47 2004 UTC (9 years, 9 months ago) by mr_bones_
Branch: MAIN
Changes since 1.3: +4 -7 lines
Fix use invocation; dodoc takes a list of files

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

  ViewVC Help
Powered by ViewVC 1.1.20