| 1 | # Author Matthew Turk <m-turk@nwu.edu> |
1 | # Author Matthew Turk <satai@gentoo.org> |
| 2 | # |
2 | # |
| 3 | # This eClass is designed to be easy to use and implement. The vast majority of |
3 | # 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 |
4 | # 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 |
5 | # successful installation. If fonts need to be installed, then the variable |
| 6 | # SUPPLIER must also be defined. |
6 | # SUPPLIER must also be defined. |
| … | |
… | |
| 42 | # archive of them. (iBiblio) |
42 | # archive of them. (iBiblio) |
| 43 | |
43 | |
| 44 | inherit base |
44 | inherit base |
| 45 | INHERITED="$INHERITED $ECLASS" |
45 | INHERITED="$INHERITED $ECLASS" |
| 46 | |
46 | |
| 47 | newdepend ">=app-text/tetex-1.0.7" |
47 | newdepend ">=app-text/tetex-1.0.7 |
|
|
48 | >=sys-apps/texinfo-4.2-r5" |
| 48 | ECLASS=latex-package |
49 | ECLASS=latex-package |
| 49 | HOMEPAGE="http://www.tug.org/" |
50 | HOMEPAGE="http://www.tug.org/" |
| 50 | SRC_URI="ftp://tug.ctan.org/macros/latex/" |
51 | SRC_URI="ftp://tug.ctan.org/macros/latex/" |
| 51 | S=${WORKDIR}/${P} |
52 | S=${WORKDIR}/${P} |
| 52 | TEXMF="/usr/share/texmf" |
53 | TEXMF="/usr/share/texmf" |
| … | |
… | |
| 71 | do |
72 | do |
| 72 | insinto ${TEXMF}/tex/latex/${PN} |
73 | insinto ${TEXMF}/tex/latex/${PN} |
| 73 | doins $i |
74 | doins $i |
| 74 | done |
75 | done |
| 75 | ;; |
76 | ;; |
| 76 | "dvi" | "ps" | "pdf" | "tex" | "dtx") |
77 | "dvi" | "ps" | "pdf") |
| 77 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
78 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
| 78 | do |
79 | do |
| 79 | dodoc $i |
80 | dodoc $i |
| 80 | done |
81 | done |
| 81 | ;; |
82 | ;; |
|
|
83 | "tex" | "dtx") |
|
|
84 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
|
|
85 | do |
|
|
86 | echo "Making documentation: $i" |
|
|
87 | texi2dvi -q -c --language=latex $i |
|
|
88 | done |
|
|
89 | ;; |
| 82 | "tfm" | "vf" | "afm" | "pfb") |
90 | "tfm" | "vf" | "afm" | "pfb") |
| 83 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
91 | for i in `find . -maxdepth 1 -type f -name "*.${1}"` |
| 84 | do |
92 | do |
| 85 | insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} |
93 | insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} |
| 86 | doins $i |
94 | doins $i |
| … | |
… | |
| 95 | ;; |
103 | ;; |
| 96 | "styles") |
104 | "styles") |
| 97 | latex-package_src_doinstall sty cls fd clo def |
105 | latex-package_src_doinstall sty cls fd clo def |
| 98 | ;; |
106 | ;; |
| 99 | "doc") |
107 | "doc") |
| 100 | latex-package_src_doinstall dvi ps pdf tex dtx |
108 | latex-package_src_doinstall tex dtx dvi ps pdf |
| 101 | ;; |
109 | ;; |
| 102 | "fonts") |
110 | "fonts") |
| 103 | latex-package_src_doinstall tfm vg afm pfb ttf |
111 | latex-package_src_doinstall tfm vg afm pfb ttf |
| 104 | ;; |
112 | ;; |
| 105 | "bin") |
113 | "bin") |
| 106 | latex-package_src_doinstall sh |
114 | latex-package_src_doinstall sh |
| 107 | ;; |
115 | ;; |
| 108 | "all") |
116 | "all") |
| 109 | latex-package_src_doinstall styles doc fonts bin |
117 | latex-package_src_doinstall styles fonts bin doc |
| 110 | ;; |
118 | ;; |
| 111 | esac |
119 | esac |
| 112 | shift |
120 | shift |
| 113 | done |
121 | done |
| 114 | } |
122 | } |
| … | |
… | |
| 130 | } |
138 | } |
| 131 | |
139 | |
| 132 | latex-package_pkg_postinst() { |
140 | latex-package_pkg_postinst() { |
| 133 | debug-print function $FUNCNAME $* |
141 | debug-print function $FUNCNAME $* |
| 134 | latex-package_rehash |
142 | 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 | } |
143 | } |
| 139 | |
144 | |
| 140 | latex-package_pkg_postrm() { |
145 | latex-package_pkg_postrm() { |
| 141 | debug-print function $FUNCNAME $* |
146 | debug-print function $FUNCNAME $* |
| 142 | latex-package_rehash |
147 | latex-package_rehash |
| … | |
… | |
| 145 | latex-package_rehash() { |
150 | latex-package_rehash() { |
| 146 | debug-print function $FUNCNAME $* |
151 | debug-print function $FUNCNAME $* |
| 147 | texconfig rehash |
152 | texconfig rehash |
| 148 | } |
153 | } |
| 149 | |
154 | |
| 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 |
155 | EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |