/[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.103 Revision 1.118
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.103 2008/11/26 23:13:24 dberkholz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.118 2009/12/09 10:21:49 vapier Exp $
4# 4#
5# @ECLASS: x-modular.eclass 5# @ECLASS: x-modular.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org 7# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 8# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
15# All you need to do in a basic ebuild is inherit this eclass and set 15# All you need to do in a basic ebuild is inherit this eclass and set
16# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted 16# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
17# with the other X packages, you don't need to set SRC_URI. Pretty much 17# with the other X packages, you don't need to set SRC_URI. Pretty much
18# everything else should be automatic. 18# everything else should be automatic.
19 19
20if [[ ${PV} = 9999* ]]; then
21 GIT_ECLASS="git"
22 SNAPSHOT="yes"
23 SRC_URI=""
24fi
25
26# If we're a font package, but not the font.alias one
27FONT_ECLASS=""
28if [[ "${PN/#font-}" != "${PN}" ]] \
29 && [[ "${CATEGORY}" = "media-fonts" ]] \
30 && [[ "${PN}" != "font-alias" ]] \
31 && [[ "${PN}" != "font-util" ]]; then
32 # Activate font code in the rest of the eclass
33 FONT="yes"
34
35 # Whether to inherit the font eclass
36 FONT_ECLASS="font"
37fi
38
39inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
40 ${FONT_ECLASS} ${GIT_ECLASS}
41
42EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
43
44case "${EAPI:-0}" in
45 0|1)
46 ;;
47 2)
48 EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure"
49 ;;
50 *)
51 die "Unknown EAPI ${EAPI}"
52 ;;
53esac
54
55# exports must be ALWAYS after inherit
56EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
57
20# @ECLASS-VARIABLE: XDIR 58# @ECLASS-VARIABLE: XDIR
21# @DESCRIPTION: 59# @DESCRIPTION:
22# Directory prefix to use for everything. If you want to install to a 60# Directory prefix to use for everything. If you want to install to a
23# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been 61# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been
24# recently tested. You may need to uncomment the setting of datadir and 62# recently tested. You may need to uncomment the setting of datadir and
27XDIR="/usr" 65XDIR="/usr"
28 66
29IUSE="" 67IUSE=""
30HOMEPAGE="http://xorg.freedesktop.org/" 68HOMEPAGE="http://xorg.freedesktop.org/"
31 69
32if [[ -z ${SNAPSHOT} ]]; then
33# @ECLASS-VARIABLE: SNAPSHOT 70# @ECLASS-VARIABLE: SNAPSHOT
34# @DESCRIPTION: 71# @DESCRIPTION:
35# If set to 'yes' and configure.ac exists, eautoreconf will run. Set 72# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
36# before inheriting this eclass. 73# before inheriting this eclass.
37 SNAPSHOT="no" 74: ${SNAPSHOT:=no}
38fi
39
40if [[ ${PV} = 9999* ]]; then
41 GIT_ECLASS="git"
42 SNAPSHOT="yes"
43 SRC_URI=""
44fi
45 75
46# Set up SRC_URI for individual modular releases 76# Set up SRC_URI for individual modular releases
47BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 77BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
48# @ECLASS-VARIABLE: MODULE 78# @ECLASS-VARIABLE: MODULE
49# @DESCRIPTION: 79# @DESCRIPTION:
50# The subdirectory to download source from. Possible settings are app, 80# The subdirectory to download source from. Possible settings are app,
51# doc, data, util, driver, font, lib, proto, xserver. Set above the 81# doc, data, util, driver, font, lib, proto, xserver. Set above the
52# inherit to override the default autoconfigured module. 82# inherit to override the default autoconfigured module.
53if [[ -z ${MODULE} ]]; then 83if [[ -z ${MODULE} ]]; then
54 MODULE=""
55 case ${CATEGORY} in 84 case ${CATEGORY} in
56 app-doc) MODULE="doc" ;; 85 app-doc) MODULE="doc" ;;
57 media-fonts) MODULE="font" ;; 86 media-fonts) MODULE="font" ;;
58 x11-apps|x11-wm) MODULE="app" ;; 87 x11-apps|x11-wm) MODULE="app" ;;
59 x11-misc|x11-themes) MODULE="util" ;; 88 x11-misc|x11-themes) MODULE="util" ;;
71fi 100fi
72 101
73SLOT="0" 102SLOT="0"
74 103
75# Set the license for the package. This can be overridden by setting 104# Set the license for the package. This can be overridden by setting
76# LICENSE after the inherit. 105# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
77LICENSE=${PN} 106# are under the MIT license. (This is what Red Hat does in their rpms)
107LICENSE="MIT"
78 108
79# Set up shared dependencies 109# Set up shared dependencies
80if [[ -n "${SNAPSHOT}" ]]; then 110if [[ -n "${SNAPSHOT}" ]]; then
81# FIXME: What's the minimal libtool version supporting arbitrary versioning? 111# FIXME: What's the minimal libtool version supporting arbitrary versioning?
82 DEPEND="${DEPEND} 112 DEPEND="${DEPEND}
84 >=sys-devel/m4-1.4" 114 >=sys-devel/m4-1.4"
85 WANT_AUTOCONF="latest" 115 WANT_AUTOCONF="latest"
86 WANT_AUTOMAKE="latest" 116 WANT_AUTOMAKE="latest"
87fi 117fi
88 118
89# If we're a font package, but not the font.alias one 119if [[ -n "${FONT}" ]]; then
90FONT_ECLASS=""
91if [[ "${PN/#font-}" != "${PN}" ]] \
92 && [[ "${CATEGORY}" = "media-fonts" ]] \
93 && [[ "${PN}" != "font-alias" ]] \
94 && [[ "${PN}" != "font-util" ]]; then
95 # Activate font code in the rest of the eclass
96 FONT="yes"
97
98 # Whether to inherit the font eclass
99 FONT_ECLASS="font"
100
101 RDEPEND="${RDEPEND} 120 RDEPEND="${RDEPEND}
102 media-fonts/encodings 121 media-fonts/encodings
103 x11-apps/mkfontscale 122 x11-apps/mkfontscale
104 x11-apps/mkfontdir" 123 x11-apps/mkfontdir"
105 PDEPEND="${PDEPEND} 124 PDEPEND="${PDEPEND}
106 media-fonts/font-alias" 125 media-fonts/font-alias"
107 126
108 # Starting with 7.0RC3, we can specify the font directory 127 # Starting with 7.0RC3, we can specify the font directory
109 # But oddly, we can't do the same for encodings or font-alias 128 # But oddly, we can't do the same for encodings or font-alias
110 129
111 # Wrap in `if` so ebuilds can set it too
112 if [[ -z ${FONT_DIR} ]]; then
113# @ECLASS-VARIABLE: FONT_DIR 130# @ECLASS-VARIABLE: FONT_DIR
114# @DESCRIPTION: 131# @DESCRIPTION:
115# If you're creating a font package and the suffix of PN is not equal to 132# If you're creating a font package and the suffix of PN is not equal to
116# the subdirectory of /usr/share/fonts/ it should install into, set 133# the subdirectory of /usr/share/fonts/ it should install into, set
117# FONT_DIR to that directory or directories. Set before inheriting this 134# FONT_DIR to that directory or directories. Set before inheriting this
118# eclass. 135# eclass.
119 FONT_DIR=${PN##*-} 136 : ${FONT_DIR:=${PN##*-}}
120
121 fi
122 137
123 # Fix case of font directories 138 # Fix case of font directories
124 FONT_DIR=${FONT_DIR/ttf/TTF} 139 FONT_DIR=${FONT_DIR/ttf/TTF}
125 FONT_DIR=${FONT_DIR/otf/OTF} 140 FONT_DIR=${FONT_DIR/otf/OTF}
126 FONT_DIR=${FONT_DIR/type1/Type1} 141 FONT_DIR=${FONT_DIR/type1/Type1}
127 FONT_DIR=${FONT_DIR/speedo/Speedo} 142 FONT_DIR=${FONT_DIR/speedo/Speedo}
128 143
129 # Set up configure option 144 # Set up configure options, wrapped so ebuilds can override if need be
145 if [[ -z ${FONT_OPTIONS} ]]; then
130 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" 146 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\""
147 fi
131 148
132 if [[ -n "${FONT}" ]]; then 149 if [[ -n "${FONT}" ]]; then
133 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then 150 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
134 IUSE="${IUSE} nls" 151 IUSE="${IUSE} nls"
135 fi 152 fi
159DEPEND="${DEPEND} 176DEPEND="${DEPEND}
160 >=dev-util/pkgconfig-0.18" 177 >=dev-util/pkgconfig-0.18"
161 178
162if [[ "${PN/util-macros}" = "${PN}" ]]; then 179if [[ "${PN/util-macros}" = "${PN}" ]]; then
163 DEPEND="${DEPEND} 180 DEPEND="${DEPEND}
164 >=x11-misc/util-macros-0.99.2 181 >=x11-misc/util-macros-1.3.0
165 >=sys-devel/binutils-2.16.1-r3" 182 sys-devel/binutils"
166fi 183fi
167 184
168RDEPEND="${RDEPEND} 185RDEPEND="${RDEPEND}
169 !<=x11-base/xorg-x11-6.9" 186 !<=x11-base/xorg-x11-6.9"
170# Provides virtual/x11 for temporary use until packages are ported 187# Provides virtual/x11 for temporary use until packages are ported
171# x11-base/x11-env" 188# x11-base/x11-env"
172
173inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
174 ${FONT_ECLASS} ${GIT_ECLASS}
175 189
176# @FUNCTION: x-modular_specs_check 190# @FUNCTION: x-modular_specs_check
177# @USAGE: 191# @USAGE:
178# @DESCRIPTION: 192# @DESCRIPTION:
179# Make any necessary changes related to gcc specs (generally hardened) 193# Make any necessary changes related to gcc specs (generally hardened)
190# @DESCRIPTION: 204# @DESCRIPTION:
191# Ensures the server supports DRI if building a driver with DRI support 205# Ensures the server supports DRI if building a driver with DRI support
192x-modular_dri_check() { 206x-modular_dri_check() {
193 # (#120057) Enabling DRI in drivers requires that the server was built with 207 # (#120057) Enabling DRI in drivers requires that the server was built with
194 # support for it 208 # support for it
209 # Starting with xorg-server 1.5.3, DRI support is always enabled unless
210 # USE=minimal is set (see bug #252084)
195 if [[ -n "${DRIVER}" ]]; then 211 if [[ -n "${DRIVER}" ]]; then
196 if has dri ${IUSE} && use dri; then 212 if has dri ${IUSE} && use dri; then
197 einfo "Checking for direct rendering capabilities ..." 213 einfo "Checking for direct rendering capabilities ..."
214 if has_version '>=x11-base/xorg-server-1.5.3'; then
215 if built_with_use x11-base/xorg-server minimal; then
216 die "You must build x11-base/xorg-server with USE=-minimal."
217 fi
218 else
198 if ! built_with_use --missing true x11-base/xorg-server dri; then 219 if ! built_with_use x11-base/xorg-server dri; then
199 die "You must build x11-base/xorg-server with USE=dri." 220 die "You must build x11-base/xorg-server with USE=dri."
221 fi
200 fi 222 fi
201 fi 223 fi
202 fi 224 fi
203} 225}
204 226
227 if [[ -n ${GIT_ECLASS} ]]; then 249 if [[ -n ${GIT_ECLASS} ]]; then
228 git_src_unpack 250 git_src_unpack
229 else 251 else
230 unpack ${A} 252 unpack ${A}
231 fi 253 fi
232 cd ${S} 254 cd "${S}"
233 255
234 if [[ -n ${FONT_OPTIONS} ]]; then 256 if [[ -n ${FONT_OPTIONS} ]]; then
235 einfo "Detected font directory: ${FONT_DIR}" 257 einfo "Detected font directory: ${FONT_DIR}"
236 fi 258 fi
237} 259}
287 # Joshua Baergen - October 23, 2005 309 # Joshua Baergen - October 23, 2005
288 # Fix shared lib issues on MIPS, FBSD, etc etc 310 # Fix shared lib issues on MIPS, FBSD, etc etc
289 elibtoolize 311 elibtoolize
290} 312}
291 313
314# @FUNCTION: x-modular_src_prepare
315# @USAGE:
316# @DESCRIPTION:
317# Prepare a package after unpacking, performing all X-related tasks.
318x-modular_src_prepare() {
319 [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
320 && git_src_prepare
321 x-modular_patch_source
322 x-modular_reconf_source
323}
324
292# @FUNCTION: x-modular_src_unpack 325# @FUNCTION: x-modular_src_unpack
293# @USAGE: 326# @USAGE:
294# @DESCRIPTION: 327# @DESCRIPTION:
295# Unpack a package, performing all X-related tasks. 328# Unpack a package, performing all X-related tasks.
296x-modular_src_unpack() { 329x-modular_src_unpack() {
297 x-modular_specs_check 330 x-modular_specs_check
298 x-modular_server_supports_drivers_check 331 x-modular_server_supports_drivers_check
299 x-modular_dri_check 332 x-modular_dri_check
300 x-modular_unpack_source 333 x-modular_unpack_source
301 x-modular_patch_source 334 has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
302 x-modular_reconf_source
303} 335}
304 336
305# @FUNCTION: x-modular_font_configure 337# @FUNCTION: x-modular_font_configure
306# @USAGE: 338# @USAGE:
307# @DESCRIPTION: 339# @DESCRIPTION:
308# If a font package, perform any necessary configuration steps 340# If a font package, perform any necessary configuration steps
309x-modular_font_configure() { 341x-modular_font_configure() {
310 if [[ -n "${FONT}" ]]; then 342 if [[ -n "${FONT}" ]]; then
311 # Might be worth adding an option to configure your desired font 343 # Might be worth adding an option to configure your desired font
312 # and exclude all others. Also, should this USE be nls or minimal? 344 # and exclude all others. Also, should this USE be nls or minimal?
313 if ! use nls; then 345 if has nls ${IUSE//+} && ! use nls; then
314 FONT_OPTIONS="${FONT_OPTIONS} 346 FONT_OPTIONS="${FONT_OPTIONS}
315 --disable-iso8859-2 347 --disable-iso8859-2
316 --disable-iso8859-3 348 --disable-iso8859-3
317 --disable-iso8859-4 349 --disable-iso8859-4
318 --disable-iso8859-5 350 --disable-iso8859-5
354 x-modular_font_configure 386 x-modular_font_configure
355 x-modular_debug_setup 387 x-modular_debug_setup
356 388
357# @VARIABLE: CONFIGURE_OPTIONS 389# @VARIABLE: CONFIGURE_OPTIONS
358# @DESCRIPTION: 390# @DESCRIPTION:
359# Any options to pass to configure 391# Any extra options to pass to configure
360[[ -n ${CONFIGURE_OPTIONS} ]]
361 392
362 # If prefix isn't set here, .pc files cause problems 393 # If prefix isn't set here, .pc files cause problems
363 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 394 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
364 econf --prefix=${XDIR} \ 395 econf --prefix=${XDIR} \
365 --datadir=${XDIR}/share \ 396 --datadir=${XDIR}/share \
375# Run make. 406# Run make.
376x-modular_src_make() { 407x-modular_src_make() {
377 emake || die "emake failed" 408 emake || die "emake failed"
378} 409}
379 410
380# @FUNCTION: x-modular_src_configure 411# @FUNCTION: x-modular_src_compile
381# @USAGE: 412# @USAGE:
382# @DESCRIPTION: 413# @DESCRIPTION:
383# Compile a package, performing all X-related tasks. 414# Compile a package, performing all X-related tasks.
384x-modular_src_compile() { 415x-modular_src_compile() {
385 x-modular_src_configure 416 has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
386 x-modular_src_make 417 x-modular_src_make
387} 418}
388 419
389# @FUNCTION: x-modular_src_install 420# @FUNCTION: x-modular_src_install
390# @USAGE: 421# @USAGE:
391# @DESCRIPTION: 422# @DESCRIPTION:
392# Install a built package to ${D}, performing any necessary steps. 423# Install a built package to ${D}, performing any necessary steps.
393# Creates a ChangeLog from git if using live ebuilds. 424# Creates a ChangeLog from git if using live ebuilds.
394x-modular_src_install() { 425x-modular_src_install() {
395 # Install everything to ${XDIR} 426 # Install everything to ${XDIR}
427 if [[ ${CATEGORY} = x11-proto ]]; then
396 make \ 428 make \
429 ${PN/proto/}docdir=/usr/share/doc/${PF} \
397 DESTDIR="${D}" \ 430 DESTDIR="${D}" \
398 install \ 431 install \
399 || die 432 || die
433 else
434 make \
435 docdir=/usr/share/doc/${PF} \
436 DESTDIR="${D}" \
437 install \
438 || die
439 fi
400# Shouldn't be necessary in XDIR=/usr 440# Shouldn't be necessary in XDIR=/usr
401# einstall forces datadir, so we need to re-force it 441# einstall forces datadir, so we need to re-force it
402# datadir=${XDIR}/share \ 442# datadir=${XDIR}/share \
403# mandir=${XDIR}/share/man \ 443# mandir=${XDIR}/share/man \
404 444
407 git log ${GIT_TREE} > "${S}"/ChangeLog 447 git log ${GIT_TREE} > "${S}"/ChangeLog
408 popd 448 popd
409 fi 449 fi
410 450
411 if [[ -e ${S}/ChangeLog ]]; then 451 if [[ -e ${S}/ChangeLog ]]; then
412 dodoc ${S}/ChangeLog 452 dodoc "${S}"/ChangeLog
413 fi 453 fi
414# @VARIABLE: DOCS 454# @VARIABLE: DOCS
415# @DESCRIPTION: 455# @DESCRIPTION:
416# Any documentation to install 456# Any documentation to install via dodoc
417 [[ -n ${DOCS} ]] && dodoc ${DOCS} 457 [[ -n ${DOCS} ]] && dodoc ${DOCS}
418
419 # Make sure docs get compressed
420 prepalldocs
421 458
422 # Don't install libtool archives for server modules 459 # Don't install libtool archives for server modules
423 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 460 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
424 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 461 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
425 | xargs rm -f 462 | xargs rm -f
426 fi 463 fi
427 464
428 if [[ -n "${FONT}" ]]; then 465 if [[ -n "${FONT}" ]]; then
429 remove_font_metadata 466 remove_font_metadata
469# @FUNCTION: cleanup_fonts 506# @FUNCTION: cleanup_fonts
470# @USAGE: 507# @USAGE:
471# @DESCRIPTION: 508# @DESCRIPTION:
472# Get rid of font directories that only contain generated files 509# Get rid of font directories that only contain generated files
473cleanup_fonts() { 510cleanup_fonts() {
474 local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale" 511 local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
475 for DIR in ${FONT_DIR}; do 512 for DIR in ${FONT_DIR}; do
476 unset KEEP_FONTDIR 513 unset KEEP_FONTDIR
477 REAL_DIR=${ROOT}usr/share/fonts/${DIR} 514 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
478 515
479 ebegin "Checking ${REAL_DIR} for useless files" 516 ebegin "Checking ${REAL_DIR} for useless files"
516 die "${msg}" 553 die "${msg}"
517 fi 554 fi
518 555
519 create_fonts_scale 556 create_fonts_scale
520 create_fonts_dir 557 create_fonts_dir
521 fix_font_permissions
522 create_font_cache 558 create_font_cache
523} 559}
524 560
525# @FUNCTION: remove_font_metadata 561# @FUNCTION: remove_font_metadata
526# @USAGE: 562# @USAGE:
532 for DIR in ${FONT_DIR}; do 568 for DIR in ${FONT_DIR}; do
533 if [[ "${DIR}" != "Speedo" ]] && \ 569 if [[ "${DIR}" != "Speedo" ]] && \
534 [[ "${DIR}" != "CID" ]] ; then 570 [[ "${DIR}" != "CID" ]] ; then
535 # Delete font metadata files 571 # Delete font metadata files
536 # fonts.scale, fonts.dir, fonts.cache-1 572 # fonts.scale, fonts.dir, fonts.cache-1
537 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 573 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
538 fi 574 fi
539 done 575 done
540} 576}
541 577
542# @FUNCTION: install_driver_hwdata 578# @FUNCTION: install_driver_hwdata
581 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 617 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
582 # <dberkholz@gentoo.org> 2 August 2004 618 # <dberkholz@gentoo.org> 2 August 2004
583 if [[ "${x/encodings}" = "${x}" ]] \ 619 if [[ "${x/encodings}" = "${x}" ]] \
584 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 620 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
585 mkfontscale \ 621 mkfontscale \
586 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 622 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
587 -- ${x} 623 -- ${x}
588 fi 624 fi
589 done 625 done
590 eend 0 626 eend 0
591} 627}
601 [[ -z "$(ls ${x}/)" ]] && continue 637 [[ -z "$(ls ${x}/)" ]] && continue
602 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 638 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
603 639
604 if [[ "${x/encodings}" = "${x}" ]]; then 640 if [[ "${x/encodings}" = "${x}" ]]; then
605 mkfontdir \ 641 mkfontdir \
606 -e ${ROOT}/usr/share/fonts/encodings \ 642 -e "${ROOT}"/usr/share/fonts/encodings \
607 -e ${ROOT}/usr/share/fonts/encodings/large \ 643 -e "${ROOT}"/usr/share/fonts/encodings/large \
608 -- ${x} 644 -- ${x}
609 fi 645 fi
610 done 646 done
611 eend 0 647 eend 0
612} 648}
613 649
614# @FUNCTION: fix_font_permissions
615# @USAGE:
616# @DESCRIPTION:
617# Font files should have 644 permissions. Ensure this is the case.
618fix_font_permissions() {
619 ebegin "Fixing permissions"
620 for DIR in ${FONT_DIR}; do
621 find ${ROOT}/usr/share/fonts/${DIR} -type f -name 'font.*' \
622 -exec chmod 0644 {} \;
623 done
624 eend 0
625}
626
627# @FUNCTION: create_font_cache 650# @FUNCTION: create_font_cache
628# @USAGE: 651# @USAGE:
629# @DESCRIPTION: 652# @DESCRIPTION:
630# Create fonts.cache-1 files, used by the new client-side fonts 653# Create fonts.cache-1 files, used by the new client-side fonts
631# subsystem. 654# subsystem.
632create_font_cache() { 655create_font_cache() {
633 font_pkg_postinst 656 font_pkg_postinst
634} 657}
635
636EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm

Legend:
Removed from v.1.103  
changed lines
  Added in v.1.118

  ViewVC Help
Powered by ViewVC 1.1.20