/[gentoo-x86]/eclass/texlive-module.eclass
Gentoo

Diff of /eclass/texlive-module.eclass

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

Revision 1.53 Revision 1.60
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2011 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/texlive-module.eclass,v 1.53 2010/10/23 23:51:58 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.60 2011/08/29 01:28:10 vapier Exp $
4 4
5# @ECLASS: texlive-module.eclass 5# @ECLASS: texlive-module.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# tex@gentoo.org 7# tex@gentoo.org
8# 8# @AUTHOR:
9# Original Author: Alexis Ballier <aballier@gentoo.org> 9# Original Author: Alexis Ballier <aballier@gentoo.org>
10# @BLURB: Provide generic install functions so that modular texlive's texmf ebuild will only have to inherit this eclass 10# @BLURB: Provide generic install functions so that modular texlive's texmf ebuild will only have to inherit this eclass
11# @DESCRIPTION: 11# @DESCRIPTION:
12# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will 12# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
13# only have to inherit this eclass. 13# only have to inherit this eclass.
18# texmf and texmf-dist directories to ${WORKDIR} (which is what the default 18# texmf and texmf-dist directories to ${WORKDIR} (which is what the default
19# src_unpack does). 19# src_unpack does).
20# Starting from TeX Live 2009, the eclass provides a src_unpack function taking 20# Starting from TeX Live 2009, the eclass provides a src_unpack function taking
21# care of unpacking and relocating the files that need it. 21# care of unpacking and relocating the files that need it.
22# 22#
23# It inherits texlive-common. 23# It inherits texlive-common and base for supporting patching via the PATCHES
24# bash array with EAPI>=2.
24 25
25# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS 26# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS
26# @DESCRIPTION: 27# @DESCRIPTION:
27# The list of packages that will be installed. This variable will be expanded to 28# The list of packages that will be installed. This variable will be expanded to
28# SRC_URI: 29# SRC_URI:
52# @DESCRIPTION: 53# @DESCRIPTION:
53# Normally the module's PV reflects the TeXLive release it belongs to. 54# Normally the module's PV reflects the TeXLive release it belongs to.
54# If this is not the case, TL_PV takes the version number for the 55# If this is not the case, TL_PV takes the version number for the
55# needed app-text/texlive-core. 56# needed app-text/texlive-core.
56 57
58# @ECLASS-VARIABLE: TL_MODULE_INFORMATION
59# @DESCRIPTION:
60# Information to display about the package.
61# e.g. for enabling/disabling a feature
62
57inherit texlive-common 63inherit texlive-common base
58 64
59HOMEPAGE="http://www.tug.org/texlive/" 65HOMEPAGE="http://www.tug.org/texlive/"
60 66
61COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}" 67COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}"
62 68
112RELOC_TARGET=texmf-dist 118RELOC_TARGET=texmf-dist
113 119
114texlive-module_src_unpack() { 120texlive-module_src_unpack() {
115 if has "${EAPI:-0}" 0 1 2 ; then 121 if has "${EAPI:-0}" 0 1 2 ; then
116 local i s 122 local i s
123 # Avoid installing world writable files
124 # Bugs #309997, #310039, #338881
125 umask 022
117 for i in ${A} 126 for i in ${A}
118 do 127 do
119 s="${DISTDIR%/}/${i}" 128 s="${DISTDIR%/}/${i}"
120 einfo "Unpacking ${s} to ${PWD}" 129 einfo "Unpacking ${s} to ${PWD}"
121 test -s "${s}" || die "${s} does not exist" 130 test -s "${s}" || die "${s} does not exist"
217 226
218texlive-module_make_language_lua_lines() { 227texlive-module_make_language_lua_lines() {
219 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions luaspecial 228 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions luaspecial
220 local dest="${S}/language.${PN}.dat.lua" 229 local dest="${S}/language.${PN}.dat.lua"
221 eval $@ 230 eval $@
231 [ -z "$lefthyphenmin" ] && lefthyphenmin="2"
232 [ -z "$righthyphenmin" ] && righthyphenmin="3"
222 einfo "Generating language.dat.lua entry for $@" 233 einfo "Generating language.dat.lua entry for $@"
223 printf "\t['%s'] = {\n" "$name" >> "$dest" 234 printf "\t['%s'] = {\n" "$name" >> "$dest"
224 printf "\t\tloader = '%s',\n" "$file" >> "$dest" 235 printf "\t\tloader = '%s',\n" "$file" >> "$dest"
225 printf "\t\tlefthyphenmin = %s,\n\t\trighthyphenmin = %s,\n" "$lefthyphenmin" "$righthyphenmin" >> "$dest" 236 printf "\t\tlefthyphenmin = %s,\n\t\trighthyphenmin = %s,\n" "$lefthyphenmin" "$righthyphenmin" >> "$dest"
226 printf "\t\tsynonyms = {%s },\n" "$(texlive-module_synonyms_to_language_lua_line "$synonyms")" >> "$dest" 237 printf "\t\tsynonyms = {%s },\n" "$(texlive-module_synonyms_to_language_lua_line "$synonyms")" >> "$dest"
234# @DESCRIPTION: 245# @DESCRIPTION:
235# exported function: 246# exported function:
236# Generates the config files that are to be installed in /etc/texmf; 247# Generates the config files that are to be installed in /etc/texmf;
237# texmf-update script will take care of merging the different config files for 248# texmf-update script will take care of merging the different config files for
238# different packages in a single one used by the whole tex installation. 249# different packages in a single one used by the whole tex installation.
239# 250#
240# Once the config files are generated, we build the format files using fmtutil 251# Once the config files are generated, we build the format files using fmtutil
241# (provided by texlive-core). The compiled format files will be sent to 252# (provided by texlive-core). The compiled format files will be sent to
242# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the 253# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the
243# sandbox. 254# sandbox.
244 255
352# exported function: 363# exported function:
353# Run texmf-update to ensure the tex installation is consistent with the 364# Run texmf-update to ensure the tex installation is consistent with the
354# installed texmf trees. 365# installed texmf trees.
355 366
356texlive-module_pkg_postinst() { 367texlive-module_pkg_postinst() {
357 if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then 368 etexmf-update
358 /usr/sbin/texmf-update 369 [ -n "${TL_MODULE_INFORMATION}" ] && elog "${TL_MODULE_INFORMATION}"
359 else
360 ewarn "Cannot run texmf-update for some reason."
361 ewarn "Your texmf tree might be inconsistent with your configuration"
362 ewarn "Please try to figure what has happened"
363 fi
364} 370}
365 371
366# @FUNCTION: texlive-module_pkg_postrm 372# @FUNCTION: texlive-module_pkg_postrm
367# @DESCRIPTION: 373# @DESCRIPTION:
368# exported function: 374# exported function:
369# Run texmf-update to ensure the tex installation is consistent with the 375# Run texmf-update to ensure the tex installation is consistent with the
370# installed texmf trees. 376# installed texmf trees.
371 377
372texlive-module_pkg_postrm() { 378texlive-module_pkg_postrm() {
373 if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then 379 etexmf-update
374 /usr/sbin/texmf-update
375 else
376 ewarn "Cannot run texmf-update for some reason."
377 ewarn "Your texmf tree might be inconsistent with your configuration"
378 ewarn "Please try to figure what has happened"
379 fi
380} 380}
381 381
382if [ "${PV#2008}" != "${PV}" ]; then 382if [ "${PV#2008}" != "${PV}" ]; then
383EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm 383EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
384else 384else

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.60

  ViewVC Help
Powered by ViewVC 1.1.20