/[gentoo-x86]/eclass/latex-package.eclass
Gentoo

Diff of /eclass/latex-package.eclass

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

Revision 1.27 Revision 1.33
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2008 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/latex-package.eclass,v 1.27 2006/02/28 11:09:25 nattfodd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/latex-package.eclass,v 1.33 2008/02/17 19:03:07 aballier Exp $
4# 4
5# @ECLASS: latex-package.eclass
6# @MAINTAINER:
7# TeX team <tex@gentoo.org>
8#
5# Author Matthew Turk <satai@gentoo.org> 9# Author Matthew Turk <satai@gentoo.org>
6# 10# Martin Ehmsen <ehmsen@gentoo.org>
11# @BLURB: An eclass for easy installation of LaTeX packages
12# @DESCRIPTION:
7# This eClass is designed to be easy to use and implement. The vast majority of 13# This eClass is designed to be easy to use and implement. The vast majority of
8# LaTeX packages will only need to define SRC_URI (and sometimes S) for a 14# LaTeX packages will only need to define SRC_URI (and sometimes S) for a
9# successful installation. If fonts need to be installed, then the variable 15# successful installation. If fonts need to be installed, then the variable
10# SUPPLIER must also be defined. 16# SUPPLIER must also be defined.
11# 17#
42# 48#
43# NOTE: The CTAN "directory grab" function creates files with different MD5 49# NOTE: The CTAN "directory grab" function creates files with different MD5
44# signatures EVERY TIME. For this reason, if you are grabbing from the CTAN, 50# signatures EVERY TIME. For this reason, if you are grabbing from the CTAN,
45# you must either grab each file individually, or find a place to mirror an 51# you must either grab each file individually, or find a place to mirror an
46# archive of them. (iBiblio) 52# archive of them. (iBiblio)
53#
54# It inherits base.
47 55
48inherit base 56inherit base
49 57
50DEPEND="virtual/tetex 58DEPEND="virtual/latex-base
51 >=sys-apps/texinfo-4.2-r5" 59 >=sys-apps/texinfo-4.2-r5"
52HOMEPAGE="http://www.tug.org/" 60HOMEPAGE="http://www.tug.org/"
53SRC_URI="ftp://tug.ctan.org/macros/latex/" 61SRC_URI="ftp://tug.ctan.org/macros/latex/"
54S=${WORKDIR}/${P} 62S=${WORKDIR}/${P}
55TEXMF="/usr/share/texmf" 63TEXMF="/usr/share/texmf"
64
65# @ECLASS-VARIABLE: SUPPLIER
66# @DESCRIPTION:
56SUPPLIER="misc" # This refers to the font supplier; it should be overridden 67# This refers to the font supplier; it should be overridden (see eclass
68# DESCRIPTION above)
69SUPPLIER="misc"
57 70
71# @FUNCTION: latex-package_has_tetex3
72# @RETURN: true if at least one of (>=tetex-3 or >=ptex-3.1.8 or >=texlive-core-2007) is installed, else false
73# @DESCRIPTION:
74# It is often used to know if the current TeX installation supports gentoo's
75# texmf-update or if the package has to do it the old way
58latex-package_has_tetex_3() { 76latex-package_has_tetex_3() {
59 if has_version '>=app-text/tetex-3' || has_version '>=app-text/ptex-3.1.8' ; then 77 if has_version '>=app-text/tetex-3' || has_version '>=app-text/ptex-3.1.8' || has_version '>=app-text/texlive-core-2007' ; then
60 true 78 true
61 else 79 else
62 false 80 false
63 fi 81 fi
64} 82}
65 83
84# @FUNCTION: latex-package_src_doinstall
85# @USAGE: [ module ]
86# @DESCRIPTION:
87# [module] can be one or more of: sh, sty, cls, fd, clo, def, cfg, dvi, ps, pdf,
88# tex, dtx, tfm, vf, afm, pfb, ttf, bst, styles, doc, fonts, bin, or all.
89# If [module] is not given, all is assumed.
90# It installs the files found in the current directory to the standard locations
91# for a TeX installation
66latex-package_src_doinstall() { 92latex-package_src_doinstall() {
67 debug-print function $FUNCNAME $* 93 debug-print function $FUNCNAME $*
68 # This actually follows the directions for a "single-user" system 94 # This actually follows the directions for a "single-user" system
69 # at http://www.ctan.org/installationadvice/ modified for gentoo. 95 # at http://www.ctan.org/installationadvice/ modified for gentoo.
70 [ -z "$1" ] && latex-package_src_install all 96 [ -z "$1" ] && latex-package_src_install all
145 esac 171 esac
146 shift 172 shift
147 done 173 done
148} 174}
149 175
176# @FUNCTION: latex-package_src_compile
177# @DESCRIPTION:
178# Calls latex for each *.ins in the current directory in order to generate the
179# relevant files that will be installed
150latex-package_src_compile() { 180latex-package_src_compile() {
151 debug-print function $FUNCNAME $* 181 debug-print function $FUNCNAME $*
152 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` 182 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
153 do 183 do
154 einfo "Extracting from $i" 184 einfo "Extracting from $i"
155 latex --interaction=batchmode $i &> /dev/null 185 latex --interaction=batchmode $i &> /dev/null
156 done 186 done
157} 187}
158 188
189# @FUNCTION: latex-package_src_install
190# @DESCRIPTION:
191# Installs the package
159latex-package_src_install() { 192latex-package_src_install() {
160 debug-print function $FUNCNAME $* 193 debug-print function $FUNCNAME $*
161 latex-package_src_doinstall all 194 latex-package_src_doinstall all
162 if [ -n "${DOCS}" ] ; then 195 if [ -n "${DOCS}" ] ; then
163 dodoc ${DOCS} 196 dodoc ${DOCS}
164 fi 197 fi
165} 198}
166 199
200# @FUNCTION: latex-pacakge_pkg_postinst
201# @DESCRIPTION:
202# Calls latex-package_rehash to ensure the TeX installation is consistent with
203# the kpathsea database
167latex-package_pkg_postinst() { 204latex-package_pkg_postinst() {
168 debug-print function $FUNCNAME $* 205 debug-print function $FUNCNAME $*
169 latex-package_rehash 206 latex-package_rehash
170} 207}
171 208
209# @FUNCTION: latex-package_pkg_postrm
210# @DESCRIPTION:
211# Calls latex-package_rehash to ensure the TeX installation is consistent with
212# the kpathsea database
172latex-package_pkg_postrm() { 213latex-package_pkg_postrm() {
173 debug-print function $FUNCNAME $* 214 debug-print function $FUNCNAME $*
174 latex-package_rehash 215 latex-package_rehash
175} 216}
176 217
218# @FUNCTION: latex-package_rehash
219# @DESCRIPTION:
220# Rehashes the kpathsea database, according to the current TeX installation
177latex-package_rehash() { 221latex-package_rehash() {
178 debug-print function $FUNCNAME $* 222 debug-print function $FUNCNAME $*
179 if latex-package_has_tetex_3 ; then 223 if latex-package_has_tetex_3 ; then
180 texmf-update 224 texmf-update
181 else 225 else

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20