/[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.2 Revision 1.4
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.2 2005/08/11 06:19:16 spyderous Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.4 2005/08/14 23:45:52 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 18# Change to /usr/X11R6 once it's standard
30 DEPEND="${DEPEND} 30 DEPEND="${DEPEND}
31 >=sys-devel/autoconf-2.57 31 >=sys-devel/autoconf-2.57
32 >=sys-devel/automake-1.7 32 >=sys-devel/automake-1.7
33 >=sys-devel/libtool-1.5 33 >=sys-devel/libtool-1.5
34 >=sys-devel/m4-1.4" 34 >=sys-devel/m4-1.4"
35fi
36
37# If we're a font package, but not the font.alias one
38if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then
39 # Activate font code in the rest of the eclass
40 FONT="yes"
41
42 RDEPEND="${RDEPEND}
43 media-fonts/encodings"
44 PDEPEND="${PDEPEND}
45 media-fonts/font-alias"
35fi 46fi
36 47
37DEPEND="${DEPEND} 48DEPEND="${DEPEND}
38 dev-util/pkgconfig 49 dev-util/pkgconfig
39 x11-misc/util-macros" 50 x11-misc/util-macros"
111# einstall forces datadir, so we need to re-force it 122# einstall forces datadir, so we need to re-force it
112# datadir=${XDIR}/share \ 123# datadir=${XDIR}/share \
113# mandir=${XDIR}/share/man \ 124# mandir=${XDIR}/share/man \
114} 125}
115 126
127x-modular_pkg_preinst() {
128 if [[ -n "${FONT}" ]]; then
129 discover_font_dirs
130 fi
131}
132
116x-modular_pkg_postinst() { 133x-modular_pkg_postinst() {
117 if [[ -n "${FONT}" ]]; then 134 if [[ -n "${FONT}" ]]; then
118 setup_fonts 135 setup_fonts
119 fi 136 fi
120} 137}
128 145
129 create_fonts_scale 146 create_fonts_scale
130 create_fonts_dir 147 create_fonts_dir
131 fix_font_permissions 148 fix_font_permissions
132 create_font_cache 149 create_font_cache
150}
151
152discover_font_dirs() {
153 pushd ${IMAGE}/usr/share/fonts
154 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"
155 FONT_DIRS="$(echo ${FONT_DIRS} | sed -e 's:./::g')"
156 popd
133} 157}
134 158
135create_fonts_scale() { 159create_fonts_scale() {
136 ebegin "Creating fonts.scale files" 160 ebegin "Creating fonts.scale files"
137 local x 161 local x

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

  ViewVC Help
Powered by ViewVC 1.1.20