/[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.11 Revision 1.30
1# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2006 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 $
4#
3# Author Matthew Turk <satai@gentoo.org> 5# Author Matthew Turk <satai@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/latex-package.eclass,v 1.11 2002/11/05 03:58:33 satai Exp $ 6# Martin Ehmsen <ehmsen@gentoo.org>
7# Maintained by the text-markup team <text-markup@gentoo.org>
5# 8#
6# This eClass is designed to be easy to use and implement. The vast majority of 9# This eClass is designed to be easy to use and implement. The vast majority of
7# LaTeX packages will only need to define SRC_URI (and sometimes S) for a 10# LaTeX packages will only need to define SRC_URI (and sometimes S) for a
8# successful installation. If fonts need to be installed, then the variable 11# successful installation. If fonts need to be installed, then the variable
9# SUPPLIER must also be defined. 12# SUPPLIER must also be defined.
31# latex-package_src_install 34# latex-package_src_install
32# } 35# }
33# 36#
34# The eClass automatically takes care of rehashing TeX's cache (ls-lR) after 37# The eClass automatically takes care of rehashing TeX's cache (ls-lR) after
35# installation and after removal, as well as creating final documentation from 38# installation and after removal, as well as creating final documentation from
36# TeX files that come with the source. Note that we break TeX layout standards 39# TeX files that come with the source. Note that we break TeX layout standards
37# by placing documentation in /usr/share/doc/${PN} 40# by placing documentation in /usr/share/doc/${PN}
38# 41#
39# For examples of basic installations, check out app-text/latex-aastex and 42# For examples of basic installations, check out dev-tex/aastex and
40# app-text/latex-leaflet. 43# dev-tex/leaflet .
41# 44#
42# NOTE: The CTAN "directory grab" function creates files with different MD5 45# NOTE: The CTAN "directory grab" function creates files with different MD5
43# signatures EVERY TIME. For this reason, if you are grabbing from the CTAN, 46# signatures EVERY TIME. For this reason, if you are grabbing from the CTAN,
44# you must either grab each file individually, or find a place to mirror an 47# you must either grab each file individually, or find a place to mirror an
45# archive of them. (iBiblio) 48# archive of them. (iBiblio)
46 49
47inherit base 50inherit base
48INHERITED="$INHERITED $ECLASS"
49 51
50newdepend ">=app-text/tetex-1.0.7 52DEPEND="virtual/latex-base
51 >=sys-apps/texinfo-4.2-r5" 53 >=sys-apps/texinfo-4.2-r5"
52ECLASS=latex-package
53HOMEPAGE="http://www.tug.org/" 54HOMEPAGE="http://www.tug.org/"
54SRC_URI="ftp://tug.ctan.org/macros/latex/" 55SRC_URI="ftp://tug.ctan.org/macros/latex/"
55S=${WORKDIR}/${P} 56S=${WORKDIR}/${P}
56TEXMF="/usr/share/texmf" 57TEXMF="/usr/share/texmf"
57SUPPLIER="misc" # This refers to the font supplier; it should be overridden 58SUPPLIER="misc" # This refers to the font supplier; it should be overridden
58 59
60latex-package_has_tetex_3() {
61 if has_version '>=app-text/tetex-3' || has_version '>=app-text/ptex-3.1.8' ; then
62 true
63 else
64 false
65 fi
66}
67
59latex-package_src_doinstall() { 68latex-package_src_doinstall() {
60 debug-print function $FUNCNAME $* 69 debug-print function $FUNCNAME $*
61 # This actually follows the directions for a "single-user" system 70 # This actually follows the directions for a "single-user" system
62 # at http://www.ctan.org/installationadvice/ modified for gentoo. 71 # at http://www.ctan.org/installationadvice/ modified for gentoo.
63 [ -z "$1" ] && latex-package_src_install all 72 [ -z "$1" ] && latex-package_src_install all
64 73
65 while [ "$1" ]; do 74 while [ "$1" ]; do
66 case $1 in 75 case $1 in
67 "sh") 76 "sh")
68 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 77 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
69 do 78 do
70 dobin $i 79 dobin $i || die "dobin $i failed"
71 done 80 done
72 ;; 81 ;;
73 "sty" | "cls" | "fd" | "clo" | "def") 82 "sty" | "cls" | "fd" | "clo" | "def" | "cfg")
74 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 83 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
75 do 84 do
76 insinto ${TEXMF}/tex/latex/${PN} 85 insinto ${TEXMF}/tex/latex/${PN}
77 doins $i 86 doins $i || die "doins $i failed"
78 done 87 done
79 ;; 88 ;;
80 "dvi" | "ps" | "pdf") 89 "dvi" | "ps" | "pdf")
81 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 90 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
82 do 91 do
83 insinto /usr/share/doc/${P} 92 insinto /usr/share/doc/${P}
84 doins $i 93 doins $i || "doins $i failed"
85 #dodoc -u $i 94 #dodoc -u $i
86 done 95 done
87 ;; 96 ;;
88 "tex" | "dtx") 97 "tex" | "dtx")
89 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 98 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
90 do 99 do
91 echo "Making documentation: $i" 100 einfo "Making documentation: $i"
92 texi2dvi -q -c --language=latex $i &> /dev/null 101 texi2dvi -q -c --language=latex $i &> /dev/null
93 done 102 done
94 ;; 103 ;;
95 "tfm" | "vf" | "afm" | "pfb") 104 "tfm" | "vf" | "afm")
96 for i in `find . -maxdepth 1 -type f -name "*.${1}"` 105 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
97 do 106 do
98 insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} 107 insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
99 doins $i 108 doins $i || die "doins $i failed"
100 done 109 done
101 ;; 110 ;;
102 "ttf") 111 "pfb")
112 for i in `find . -maxdepth 1 -type f -name "*.pfb"`
113 do
114 insinto ${TEXMF}/fonts/type1/${SUPPLIER}/${PN}
115 doins $i || die "doins $i failed"
116 done
117 ;;
118 "ttf")
103 for i in `find . -maxdepth 1 -type f -name "*.ttf"` 119 for i in `find . -maxdepth 1 -type f -name "*.ttf"`
104 do 120 do
105 insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN} 121 insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
106 doins $i 122 doins $i || die "doins $i failed"
107 done 123 done
108 ;; 124 ;;
109 "styles") 125 "bst")
126 for i in `find . -maxdepth 1 -type f -name "*.bst"`
127 do
128 insinto ${TEXMF}/bibtex/bst/${PN}
129 doins $i || die "doins $i failed"
130 done
131 ;;
132 "styles")
110 latex-package_src_doinstall sty cls fd clo def 133 latex-package_src_doinstall sty cls fd clo def cfg bst
111 ;; 134 ;;
112 "doc") 135 "doc")
113 latex-package_src_doinstall tex dtx dvi ps pdf 136 latex-package_src_doinstall tex dtx dvi ps pdf
114 ;; 137 ;;
115 "fonts") 138 "fonts")
116 latex-package_src_doinstall tfm vg afm pfb ttf 139 latex-package_src_doinstall tfm vf afm pfb ttf
117 ;; 140 ;;
118 "bin") 141 "bin")
119 latex-package_src_doinstall sh 142 latex-package_src_doinstall sh
120 ;; 143 ;;
121 "all") 144 "all")
122 latex-package_src_doinstall styles fonts bin doc 145 latex-package_src_doinstall styles fonts bin doc
123 ;; 146 ;;
124 esac 147 esac
125 shift 148 shift
126 done 149 done
127} 150}
128 151
129latex-package_src_compile() { 152latex-package_src_compile() {
130 debug-print function $FUNCNAME $* 153 debug-print function $FUNCNAME $*
131 cd ${S}
132 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` 154 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
133 do 155 do
134 echo "Extracting from $i" 156 einfo "Extracting from $i"
135 latex --interaction=batchmode $i > /dev/null 157 latex --interaction=batchmode $i &> /dev/null
136 done 158 done
137} 159}
138 160
139latex-package_src_install() { 161latex-package_src_install() {
140 debug-print function $FUNCNAME $* 162 debug-print function $FUNCNAME $*
141 cd ${S}
142 latex-package_src_doinstall all 163 latex-package_src_doinstall all
164 if [ -n "${DOCS}" ] ; then
165 dodoc ${DOCS}
166 fi
143} 167}
144 168
145latex-package_pkg_postinst() { 169latex-package_pkg_postinst() {
146 debug-print function $FUNCNAME $* 170 debug-print function $FUNCNAME $*
147 latex-package_rehash 171 latex-package_rehash
148} 172}
149 173
150latex-package_pkg_postrm() { 174latex-package_pkg_postrm() {
151 debug-print function $FUNCNAME $* 175 debug-print function $FUNCNAME $*
152 latex-package_rehash 176 latex-package_rehash
153} 177}
154 178
155latex-package_rehash() { 179latex-package_rehash() {
156 debug-print function $FUNCNAME $* 180 debug-print function $FUNCNAME $*
181 if latex-package_has_tetex_3 ; then
182 texmf-update
183 else
157 texconfig rehash 184 texconfig rehash
185 fi
158} 186}
159 187
160EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm 188EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20