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

Diff of /eclass/font.eclass

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

Revision 1.2 Revision 1.10
1# Copyright 1999-2004 Gentoo Technologies, Inc. 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.2 2004/05/31 14:59:26 foser Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.10 2004/10/19 19:51:12 vapier 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#
9# Eclass to make font installation more uniform 9# Eclass to make font installation more uniform
10
11inherit eutils
10 12
11ECLASS="font" 13ECLASS="font"
12INHERITED="$INHERITED $ECLASS" 14INHERITED="$INHERITED $ECLASS"
13 15
14# 16#
32# 34#
33 35
34font_xfont_config() { 36font_xfont_config() {
35 37
36 # create Xfont files 38 # create Xfont files
37 if [ -n "`use X`" ] ; 39 if use X ;
38 then 40 then
39 einfo "Creating fonts.scale & fonts.dir..." 41 einfo "Creating fonts.scale & fonts.dir ..."
40 mkfontscale ${D}/usr/share/fonts/${PN} 42 mkfontscale "${D}/usr/share/fonts/${PN}"
41 mkfontdir \ 43 mkfontdir \
42 -e /usr/share/fonts/encodings \ 44 -e /usr/share/fonts/encodings \
43 -e /usr/share/fonts/encodings/large \ 45 -e /usr/share/fonts/encodings/large \
44 -e /usr/X11R6/lib/X11/fonts/encodings \ 46 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
45 ${D}/usr/share/fonts/${PN} 47 "${D}/usr/share/fonts/${PN}"
48 if [ -e "${FONT_S}/fonts.alias" ] ;
49 then
46 doins ${FONT_S}/fonts.alias 50 doins "${FONT_S}/fonts.alias"
51 fi
47 fi 52 fi
48 53
49} 54}
50 55
51font_xft_config() { 56font_xft_config() {
52 57
53 # create fontconfig cache 58 # create fontconfig cache
54 einfo "Creating fontconfig cache..." 59 einfo "Creating fontconfig cache ..."
60 # Mac OS X has fc-cache at /usr/X11R6/bin
55 HOME="/root" /usr/bin/fc-cache -f ${D}/usr/share/fonts/${PN} 61 HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
56 62
57} 63}
58 64
59# 65#
60# Public inheritable functions 66# Public inheritable functions
61# 67#
62 68
63font_src_install() { 69font_src_install() {
64 70
65 local suffix doc 71 local suffix
66 72
67 cd ${FONT_S} 73 cd "${FONT_S}"
68 74
69 insinto /usr/share/fonts/${PN} 75 insinto "/usr/share/fonts/${PN}"
70 76
71 for suffix in ${FONT_SUFFIX}; do 77 for suffix in ${FONT_SUFFIX}; do
72 doins *.${suffix} 78 doins *.${suffix}
73 done 79 done
74 80
75 rm -f fonts.{dir,scale} encodings.dir 81 rm -f fonts.{dir,scale} encodings.dir
76 82
77 font_xfont_config 83 font_xfont_config
78 font_xft_config 84 font_xft_config
79 85
80 cd ${S} 86 cd "${S}"
81 # try to install some common docs 87 # try to install some common docs
82 DOCS="${DOCS} COPYRIGHT README NEWS" 88 DOCS="${DOCS} COPYRIGHT README NEWS"
83 for doc in ${DOCS}; do 89 for f in ${DOCS}; do
84 dodoc ${doc} 90 [[ -e "${f}" ]] && dodoc "${f}"
85 done 91 done
86
87} 92}
88 93
89EXPORT_FUNCTIONS src_install 94EXPORT_FUNCTIONS src_install

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20