1 |
vapier |
1.10 |
# Copyright 1999-2002 Gentoo Technologies, Inc. |
2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
3 |
satai |
1.7 |
# Author Matthew Turk <satai@gentoo.org> |
4 |
satai |
1.12 |
# $Header: /home/cvsroot/gentoo-x86/eclass/latex-package.eclass,v 1.11 2002/11/05 03:58:33 satai Exp $ |
5 |
satai |
1.5 |
# |
6 |
|
|
# 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 |
8 |
|
|
# successful installation. If fonts need to be installed, then the variable |
9 |
|
|
# SUPPLIER must also be defined. |
10 |
|
|
# |
11 |
|
|
# However, those packages that contain subdirectories must process each |
12 |
|
|
# subdirectory individually. For example, a package that contains directories |
13 |
|
|
# DIR1 and DIR2 must call latex-package_src_compile() and |
14 |
|
|
# latex-package_src_install() in each directory, as shown here: |
15 |
|
|
# |
16 |
|
|
# src_compile() { |
17 |
|
|
# cd ${S} |
18 |
|
|
# cd DIR1 |
19 |
|
|
# latex-package_src_compile |
20 |
|
|
# cd .. |
21 |
|
|
# cd DIR2 |
22 |
|
|
# latex-package_src_compile |
23 |
|
|
# } |
24 |
|
|
# |
25 |
|
|
# src_install() { |
26 |
|
|
# cd ${S} |
27 |
|
|
# cd DIR1 |
28 |
|
|
# latex-package_src_install |
29 |
|
|
# cd .. |
30 |
|
|
# cd DIR2 |
31 |
|
|
# latex-package_src_install |
32 |
|
|
# } |
33 |
|
|
# |
34 |
|
|
# 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 |
36 |
|
|
# TeX files that come with the source. Note that we break TeX layout standards |
37 |
|
|
# by placing documentation in /usr/share/doc/${PN} |
38 |
|
|
# |
39 |
|
|
# For examples of basic installations, check out app-text/latex-aastex and |
40 |
|
|
# app-text/latex-leaflet. |
41 |
|
|
# |
42 |
|
|
# 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, |
44 |
|
|
# you must either grab each file individually, or find a place to mirror an |
45 |
|
|
# archive of them. (iBiblio) |
46 |
blocke |
1.1 |
|
47 |
|
|
inherit base |
48 |
danarmak |
1.3 |
INHERITED="$INHERITED $ECLASS" |
49 |
blocke |
1.1 |
|
50 |
satai |
1.6 |
newdepend ">=app-text/tetex-1.0.7 |
51 |
satai |
1.9 |
>=sys-apps/texinfo-4.2-r5" |
52 |
satai |
1.5 |
ECLASS=latex-package |
53 |
blocke |
1.1 |
HOMEPAGE="http://www.tug.org/" |
54 |
|
|
SRC_URI="ftp://tug.ctan.org/macros/latex/" |
55 |
|
|
S=${WORKDIR}/${P} |
56 |
|
|
TEXMF="/usr/share/texmf" |
57 |
|
|
SUPPLIER="misc" # This refers to the font supplier; it should be overridden |
58 |
|
|
|
59 |
|
|
latex-package_src_doinstall() { |
60 |
|
|
debug-print function $FUNCNAME $* |
61 |
|
|
# This actually follows the directions for a "single-user" system |
62 |
|
|
# at http://www.ctan.org/installationadvice/ modified for gentoo. |
63 |
|
|
[ -z "$1" ] && latex-package_src_install all |
64 |
satai |
1.5 |
|
65 |
blocke |
1.1 |
while [ "$1" ]; do |
66 |
|
|
case $1 in |
67 |
|
|
"sh") |
68 |
satai |
1.5 |
for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
69 |
blocke |
1.1 |
do |
70 |
|
|
dobin $i |
71 |
|
|
done |
72 |
|
|
;; |
73 |
satai |
1.5 |
"sty" | "cls" | "fd" | "clo" | "def") |
74 |
|
|
for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
75 |
blocke |
1.1 |
do |
76 |
|
|
insinto ${TEXMF}/tex/latex/${PN} |
77 |
|
|
doins $i |
78 |
|
|
done |
79 |
|
|
;; |
80 |
satai |
1.6 |
"dvi" | "ps" | "pdf") |
81 |
satai |
1.5 |
for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
82 |
blocke |
1.1 |
do |
83 |
satai |
1.8 |
insinto /usr/share/doc/${P} |
84 |
|
|
doins $i |
85 |
|
|
#dodoc -u $i |
86 |
blocke |
1.1 |
done |
87 |
|
|
;; |
88 |
satai |
1.11 |
"tex" | "dtx") |
89 |
|
|
for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
90 |
|
|
do |
91 |
satai |
1.12 |
einfo "Making documentation: $i" |
92 |
satai |
1.11 |
texi2dvi -q -c --language=latex $i &> /dev/null |
93 |
|
|
done |
94 |
|
|
;; |
95 |
blocke |
1.1 |
"tfm" | "vf" | "afm" | "pfb") |
96 |
satai |
1.5 |
for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
97 |
blocke |
1.1 |
do |
98 |
|
|
insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} |
99 |
|
|
doins $i |
100 |
|
|
done |
101 |
|
|
;; |
102 |
|
|
"ttf") |
103 |
satai |
1.5 |
for i in `find . -maxdepth 1 -type f -name "*.ttf"` |
104 |
blocke |
1.1 |
do |
105 |
|
|
insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN} |
106 |
|
|
doins $i |
107 |
|
|
done |
108 |
|
|
;; |
109 |
|
|
"styles") |
110 |
satai |
1.5 |
latex-package_src_doinstall sty cls fd clo def |
111 |
blocke |
1.1 |
;; |
112 |
|
|
"doc") |
113 |
satai |
1.6 |
latex-package_src_doinstall tex dtx dvi ps pdf |
114 |
blocke |
1.1 |
;; |
115 |
|
|
"fonts") |
116 |
|
|
latex-package_src_doinstall tfm vg afm pfb ttf |
117 |
|
|
;; |
118 |
|
|
"bin") |
119 |
|
|
latex-package_src_doinstall sh |
120 |
|
|
;; |
121 |
|
|
"all") |
122 |
satai |
1.7 |
latex-package_src_doinstall styles fonts bin doc |
123 |
blocke |
1.1 |
;; |
124 |
|
|
esac |
125 |
|
|
shift |
126 |
|
|
done |
127 |
|
|
} |
128 |
|
|
|
129 |
|
|
latex-package_src_compile() { |
130 |
|
|
debug-print function $FUNCNAME $* |
131 |
|
|
cd ${S} |
132 |
satai |
1.5 |
for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` |
133 |
blocke |
1.1 |
do |
134 |
satai |
1.12 |
einfo "Extracting from $i" |
135 |
|
|
latex --interaction=batchmode $i &> /dev/null |
136 |
blocke |
1.1 |
done |
137 |
|
|
} |
138 |
|
|
|
139 |
|
|
latex-package_src_install() { |
140 |
|
|
debug-print function $FUNCNAME $* |
141 |
|
|
cd ${S} |
142 |
|
|
latex-package_src_doinstall all |
143 |
|
|
} |
144 |
|
|
|
145 |
|
|
latex-package_pkg_postinst() { |
146 |
|
|
debug-print function $FUNCNAME $* |
147 |
|
|
latex-package_rehash |
148 |
|
|
} |
149 |
|
|
|
150 |
|
|
latex-package_pkg_postrm() { |
151 |
|
|
debug-print function $FUNCNAME $* |
152 |
|
|
latex-package_rehash |
153 |
|
|
} |
154 |
|
|
|
155 |
|
|
latex-package_rehash() { |
156 |
|
|
debug-print function $FUNCNAME $* |
157 |
|
|
texconfig rehash |
158 |
|
|
} |
159 |
|
|
|
160 |
|
|
EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |