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

Diff of /eclass/font.eclass

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

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.1

  ViewVC Help
Powered by ViewVC 1.1.20