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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Jun 21 09:17:54 2004 UTC (10 years, 4 months ago) by usata
Branch: MAIN
Changes since 1.2: +5 -2 lines
Install fonts.alias only if fonts.alias is found

1 foser 1.1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2     # Distributed under the terms of the GNU General Public License v2
3 usata 1.3 # $Header: /home/cvsroot/gentoo-x86/eclass/font.eclass,v 1.2 2004/05/31 14:59:26 foser Exp $
4 foser 1.1
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 foser 1.2 FONT_S="${S}" # Dir containing the fonts
21    
22 foser 1.1 DOCS="" # Docs to install
23    
24     IUSE="${IUSE} X"
25    
26     DEPEND="${DEPEND} \
27     X? ( virtual/x11 ) \
28     media-libs/fontconfig"
29    
30 foser 1.2 #
31     # Public functions
32 foser 1.1 #
33    
34 foser 1.2 font_xfont_config() {
35 foser 1.1
36     # create Xfont files
37     if [ -n "`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 foser 1.2 -e /usr/X11R6/lib/X11/fonts/encodings \
45     ${D}/usr/share/fonts/${PN}
46 usata 1.3 if [ -e ${FONT_S}/fonts.alias ] ;
47     then
48     doins ${FONT_S}/fonts.alias
49     fi
50 foser 1.1 fi
51    
52 foser 1.2 }
53    
54     font_xft_config() {
55    
56 foser 1.1 # create fontconfig cache
57     einfo "Creating fontconfig cache..."
58     HOME="/root" /usr/bin/fc-cache -f ${D}/usr/share/fonts/${PN}
59    
60 foser 1.2 }
61    
62     #
63     # Public inheritable functions
64     #
65    
66     font_src_install() {
67    
68     local suffix doc
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 foser 1.1 # try to install some common docs
85     DOCS="${DOCS} COPYRIGHT README NEWS"
86     for doc in ${DOCS}; do
87     dodoc ${doc}
88     done
89    
90     }
91    
92     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20