/[gentoo-x86]/eclass/x-modular.eclass
Gentoo

Diff of /eclass/x-modular.eclass

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

Revision 1.3 Revision 1.5
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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/x-modular.eclass,v 1.3 2005/08/14 23:04:02 spyderous Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.5 2005/08/15 00:33:31 spyderous Exp $
4# 4#
5# Author: Donnie Berkholz <spyderous@gentoo.org> 5# Author: Donnie Berkholz <spyderous@gentoo.org>
6# 6#
7# This eclass is designed to reduce code duplication in the modularized X11 7# This eclass is designed to reduce code duplication in the modularized X11
8# ebuilds. 8# ebuilds.
9# 9#
10# If the ebuild installs fonts, set FONT="yes" at the top and set FONT_DIRS to 10# If the ebuild installs fonts, set FONT="yes" at the top and set FONT_DIRS to
11# the subdirectories within /usr/share/fonts to which it installs fonts. 11# the subdirectories within /usr/share/fonts to which it installs fonts.
12 12
13EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst 13EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst
14 14
15inherit eutils 15inherit eutils
16 16
17# Directory prefix to use for everything 17# Directory prefix to use for everything
18# Change to /usr/X11R6 once it's standard
19XDIR="/usr" 18XDIR="/usr"
20 19
21IUSE="" 20IUSE=""
22HOMEPAGE="http://xorg.freedesktop.org/" 21HOMEPAGE="http://xorg.freedesktop.org/"
23SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2" 22SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2"
34 >=sys-devel/m4-1.4" 33 >=sys-devel/m4-1.4"
35fi 34fi
36 35
37# If we're a font package, but not the font.alias one 36# If we're a font package, but not the font.alias one
38if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then 37if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then
38 # Activate font code in the rest of the eclass
39 FONT="yes"
40
39 RDEPEND="${RDEPEND} 41 RDEPEND="${RDEPEND}
40 media-fonts/encodings" 42 media-fonts/encodings"
41 PDEPEND="${PDEPEND} 43 PDEPEND="${PDEPEND}
42 media-fonts/font-alias" 44 media-fonts/font-alias"
43fi 45fi
119# einstall forces datadir, so we need to re-force it 121# einstall forces datadir, so we need to re-force it
120# datadir=${XDIR}/share \ 122# datadir=${XDIR}/share \
121# mandir=${XDIR}/share/man \ 123# mandir=${XDIR}/share/man \
122} 124}
123 125
126x-modular_pkg_preinst() {
127 if [[ -n "${FONT}" ]]; then
128 discover_font_dirs
129 fi
130}
131
124x-modular_pkg_postinst() { 132x-modular_pkg_postinst() {
125 if [[ -n "${FONT}" ]]; then 133 if [[ -n "${FONT}" ]]; then
126 setup_fonts 134 setup_fonts
127 fi 135 fi
128} 136}
136 144
137 create_fonts_scale 145 create_fonts_scale
138 create_fonts_dir 146 create_fonts_dir
139 fix_font_permissions 147 fix_font_permissions
140 create_font_cache 148 create_font_cache
149}
150
151discover_font_dirs() {
152 pushd ${IMAGE}/usr/share/fonts
153 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"
154 FONT_DIRS="$(echo ${FONT_DIRS} | sed -e 's:./::g')"
155 popd
141} 156}
142 157
143create_fonts_scale() { 158create_fonts_scale() {
144 ebegin "Creating fonts.scale files" 159 ebegin "Creating fonts.scale files"
145 local x 160 local x

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20