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

Contents of /eclass/tetex.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.62 - (show annotations) (download)
Tue Dec 27 17:55:12 2011 UTC (2 years, 8 months ago) by fauli
Branch: MAIN
Changes since 1.61: +2 -2 lines
Update copyright years in headers

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

  ViewVC Help
Powered by ViewVC 1.1.20