/[gentoo-x86]/eclass/latex-package.eclass
Gentoo

Contents of /eclass/latex-package.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Fri Oct 25 19:57:51 2002 UTC (11 years, 8 months ago) by vapier
Branch: MAIN
Changes since 1.9: +3 -0 lines
Header updates/cleanups

1 # Copyright 1999-2002 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # Author Matthew Turk <satai@gentoo.org>
4 # $Header: $
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
47 inherit base
48 INHERITED="$INHERITED $ECLASS"
49
50 newdepend ">=app-text/tetex-1.0.7
51 >=sys-apps/texinfo-4.2-r5"
52 ECLASS=latex-package
53 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
65 while [ "$1" ]; do
66 case $1 in
67 "sh")
68 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
69 do
70 dobin $i
71 done
72 ;;
73 "sty" | "cls" | "fd" | "clo" | "def")
74 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
75 do
76 insinto ${TEXMF}/tex/latex/${PN}
77 doins $i
78 done
79 ;;
80 "dvi" | "ps" | "pdf")
81 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
82 do
83 insinto /usr/share/doc/${P}
84 doins $i
85 #dodoc -u $i
86 done
87 ;;
88 "tex" | "dtx")
89 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
90 do
91 echo "Making documentation: $i"
92 texi2dvi -q -c --language=latex $i
93 done
94 ;;
95 "tfm" | "vf" | "afm" | "pfb")
96 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
97 do
98 insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
99 doins $i
100 done
101 ;;
102 "ttf")
103 for i in `find . -maxdepth 1 -type f -name "*.ttf"`
104 do
105 insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
106 doins $i
107 done
108 ;;
109 "styles")
110 latex-package_src_doinstall sty cls fd clo def
111 ;;
112 "doc")
113 latex-package_src_doinstall tex dtx dvi ps pdf
114 ;;
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 latex-package_src_doinstall styles fonts bin doc
123 ;;
124 esac
125 shift
126 done
127 }
128
129 latex-package_src_compile() {
130 debug-print function $FUNCNAME $*
131 cd ${S}
132 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
133 do
134 echo "Extracting from $i"
135 latex --interaction=batchmode $i > /dev/null
136 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

  ViewVC Help
Powered by ViewVC 1.1.20