| 1 | # Author Matthew Turk <m-turk@nwu.edu> |
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: /var/cvsroot/gentoo-x86/eclass/latex-package.eclass,v 1.12 2003/02/08 03:09:16 satai Exp $ |
| 2 | # |
5 | # |
| 3 | # 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 |
| 4 | # 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 |
| 5 | # successful installation. If fonts need to be installed, then the variable |
8 | # successful installation. If fonts need to be installed, then the variable |
| 6 | # SUPPLIER must also be defined. |
9 | # SUPPLIER must also be defined. |
| … | |
… | |
| 42 | # archive of them. (iBiblio) |
45 | # archive of them. (iBiblio) |
| 43 | |
46 | |
| 44 | inherit base |
47 | inherit base |
| 45 | INHERITED="$INHERITED $ECLASS" |
48 | INHERITED="$INHERITED $ECLASS" |
| 46 | |
49 | |
| 47 | newdepend ">=app-text/tetex-1.0.7" |
50 | newdepend ">=app-text/tetex-1.0.7 |
|
|
51 | >=sys-apps/texinfo-4.2-r5" |
| 48 | ECLASS=latex-package |
52 | ECLASS=latex-package |
| 49 | HOMEPAGE="http://www.tug.org/" |
53 | HOMEPAGE="http://www.tug.org/" |
| 50 | SRC_URI="ftp://tug.ctan.org/macros/latex/" |
54 | SRC_URI="ftp://tug.ctan.org/macros/latex/" |
| 51 | S=${WORKDIR}/${P} |
55 | S=${WORKDIR}/${P} |
| 52 | TEXMF="/usr/share/texmf" |
56 | TEXMF="/usr/share/texmf" |
| … | |
… | |
| 71 | do |
75 | do |
| 72 | insinto ${TEXMF}/tex/latex/${PN} |
76 | insinto ${TEXMF}/tex/latex/${PN} |
| 73 | doins $i |
77 | doins $i |
| 74 | done |
78 | done |
| 75 | ;; |
79 | ;; |
| 76 | "dvi" | "ps" | "pdf" | "tex" | "dtx") |
80 | "dvi" | "ps" | "pdf") |
| 77 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
81 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
| 78 | do |
82 | do |
|
|
83 | insinto /usr/share/doc/${P} |
|
|
84 | doins $i |
| 79 | dodoc $i |
85 | #dodoc -u $i |
| 80 | done |
86 | done |
|
|
87 | ;; |
|
|
88 | "tex" | "dtx") |
|
|
89 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
|
|
90 | do |
|
|
91 | einfo "Making documentation: $i" |
|
|
92 | texi2dvi -q -c --language=latex $i &> /dev/null |
|
|
93 | done |
| 81 | ;; |
94 | ;; |
| 82 | "tfm" | "vf" | "afm" | "pfb") |
95 | "tfm" | "vf" | "afm" | "pfb") |
| 83 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
96 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
| 84 | do |
97 | do |
| 85 | insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} |
98 | insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} |
| … | |
… | |
| 95 | ;; |
108 | ;; |
| 96 | "styles") |
109 | "styles") |
| 97 | latex-package_src_doinstall sty cls fd clo def |
110 | latex-package_src_doinstall sty cls fd clo def |
| 98 | ;; |
111 | ;; |
| 99 | "doc") |
112 | "doc") |
| 100 | latex-package_src_doinstall dvi ps pdf tex dtx |
113 | latex-package_src_doinstall tex dtx dvi ps pdf |
| 101 | ;; |
114 | ;; |
| 102 | "fonts") |
115 | "fonts") |
| 103 | latex-package_src_doinstall tfm vg afm pfb ttf |
116 | latex-package_src_doinstall tfm vg afm pfb ttf |
| 104 | ;; |
117 | ;; |
| 105 | "bin") |
118 | "bin") |
| 106 | latex-package_src_doinstall sh |
119 | latex-package_src_doinstall sh |
| 107 | ;; |
120 | ;; |
| 108 | "all") |
121 | "all") |
| 109 | latex-package_src_doinstall styles doc fonts bin |
122 | latex-package_src_doinstall styles fonts bin doc |
| 110 | ;; |
123 | ;; |
| 111 | esac |
124 | esac |
| 112 | shift |
125 | shift |
| 113 | done |
126 | done |
| 114 | } |
127 | } |
| … | |
… | |
| 116 | latex-package_src_compile() { |
129 | latex-package_src_compile() { |
| 117 | debug-print function $FUNCNAME $* |
130 | debug-print function $FUNCNAME $* |
| 118 | cd ${S} |
131 | cd ${S} |
| 119 | for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` |
132 | for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` |
| 120 | do |
133 | do |
| 121 | echo "Extracting from $i" |
134 | einfo "Extracting from $i" |
| 122 | latex --interaction=batchmode $i > /dev/null |
135 | latex --interaction=batchmode $i &> /dev/null |
| 123 | done |
136 | done |
| 124 | } |
137 | } |
| 125 | |
138 | |
| 126 | latex-package_src_install() { |
139 | latex-package_src_install() { |
| 127 | debug-print function $FUNCNAME $* |
140 | debug-print function $FUNCNAME $* |
| … | |
… | |
| 130 | } |
143 | } |
| 131 | |
144 | |
| 132 | latex-package_pkg_postinst() { |
145 | latex-package_pkg_postinst() { |
| 133 | debug-print function $FUNCNAME $* |
146 | debug-print function $FUNCNAME $* |
| 134 | latex-package_rehash |
147 | latex-package_rehash |
| 135 | if [ ! -e /usr/doc/latex/${PN} ] ; then return ; fi |
|
|
| 136 | cd /usr/share/doc/${PN} |
|
|
| 137 | latex-package_make_documentation |
|
|
| 138 | } |
148 | } |
| 139 | |
149 | |
| 140 | latex-package_pkg_postrm() { |
150 | latex-package_pkg_postrm() { |
| 141 | debug-print function $FUNCNAME $* |
151 | debug-print function $FUNCNAME $* |
| 142 | latex-package_rehash |
152 | latex-package_rehash |
| … | |
… | |
| 145 | latex-package_rehash() { |
155 | latex-package_rehash() { |
| 146 | debug-print function $FUNCNAME $* |
156 | debug-print function $FUNCNAME $* |
| 147 | texconfig rehash |
157 | texconfig rehash |
| 148 | } |
158 | } |
| 149 | |
159 | |
| 150 | latex-package_make_documentation() { |
|
|
| 151 | debug-print function $FUNCNAME $* |
|
|
| 152 | for i in `find \`pwd\` -maxdepth 1 -type f -name "*.[dt]tex"` |
|
|
| 153 | do |
|
|
| 154 | echo "Making Documentation: $i" |
|
|
| 155 | latex --interaction=batchmode $i > /dev/null |
|
|
| 156 | # And we don't want any leftovers... |
|
|
| 157 | for ext in aux toc log |
|
|
| 158 | do |
|
|
| 159 | rm ${i}.${ext} |
|
|
| 160 | done |
|
|
| 161 | done |
|
|
| 162 | echo "Completed." |
|
|
| 163 | } |
|
|
| 164 | |
|
|
| 165 | EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |
160 | EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |