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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Sep 15 23:10:21 2004 UTC (9 years, 7 months ago) by kugelfang
Branch: MAIN
Changes since 1.6: +4 -2 lines
Using eutils:get_libdir() now instead of hardcoded [/usr][/...]/lib

1 vapier 1.5 # Copyright 1999-2004 Gentoo Foundation
2 foser 1.1 # Distributed under the terms of the GNU General Public License v2
3 kugelfang 1.7 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.6 2004/06/27 18:42:40 usata 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 kugelfang 1.7 inherit eutils
12    
13 foser 1.1 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 foser 1.2 FONT_S="${S}" # Dir containing the fonts
23    
24 foser 1.1 DOCS="" # Docs to install
25    
26     IUSE="${IUSE} X"
27    
28     DEPEND="${DEPEND} \
29     X? ( virtual/x11 ) \
30     media-libs/fontconfig"
31    
32 foser 1.2 #
33     # Public functions
34 foser 1.1 #
35    
36 foser 1.2 font_xfont_config() {
37 foser 1.1
38     # create Xfont files
39 mr_bones_ 1.4 if use X ;
40 foser 1.1 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 kugelfang 1.7 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
47 foser 1.2 ${D}/usr/share/fonts/${PN}
48 usata 1.3 if [ -e ${FONT_S}/fonts.alias ] ;
49     then
50     doins ${FONT_S}/fonts.alias
51     fi
52 foser 1.1 fi
53    
54 foser 1.2 }
55    
56     font_xft_config() {
57    
58 foser 1.1 # create fontconfig cache
59     einfo "Creating fontconfig cache..."
60     HOME="/root" /usr/bin/fc-cache -f ${D}/usr/share/fonts/${PN}
61    
62 foser 1.2 }
63    
64     #
65     # Public inheritable functions
66     #
67    
68     font_src_install() {
69    
70 mr_bones_ 1.4 local suffix
71 foser 1.2
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 foser 1.1 # try to install some common docs
87     DOCS="${DOCS} COPYRIGHT README NEWS"
88 usata 1.6 for f in ${DOCS}; do
89     [[ -e ${f} ]] && dodoc ${f}
90     done
91 foser 1.1 }
92    
93     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20