/[gentoo-alt]/trunk/prefix/eclass/tetex.eclass
Gentoo

Contents of /trunk/prefix/eclass/tetex.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 6211 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/tetex.eclass,v 1.43 2006/02/01 19:49:48 ehmsen Exp $
4 #
5 # Author: Jaromir Malenko <malenko@email.cz>
6 # Author: Mamoru KOMACHI <usata@gentoo.org>
7 # Author: Martin Ehmsen <ehmsen@gentoo.org>
8 # Author: Alexandre Buisse <nattfodd@gentoo.org>
9 #
10 # A generic eclass to install tetex distributions. This shouldn't be
11 # inherited directly in any ebuilds. It should be inherited from
12 # tetex-{2,3}.eclass.
13
14 inherit eutils flag-o-matic toolchain-funcs
15
16 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_setup pkg_postinst
17
18 if [ -z "${TETEX_PV}" ] ; then
19 TETEX_PV=${PV}
20 fi
21
22 IUSE="X doc"
23
24 S=${WORKDIR}/tetex-src-${TETEX_PV}
25 TETEX_SRC="tetex-src-${TETEX_PV}.tar.gz"
26 TETEX_TEXMF="tetex-texmf-${TETEX_PV}.tar.gz"
27 TETEX_TEXMF_SRC="tetex-texmfsrc-${TETEX_PV}.tar.gz"
28
29 DESCRIPTION="a complete TeX distribution"
30 HOMEPAGE="http://tug.org/teTeX/"
31 SRC_PATH_TETEX=ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/2.0/distrib
32 SRC_URI="${SRC_PATH_TETEX}/${TETEX_SRC}
33 ${SRC_PATH_TETEX}/${TETEX_TEXMF}
34 ${SRC_PATH_TETEX}/${TETEX_TEXMF_SRC}
35 mirror://gentoo/tetex-${TETEX_PV}-gentoo.tar.gz
36 http://dev.gentoo.org/~usata/distfiles/tetex-${TETEX_PV}-gentoo.tar.gz"
37
38 SLOT="0"
39 LICENSE="GPL-2"
40 KEYWORDS="~ia64 ~x86 ~ppc ~sparc ~alpha ~amd64"
41
42 DEPEND="!app-text/tetex
43 !app-text/ptex
44 !app-text/cstetex
45 sys-apps/ed
46 sys-libs/zlib
47 X? ( || ( (
48 x11-libs/libXmu
49 x11-libs/libXp
50 x11-libs/libXpm
51 x11-libs/libICE
52 x11-libs/libSM
53 x11-libs/libXaw
54 x11-libs/libXfont
55 )
56 virtual/x11
57 )
58 )
59 >=media-libs/libpng-1.2.1
60 sys-libs/ncurses
61 >=net-libs/libwww-5.3.2-r1"
62 RDEPEND="${DEPEND}
63 !app-text/dvipdfm
64 !dev-tex/currvita
65 !dev-tex/eurosym
66 !dev-tex/extsizes
67 >=dev-lang/perl-5.2
68 dev-util/dialog"
69 PROVIDE="virtual/tetex"
70
71 tetex_pkg_setup() {
72
73 # hundreds of bugs reporting "cannot find -lmysqlclient" :(
74 if ! has_version 'dev-db/mysql' && (libwww-config --libs | grep mysql >/dev/null 2>&1); then
75 eerror
76 eerror "Your libwww was compiled with MySQL but MySQL is missing from system."
77 eerror "Please install MySQL or remerge libwww without mysql USE flag."
78 eerror
79 die "libwww was compiled with mysql but mysql is not installed"
80 fi
81 }
82
83 tetex_src_unpack() {
84
85 [ -z "$1" ] && tetex_src_unpack all
86
87 while [ "$1" ]; do
88 case $1 in
89 unpack)
90 unpack ${TETEX_SRC}
91 unpack tetex-${TETEX_PV}-gentoo.tar.gz
92
93 mkdir ${S}/texmf; cd ${S}/texmf
94 umask 022
95 unpack ${TETEX_TEXMF}
96 ;;
97 patch)
98 # Do not run config. Also fix local texmf tree.
99 cd ${S}
100 for p in ${WORKDIR}/patches/* ; do
101 epatch $p
102 done
103
104 if useq ppc-macos ; then
105 sed -i -e "/^HOMETEXMF/s:\$HOME/texmf:\$HOME/Library/texmf:" ${S}/texk/kpathsea/texmf.in || die "sed texmf.in failed."
106 fi
107 ;;
108 all)
109 tetex_src_unpack unpack patch
110 ;;
111 esac
112 shift
113 done
114 }
115
116 tetex_src_compile() {
117
118 # filter -Os; bug #74307.
119 filter-flags "-fstack-protector" "-Os"
120
121 einfo "Building teTeX"
122
123 local xdvik
124
125 if useq X ; then
126 addwrite /var/cache/fonts
127 xdvik="--with-xdvik --with-oxdvik"
128 #xdvik="$xdvik --with-system-t1lib"
129 else
130 xdvik="--without-xdvik --without-oxdvik"
131 fi
132
133 econf --bindir=/usr/bin \
134 --datadir=${S} \
135 --with-system-wwwlib \
136 --with-libwww-include=/usr/include/w3c-libwww \
137 --with-system-ncurses \
138 --with-system-pnglib \
139 --without-texinfo \
140 --without-dialog \
141 --without-texi2html \
142 --with-system-zlib \
143 --disable-multiplatform \
144 --with-epsfwin \
145 --with-mftalkwin \
146 --with-regiswin \
147 --with-tektronixwin \
148 --with-unitermwin \
149 --with-ps=gs \
150 --enable-ipc \
151 --with-etex \
152 $(use_with X x) \
153 ${xdvik} \
154 ${TETEX_ECONF} || die
155
156 if useq X && useq ppc-macos ; then
157 for f in $(find ${S} -name config.status) ; do
158 sed -i -e "s:-ldl::g" $f
159 done
160 fi
161
162 emake -j1 CC="$(tc-getCC)" CXX="$(tc-getCXX)" texmf=${TEXMF_PATH:-/usr/share/texmf} || die "make teTeX failed"
163 }
164
165 tetex_src_install() {
166
167 if [ -z "$1" ]; then
168 tetex_src_install all
169 fi
170
171 while [ "$1" ]; do
172 case $1 in
173 base)
174 dodir /usr/share/
175 # Install texmf files
176 einfo "Installing texmf ..."
177 cp -Rv texmf ${D}/usr/share
178
179 # Install teTeX files
180 einfo "Installing teTeX ..."
181 dodir ${TEXMF_PATH:-/usr/share/texmf}/web2c
182 einstall bindir=${D}/usr/bin texmf=${D}${TEXMF_PATH:-/usr/share/texmf} || die
183
184 dosbin ${T}/texmf-update
185 ;;
186 doc)
187 dodoc PROBLEMS README
188 docinto texk
189 dodoc texk/ChangeLog texk/README
190 docinto kpathesa
191 cd ${S}/texk/kpathsea
192 dodoc README* NEWS PROJECTS HIER
193 docinto dviljk
194 cd ${S}/texk/dviljk
195 dodoc AUTHORS README NEWS
196 docinto dvipsk
197 cd ${S}/texk/dvipsk
198 dodoc AUTHORS ChangeLog INSTALLATION README
199 docinto makeindexk
200 cd ${S}/texk/makeindexk
201 dodoc CONTRIB COPYING NEWS NOTES PORTING README
202 docinto ps2pkm
203 cd ${S}/texk/ps2pkm
204 dodoc ChangeLog CHANGES.type1 INSTALLATION README*
205 docinto web2c
206 cd ${S}/texk/web2c
207 dodoc AUTHORS ChangeLog NEWS PROJECTS README
208 #docinto xdvik
209 #cd ${S}/texk/xdvik
210 #dodoc BUGS FAQ README*
211
212 # move docs to /usr/share/doc/${PF}
213 if useq doc ; then
214 dodir /usr/share/doc/${PF}
215 mv ${D}/usr/share/texmf/doc/* \
216 ${D}/usr/share/doc/${PF} \
217 || die "mv doc failed."
218 cd ${D}/usr/share/texmf
219 rmdir doc
220 ln -s ../doc/${PF} doc \
221 || die "ln -s doc failed."
222 cd -
223 else
224 rm -rf ${D}/usr/share/texmf/doc
225 fi
226 ;;
227 fixup)
228 #fix for conflicting readlink binary:
229 rm -f ${D}/bin/readlink
230 rm -f ${D}/usr/bin/readlink
231
232 #add /var/cache/fonts directory
233 dodir /var/cache/fonts
234
235 #fix for lousy upstream permisssions on /usr/share/texmf files
236 #NOTE: do not use fowners, as its not recursive ...
237 einfo "Fixing permissions ..."
238 # root group name doesn't exist on Mac OS X
239 chown -R 0:0 ${D}/usr/share/texmf
240 find ${D} -name "ls-R" -exec rm {} \;
241 ;;
242 all)
243 tetex_src_install base doc fixup
244 ;;
245 esac
246 shift
247 done
248 }
249
250 tetex_pkg_postinst() {
251
252 if [ "$ROOT" = "/" ] ; then
253 /usr/sbin/texmf-update
254 fi
255 if [ -d "/etc/texmf" ] ; then
256 einfo
257 einfo "If you have configuration files in /etc/texmf to merge,"
258 einfo "please update them and run /usr/sbin/texmf-update."
259 einfo
260 fi
261 }

  ViewVC Help
Powered by ViewVC 1.1.20