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

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

  ViewVC Help
Powered by ViewVC 1.1.20