/[gentoo-x86]/eclass/tetex.eclass
Gentoo

Contents of /eclass/tetex.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.64 - (show annotations) (download)
Sun Aug 19 11:04:37 2012 UTC (2 years, 9 months ago) by johu
Branch: MAIN
CVS Tags: HEAD
Changes since 1.63: +1 -1 lines
FILE REMOVED
Remove obsolete. Announced on 2012/07/18.

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

  ViewVC Help
Powered by ViewVC 1.1.20