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

Diff of /eclass/font.eclass

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

Revision 1.25 Revision 1.26
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2007 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.25 2007/07/29 22:20:39 dirtyepic Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.26 2007/08/04 06:04:07 dirtyepic 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#
34# 34#
35# Public functions 35# Public functions
36# 36#
37 37
38font_xfont_config() { 38font_xfont_config() {
39
40 # create Xfont files 39 # create Xfont files
41 if use X ; then 40 if use X ; then
42 einfo "Creating fonts.scale & fonts.dir ..." 41 einfo "Creating fonts.scale & fonts.dir ..."
43 mkfontscale "${D}${FONTDIR}" 42 mkfontscale "${D}${FONTDIR}"
44 mkfontdir \ 43 mkfontdir \
47 "${D}${FONTDIR}" 46 "${D}${FONTDIR}"
48 if [ -e "${FONT_S}/fonts.alias" ] ; then 47 if [ -e "${FONT_S}/fonts.alias" ] ; then
49 doins "${FONT_S}/fonts.alias" 48 doins "${FONT_S}/fonts.alias"
50 fi 49 fi
51 fi 50 fi
52
53} 51}
54 52
55font_xft_config() { 53font_xft_config() {
56
57 if ! has_version '>=media-libs/fontconfig-2.4'; then 54 if ! has_version '>=media-libs/fontconfig-2.4'; then
58 # create fontconfig cache 55 # create fontconfig cache
59 einfo "Creating fontconfig cache ..." 56 einfo "Creating fontconfig cache ..."
60 # Mac OS X has fc-cache at /usr/X11R6/bin 57 # Mac OS X has fc-cache at /usr/X11R6/bin
61 HOME="/root" fc-cache -f "${D}${FONTDIR}" 58 HOME="/root" fc-cache -f "${D}${FONTDIR}"
77# 74#
78# Public inheritable functions 75# Public inheritable functions
79# 76#
80 77
81font_src_install() { 78font_src_install() {
82
83 local suffix commondoc 79 local suffix commondoc
84 80
85 cd "${FONT_S}" 81 cd "${FONT_S}"
86 82
87 insinto "${FONTDIR}" 83 insinto "${FONTDIR}"
104 [[ -s ${commondoc} ]] && dodoc ${commondoc} 100 [[ -s ${commondoc} ]] && dodoc ${commondoc}
105 done 101 done
106} 102}
107 103
108font_pkg_setup() { 104font_pkg_setup() {
109
110 # make sure we get no collisions 105 # make sure we get no collisions
111 # setup is not the nicest place, but preinst doesn't cut it 106 # setup is not the nicest place, but preinst doesn't cut it
112 [[ -e "${FONTDIR}/fonts.cache-1" ]] && rm -f "${FONTDIR}/fonts.cache-1" 107 [[ -e "${FONTDIR}/fonts.cache-1" ]] && rm -f "${FONTDIR}/fonts.cache-1"
113
114} 108}
115 109
116font_pkg_postinst() { 110font_pkg_postinst() {
117
118 if has_version '>=media-libs/fontconfig-2.4'; then 111 if has_version '>=media-libs/fontconfig-2.4'; then
119 if [ ${ROOT} == "/" ]; then 112 if [ ${ROOT} == "/" ]; then
120 ebegin "Updating global fontcache" 113 ebegin "Updating global fontcache"
121 fc-cache -s 114 fc-cache -fs
122 eend $? 115 eend $?
123 fi 116 fi
124 fi 117 fi
125
126} 118}
127 119
128font_pkg_postrm() { 120font_pkg_postrm() {
129
130 if has_version '>=media-libs/fontconfig-2.4'; then 121 if has_version '>=media-libs/fontconfig-2.4'; then
131 if [ ${ROOT} == "/" ]; then 122 if [ ${ROOT} == "/" ]; then
132 ebegin "Updating global fontcache" 123 ebegin "Updating global fontcache"
133 fc-cache -s 124 fc-cache -fs
134 eend $? 125 eend $?
135 fi 126 fi
136 fi 127 fi
137
138} 128}
139 129
140EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm 130EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20