| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.44 2009/02/08 18:22:39 pva Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.45 2009/09/07 21:07:11 dirtyepic Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: font.eclass |
5 | # @ECLASS: font.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # fonts@gentoo.org |
7 | # fonts@gentoo.org |
| 8 | # |
8 | # |
| 9 | # Author: foser <foser@gentoo.org> |
9 | # Author: foser <foser@gentoo.org> |
| 10 | # @BLURB: Eclass to make font installation uniform |
10 | # @BLURB: Eclass to make font installation uniform |
| 11 | |
11 | |
| 12 | inherit eutils |
12 | inherit eutils |
|
|
13 | |
|
|
14 | |
|
|
15 | EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm |
| 13 | |
16 | |
| 14 | # |
17 | # |
| 15 | # Variable declarations |
18 | # Variable declarations |
| 16 | # |
19 | # |
| 17 | |
20 | |
| … | |
… | |
| 148 | font_pkg_postinst() { |
151 | font_pkg_postinst() { |
| 149 | # unreadable font files = fontconfig segfaults |
152 | # unreadable font files = fontconfig segfaults |
| 150 | find "${ROOT}"usr/share/fonts/ -type f '!' -perm 0644 -print0 \ |
153 | find "${ROOT}"usr/share/fonts/ -type f '!' -perm 0644 -print0 \ |
| 151 | | xargs -0 chmod -v 0644 2>/dev/null |
154 | | xargs -0 chmod -v 0644 2>/dev/null |
| 152 | |
155 | |
|
|
156 | if [[ -n ${FONT_CONF[@]} ]]; then |
|
|
157 | if has_version '>=media-libs/fontconfig-2.4'; then |
|
|
158 | local conffile |
|
|
159 | echo |
|
|
160 | elog "The following fontconfig configuration files have been installed:" |
|
|
161 | elog |
|
|
162 | for conffile in "${FONT_CONF[@]}"; do |
|
|
163 | if [[ -e ${ROOT}etc/fonts/conf.avail/$(basename ${conffile}) ]]; then |
|
|
164 | elog " $(basename ${conffile})" |
|
|
165 | fi |
|
|
166 | done |
|
|
167 | elog |
|
|
168 | elog "Use \`eselect fontconfig\` to enable/disable them." |
|
|
169 | echo |
|
|
170 | fi |
|
|
171 | fi |
|
|
172 | |
| 153 | if has_version '>=media-libs/fontconfig-2.4'; then |
173 | if has_version '>=media-libs/fontconfig-2.4'; then |
| 154 | if [[ ${ROOT} == "/" ]]; then |
174 | if [[ ${ROOT} == "/" ]]; then |
| 155 | ebegin "Updating global fontcache" |
175 | ebegin "Updating global fontcache" |
| 156 | fc-cache -fs |
176 | fc-cache -fs |
| 157 | eend $? |
177 | eend $? |
| … | |
… | |
| 174 | eend $? |
194 | eend $? |
| 175 | fi |
195 | fi |
| 176 | fi |
196 | fi |
| 177 | } |
197 | } |
| 178 | |
198 | |
| 179 | EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm |
|
|