/[gentoo-x86]/eclass/xorg-2.eclass
Gentoo

Diff of /eclass/xorg-2.eclass

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

Revision 1.3 Revision 1.8
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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/xorg-2.eclass,v 1.3 2010/04/22 18:27:43 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.8 2010/08/06 20:46:08 scarabeus Exp $
4# 4#
5# @ECLASS: xorg-2.eclass 5# @ECLASS: xorg-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# x11@gentoo.org 7# x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 8# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
98 DEPEND+=" 98 DEPEND+="
99 >=sys-devel/libtool-2.2.6a 99 >=sys-devel/libtool-2.2.6a
100 sys-devel/m4" 100 sys-devel/m4"
101 # This MUST BE STABLE 101 # This MUST BE STABLE
102 if [[ ${PN} != util-macros ]] ; then 102 if [[ ${PN} != util-macros ]] ; then
103 DEPEND+=" >=x11-misc/util-macros-1.5.0" 103 DEPEND+=" >=x11-misc/util-macros-1.8.0"
104 # Required even by xorg-server 104 # Required even by xorg-server
105 [[ ${PN} == "font-util" ]] || DEPEND+=" >=media-fonts/font-util-1.1.1-r1" 105 [[ ${PN} == "font-util" ]] || DEPEND+=" >=media-fonts/font-util-1.1.1-r1"
106 fi 106 fi
107 WANT_AUTOCONF="latest" 107 WANT_AUTOCONF="latest"
108 WANT_AUTOMAKE="latest" 108 WANT_AUTOMAKE="latest"
206# Run eautoreconf if necessary, and run elibtoolize. 206# Run eautoreconf if necessary, and run elibtoolize.
207xorg-2_reconf_source() { 207xorg-2_reconf_source() {
208 case ${CHOST} in 208 case ${CHOST} in
209 *-interix* | *-aix* | *-winnt*) 209 *-interix* | *-aix* | *-winnt*)
210 # some hosts need full eautoreconf 210 # some hosts need full eautoreconf
211 [[ -e "./configure.ac" ]] && eautoreconf || ewarn "Unable to autoreconf the configure script. Things may fail." 211 [[ -e "./configure.ac" || -e "./configure.in" ]] && eautoreconf || ewarn "Unable to autoreconf the configure script. Things may fail."
212 ;; 212 ;;
213 *) 213 *)
214 # elibtoolize required for BSD 214 # elibtoolize required for BSD
215 [[ ${XORG_EAUTORECONF} != no && -e "./configure.ac" ]] && eautoreconf || elibtoolize 215 [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] && eautoreconf || elibtoolize
216 ;; 216 ;;
217 esac 217 esac
218} 218}
219 219
220# @FUNCTION: xorg-2_src_prepare 220# @FUNCTION: xorg-2_src_prepare
355# @DESCRIPTION: 355# @DESCRIPTION:
356# Run X-specific post-removal tasks on the live filesystem. The only 356# Run X-specific post-removal tasks on the live filesystem. The only
357# task right now is some cleanup for font packages. 357# task right now is some cleanup for font packages.
358xorg-2_pkg_postrm() { 358xorg-2_pkg_postrm() {
359 if [[ -n ${FONT} ]]; then 359 if [[ -n ${FONT} ]]; then
360 cleanup_fonts
361 font_pkg_postrm 360 font_pkg_postrm
362 fi 361 fi
363}
364
365# @FUNCTION: cleanup_fonts
366# @USAGE:
367# @DESCRIPTION:
368# Get rid of font directories that only contain generated files
369cleanup_fonts() {
370 local allowed_files="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
371 local real_dir=${EROOT}usr/share/fonts/${FONT_DIR}
372 local fle allowed_file
373
374 unset KEEP_FONTDIR
375
376 einfo "Checking ${real_dir} for useless files"
377 pushd ${real_dir} &> /dev/null
378 for fle in *; do
379 unset MATCH
380 for allowed_file in ${allowed_files}; do
381 if [[ ${fle} = ${allowed_file} ]]; then
382 # If it's allowed, then move on to the next file
383 MATCH="yes"
384 break
385 fi
386 done
387 # If we found a match in allowed files, move on to the next file
388 [[ -n ${MATCH} ]] && continue
389 # If we get this far, there wasn't a match in the allowed files
390 KEEP_FONTDIR="yes"
391 # We don't need to check more files if we're already keeping it
392 break
393 done
394 popd &> /dev/null
395 # If there are no files worth keeping, then get rid of the dir
396 [[ -z "${KEEP_FONTDIR}" ]] && rm -rf ${real_dir}
397} 362}
398 363
399# @FUNCTION: setup_fonts 364# @FUNCTION: setup_fonts
400# @USAGE: 365# @USAGE:
401# @DESCRIPTION: 366# @DESCRIPTION:

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

  ViewVC Help
Powered by ViewVC 1.1.20