/[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.1.1.1 Revision 1.41
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2015 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.1.1.1 2005/11/30 09:59:35 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/latex-package.eclass,v 1.41 2015/05/17 11:10:22 ulm 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# 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 58RDEPEND="virtual/latex-base"
59DEPEND="${RDEPEND}
51 >=sys-apps/texinfo-4.2-r5" 60 >=sys-apps/texinfo-4.2-r5"
52HOMEPAGE="http://www.tug.org/" 61HOMEPAGE="http://www.tug.org/"
53SRC_URI="ftp://tug.ctan.org/macros/latex/" 62SRC_URI="ftp://tug.ctan.org/macros/latex/"
54S=${WORKDIR}/${P} 63S=${WORKDIR}/${P}
55TEXMF="/usr/share/texmf" 64TEXMF="/usr/share/texmf-site"
65
66# @ECLASS-VARIABLE: SUPPLIER
67# @DESCRIPTION:
56SUPPLIER="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"
57 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
58latex-package_has_tetex_3() { 77latex-package_has_tetex_3() {
59 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
60 true 79 true
61 else 80 else
62 false 81 false
63 fi 82 fi
64} 83}
65 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
66latex-package_src_doinstall() { 93latex-package_src_doinstall() {
67 debug-print function $FUNCNAME $* 94 debug-print function $FUNCNAME $*
68 # This actually follows the directions for a "single-user" system 95 # This actually follows the directions for a "single-user" system
69 # at http://www.ctan.org/installationadvice/ modified for gentoo. 96 # at http://www.ctan.org/installationadvice/ modified for gentoo.
70 [ -z "$1" ] && latex-package_src_install all 97 [ -z "$1" ] && latex-package_src_install all
85 done 112 done
86 ;; 113 ;;
87 "dvi" | "ps" | "pdf") 114 "dvi" | "ps" | "pdf")
88 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 115 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
89 do 116 do
90 insinto /usr/share/doc/${P} 117 insinto /usr/share/doc/${PF}
91 doins $i || "doins $i failed" 118 doins $i || die "doins $i failed"
92 #dodoc -u $i 119 dosym /usr/share/doc/${PF}/$(basename ${i}) ${TEXMF}/doc/latex/${PN}/${i}
120 case "${EAPI:-0}" in
121 0|1|2|3) ;;
122 *)
123 # prevent compression of symlink target
124 docompress -x /usr/share/doc/${PF}/$(basename ${i})
125 ;;
126 esac
93 done 127 done
94 ;; 128 ;;
95 "tex" | "dtx") 129 "tex" | "dtx")
96 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 130 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
97 do 131 do
145 esac 179 esac
146 shift 180 shift
147 done 181 done
148} 182}
149 183
184# @FUNCTION: latex-package_src_compile
185# @DESCRIPTION:
186# Calls latex for each *.ins in the current directory in order to generate the
187# relevant files that will be installed
150latex-package_src_compile() { 188latex-package_src_compile() {
151 debug-print function $FUNCNAME $* 189 debug-print function $FUNCNAME $*
152 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` 190 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
153 do 191 do
154 einfo "Extracting from $i" 192 einfo "Extracting from $i"
155 latex --interaction=batchmode $i &> /dev/null 193 latex --interaction=batchmode $i &> /dev/null
156 done 194 done
157} 195}
158 196
197# @FUNCTION: latex-package_src_install
198# @DESCRIPTION:
199# Installs the package
159latex-package_src_install() { 200latex-package_src_install() {
160 debug-print function $FUNCNAME $* 201 debug-print function $FUNCNAME $*
161 latex-package_src_doinstall all 202 latex-package_src_doinstall all
162 if [ -n "${DOCS}" ] ; then 203 if [ -n "${DOCS}" ] ; then
163 dodoc ${DOCS} 204 dodoc ${DOCS}
164 fi 205 fi
165} 206}
166 207
208# @FUNCTION: latex-package_pkg_postinst
209# @DESCRIPTION:
210# Calls latex-package_rehash to ensure the TeX installation is consistent with
211# the kpathsea database
167latex-package_pkg_postinst() { 212latex-package_pkg_postinst() {
168 debug-print function $FUNCNAME $* 213 debug-print function $FUNCNAME $*
169 latex-package_rehash 214 latex-package_rehash
170} 215}
171 216
217# @FUNCTION: latex-package_pkg_postrm
218# @DESCRIPTION:
219# Calls latex-package_rehash to ensure the TeX installation is consistent with
220# the kpathsea database
172latex-package_pkg_postrm() { 221latex-package_pkg_postrm() {
173 debug-print function $FUNCNAME $* 222 debug-print function $FUNCNAME $*
174 latex-package_rehash 223 latex-package_rehash
175} 224}
176 225
226# @FUNCTION: latex-package_rehash
227# @DESCRIPTION:
228# Rehashes the kpathsea database, according to the current TeX installation
177latex-package_rehash() { 229latex-package_rehash() {
178 debug-print function $FUNCNAME $* 230 debug-print function $FUNCNAME $*
179 if latex-package_has_tetex_3 ; then 231 if latex-package_has_tetex_3 ; then
180 texmf-update 232 texmf-update
181 else 233 else
182 texconfig rehash 234 texconfig rehash
183 fi 235 fi
184} 236}
185 237
186EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm has_tetex_3 238EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20