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

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20