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

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20