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

Contents of /eclass/latex-package.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Fri Jul 12 15:24:36 2002 UTC (12 years ago) by danarmak
Branch: MAIN
Changes since 1.2: +1 -0 lines
add INHERITED variable to all eclasses. this keeps track of what eclasses were inherited. e.g. INHERITED='kde-base kde base'. this will allow drobbins to take eclass mtime changes into account when deciding whether to refresh ebuild cache.

1 blocke 1.1 # Author Matthew Turk <m-turk@nwu.edu>
2     # An ebuild calling this class can cd to the appropriate
3     # directory and call latex-package_src_doinstall all, or leave
4     # the src_install function as-is if the system is single-directory.
5    
6     inherit base
7 danarmak 1.3 INHERITED="$INHERITED $ECLASS"
8 blocke 1.1
9     newdepend ">=app-text/tetex-1.0.7"
10     ECLASS=latex-package
11     HOMEPAGE="http://www.tug.org/"
12     SRC_URI="ftp://tug.ctan.org/macros/latex/"
13     S=${WORKDIR}/${P}
14     TEXMF="/usr/share/texmf"
15     SUPPLIER="misc" # This refers to the font supplier; it should be overridden
16    
17     latex-package_src_doinstall() {
18     debug-print function $FUNCNAME $*
19     # This actually follows the directions for a "single-user" system
20     # at http://www.ctan.org/installationadvice/ modified for gentoo.
21     [ -z "$1" ] && latex-package_src_install all
22    
23     while [ "$1" ]; do
24     case $1 in
25     "sh")
26     for i in `find . -maxdepth 1 -name "*.${1}"`
27     do
28     dobin $i
29     done
30     ;;
31     "sty" | "cls" | "fd")
32     for i in `find . -maxdepth 1 -name "*.${1}"`
33     do
34     insinto ${TEXMF}/tex/latex/${PN}
35     doins $i
36     done
37     ;;
38     "dvi" | "ps" | "pdf" | "tex")
39     for i in `find . -maxdepth 1 -name "*.${1}"`
40     do
41     insinto ${TEXMF}/doc/latex/${PN}
42     doins $i
43     done
44     ;;
45     "tfm" | "vf" | "afm" | "pfb")
46     for i in `find . -maxdepth 1 -name "*.${1}"`
47     do
48     insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
49     doins $i
50     done
51     ;;
52     "ttf")
53     for i in `find . -maxdepth 1 -name "*.ttf"`
54     do
55     insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
56     doins $i
57     done
58     ;;
59     "styles")
60     latex-package_src_doinstall sty cls fd
61     ;;
62     "doc")
63     latex-package_src_doinstall dvi ps pdf tex
64     ;;
65     "fonts")
66     latex-package_src_doinstall tfm vg afm pfb ttf
67     ;;
68     "bin")
69     latex-package_src_doinstall sh
70     ;;
71     "all")
72     latex-package_src_doinstall styles doc fonts bin
73     ;;
74     esac
75     shift
76     done
77     }
78    
79     latex-package_src_compile() {
80     debug-print function $FUNCNAME $*
81     cd ${S}
82     for i in `find \`pwd\` -maxdepth 1 -name "*.ins"`
83     do
84     echo "Extracting from $i"
85     latex --interaction=batchmode $i > /dev/null
86     done
87     for i in `find \`pwd\` -maxdepth 1 -name "*.dtx"`
88     do
89     echo "Extracting from $i"
90     latex --interaction=batchmode $i > /dev/null
91     done
92     }
93    
94     latex-package_src_install() {
95     debug-print function $FUNCNAME $*
96     cd ${S}
97     latex-package_src_doinstall all
98     }
99    
100     latex-package_pkg_postinst() {
101     debug-print function $FUNCNAME $*
102     latex-package_rehash
103     if [ ! -e ${TEXMF}/doc/latex/${PN} ] ; then return ; fi
104     cd ${TEXMF}/doc/latex/${PN}
105     latex-package_make_documentation
106     }
107    
108     latex-package_pkg_postrm() {
109     debug-print function $FUNCNAME $*
110     # This may be a bit harsh, so perhaps it should be overridden.
111     latex-package_rehash
112     if [ ! -e ${TEXMF}/doc/latex/${PN} ] ; then return ; fi
113     echo "Removing stale documentation: ${TEXMF}/doc/latex/${PN}"
114     rm -rf ${TEXMF}/doc/latex/${PN}
115     }
116    
117     latex-package_rehash() {
118     debug-print function $FUNCNAME $*
119     texconfig rehash
120     }
121    
122     latex-package_make_documentation() {
123     debug-print function $FUNCNAME $*
124     # This has to come after the installation of all our files.
125     # All errors will be discarded.
126     for i in `find \`pwd\` -maxdepth 1 -name "*.tex"`
127     do
128     # Note - we rerun twice to get references properly.
129     echo "Making Documentation: $i"
130     latex --interaction=batchmode $i > /dev/null
131     done
132     echo "Completed."
133     }
134    
135     EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20