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

Diff of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.17 Revision 1.18
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.17 2005/12/13 05:08:37 spyderous Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.18 2006/01/12 04:42:13 robbat2 Exp $
4 4
5# Author: foser <foser@gentoo.org> 5# Author: foser <foser@gentoo.org>
6 6
7# Font Eclass 7# Font Eclass
8# 8#
17 17
18FONT_SUFFIX="" # Space delimited list of font suffixes to install 18FONT_SUFFIX="" # Space delimited list of font suffixes to install
19 19
20FONT_S="${S}" # Dir containing the fonts 20FONT_S="${S}" # Dir containing the fonts
21 21
22FONT_PN="${PN}" # Last part of $FONTDIR
23
24FONTDIR="/usr/share/fonts/${FONT_PN}" # this is where the fonts are installed
25
22DOCS="" # Docs to install 26DOCS="" # Docs to install
23 27
24IUSE="X" 28IUSE="X"
25 29
26DEPEND="X? ( || ( x11-apps/mkfontdir virtual/x11 ) ) 30DEPEND="X? ( || ( x11-apps/mkfontdir virtual/x11 ) )
27 media-libs/fontconfig" 31 media-libs/fontconfig"
28 32
29# 33#
30# Public functions 34# Public functions
31# 35#
32 36
33font_xfont_config() { 37font_xfont_config() {
34 38
35 # create Xfont files 39 # create Xfont files
36 if use X ; then 40 if use X ; then
37 einfo "Creating fonts.scale & fonts.dir ..." 41 einfo "Creating fonts.scale & fonts.dir ..."
38 mkfontscale "${D}/usr/share/fonts/${PN}" 42 mkfontscale "${D}${FONTDIR}"
39 mkfontdir \ 43 mkfontdir \
40 -e /usr/share/fonts/encodings \ 44 -e /usr/share/fonts/encodings \
41 -e /usr/share/fonts/encodings/large \ 45 -e /usr/share/fonts/encodings/large \
42 "${D}/usr/share/fonts/${PN}" 46 "${D}${FONTDIR}"
43 if [ -e "${FONT_S}/fonts.alias" ] ; then 47 if [ -e "${FONT_S}/fonts.alias" ] ; then
44 doins "${FONT_S}/fonts.alias" 48 doins "${FONT_S}/fonts.alias"
45 fi 49 fi
46 fi 50 fi
47 51
50font_xft_config() { 54font_xft_config() {
51 55
52 # create fontconfig cache 56 # create fontconfig cache
53 einfo "Creating fontconfig cache ..." 57 einfo "Creating fontconfig cache ..."
54 # Mac OS X has fc-cache at /usr/X11R6/bin 58 # Mac OS X has fc-cache at /usr/X11R6/bin
55 HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}" 59 HOME="/root" fc-cache -f "${D}${FONTDIR}"
56 60
57} 61}
58 62
59# 63#
60# Public inheritable functions 64# Public inheritable functions
64 68
65 local suffix 69 local suffix
66 70
67 cd "${FONT_S}" 71 cd "${FONT_S}"
68 72
69 insinto "/usr/share/fonts/${PN}" 73 insinto "${FONTDIR}"
70 74
71 for suffix in ${FONT_SUFFIX}; do 75 for suffix in ${FONT_SUFFIX}; do
72 doins *.${suffix} 76 doins *.${suffix}
73 done 77 done
74 78
83 dodoc ${DOCS} 87 dodoc ${DOCS}
84 88
85} 89}
86 90
87font_pkg_setup() { 91font_pkg_setup() {
88
89 # make sure we get no colissions 92 # make sure we get no colissions
90 # setup is not the nicest place, but preinst doesn't cut it 93 # setup is not the nicest place, but preinst doesn't cut it
91 rm "/usr/share/fonts/${PN}/fonts.cache-1" 94 rm -f "${FONTDIR}/fonts.cache-1"
92
93} 95}
94 96
95EXPORT_FUNCTIONS src_install pkg_setup 97EXPORT_FUNCTIONS src_install pkg_setup

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20