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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Mon Jul 11 15:08:06 2005 UTC (8 years, 9 months ago) by swegener
Branch: MAIN
Changes since 1.14: +5 -6 lines
QA: Apply whitespace checks from repoman to eclasses.

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.14 2005/07/06 20:23:20 agriffis 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
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="X"
25
26 DEPEND="X? ( virtual/x11 )
27 media-libs/fontconfig"
28
29 #
30 # Public functions
31 #
32
33 font_xfont_config() {
34
35 # create Xfont files
36 if use X ; then
37 einfo "Creating fonts.scale & fonts.dir ..."
38 mkfontscale "${D}/usr/share/fonts/${PN}"
39 mkfontdir \
40 -e /usr/share/fonts/encodings \
41 -e /usr/share/fonts/encodings/large \
42 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
43 "${D}/usr/share/fonts/${PN}"
44 if [ -e "${FONT_S}/fonts.alias" ] ; then
45 doins "${FONT_S}/fonts.alias"
46 fi
47 fi
48
49 }
50
51 font_xft_config() {
52
53 # create fontconfig cache
54 einfo "Creating fontconfig cache ..."
55 # Mac OS X has fc-cache at /usr/X11R6/bin
56 HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
57
58 }
59
60 #
61 # Public inheritable functions
62 #
63
64 font_src_install() {
65
66 local suffix
67
68 cd "${FONT_S}"
69
70 insinto "/usr/share/fonts/${PN}"
71
72 for suffix in ${FONT_SUFFIX}; do
73 doins *.${suffix}
74 done
75
76 rm -f fonts.{dir,scale} encodings.dir
77
78 font_xfont_config
79 font_xft_config
80
81 cd "${S}"
82 # try to install some common docs
83 DOCS="${DOCS} COPYRIGHT README NEWS"
84 dodoc ${DOCS}
85
86 }
87
88 font_pkg_setup() {
89
90 # make sure we get no colissions
91 # setup is not the nicest place, but preinst doesn't cut it
92 rm "/usr/share/fonts/${PN}/fonts.cache-1"
93
94 }
95
96 EXPORT_FUNCTIONS src_install pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20