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

Contents of /eclass/tetex-3.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (show annotations) (download)
Sun Aug 19 11:04:37 2012 UTC (4 years, 3 months ago) by johu
Branch: MAIN
CVS Tags: HEAD
Changes since 1.25: +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-3.eclass,v 1.25 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 3.x distributions.
13
14 TEXMF_PATH=/var/lib/texmf
15
16 inherit tetex
17
18 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst
19
20 IUSE="X Xaw3d motif neXt"
21
22 DEPEND="X? ( motif? ( >=x11-libs/openmotif-2.3 )
23 !motif? ( neXt? ( x11-libs/neXtaw )
24 !neXt? ( Xaw3d? ( x11-libs/libXaw3d ) ) )
25 !app-text/xdvik
26 )
27 !dev-tex/memoir
28 !dev-tex/lineno
29 !dev-tex/SIunits
30 !dev-tex/floatflt
31 !dev-tex/g-brief
32 !dev-tex/koma-script"
33
34 RDEPEND="${DEPEND}"
35
36 tetex-3_pkg_setup() {
37 ewarn
38 ewarn "teTeX 3.0 ebuild will remove config files stored in /usr/share/texmf."
39 ewarn "Please make a backup before upgrading if you changed anything."
40 ewarn
41
42 ebeep
43 epause
44 }
45
46 tetex-3_src_unpack() {
47
48 tetex_src_unpack
49
50 # create update script
51 cat >${T}/texmf-update<<'EOF'
52 #!/bin/bash
53 #
54 # Utility to update Gentoo teTeX distribution configuration files
55 #
56
57 PATH=/bin:/usr/bin
58
59 # Fix for all those with altered umask for root
60 umask 022
61
62 # Make sure we have a correct environment, bug #30432
63 # The list of env. vars is taken from the INSTALL file
64 for texvar in AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS \
65 DVIPSHEADERS GFFONTS GLYPHFONTS INDEXSTYLE MFBASES MFINPUTS \
66 MFPOOL MFTINPUTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS \
67 OFMFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PKFONTS PSHEADERS \
68 T1FONTS T1INPUTS TEXBIB TEXCONFIG TEXDOCS TEXFONTMAPS TEXFONTS \
69 TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF TEXMFDBS TEXMFINI \
70 TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS TEXSOURCES TFMFONTS TRFONTS \
71 VFFONTS XDVIFONTS XDVIVFS ; do
72
73 if [ "${!texvar}" ]; then
74 if ! $(echo ${!texvar} | grep '^:\|::\|:$' &>/dev/null) ; then
75 export ${texvar}="${!texvar}:"
76 fi
77 fi
78 done
79
80 if [ "$TEXINPUTS" ]; then
81 if $(echo ${TEXINPUTS} | grep '/usr/share/texmf' &>/dev/null) ; then
82 export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/usr/share/texmf/*:\?||g')
83 elif $(echo ${TEXINPUTS} | grep '/var/lib/texmf' &>/dev/null) ; then
84 export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/var/lib/texmf/*:\?||g')
85 fi
86 fi
87
88 for conf in texmf.cnf fmtutil.cnf updmap.cfg
89 do
90 if [ -d "/etc/texmf/${conf/.*/.d}" ]
91 then
92 echo "Generating /etc/texmf/web2c/${conf} from /etc/texmf/${conf/.*/.d} ..."
93 cat /etc/texmf/${conf/.*/.d}/* > "/etc/texmf/web2c/${conf}"
94 fi
95 done
96
97 # configure
98 echo "Configuring teTeX ..."
99 mktexlsr &>/dev/null
100 texconfig-sys init &>/dev/null
101 texconfig-sys confall &>/dev/null
102 texconfig-sys font rw &>/dev/null
103 texconfig-sys font vardir /var/cache/fonts &>/dev/null
104 updmap-sys &>/dev/null
105
106 # generate
107 echo "Generating format files ..."
108 fmtutil-sys --missing &>/dev/null
109 echo
110 echo "Use 'texconfig font ro' to disable font generation for users"
111 echo
112 EOF
113
114 # need to fix up the hyperref driver, see bug #31967
115 sed -i -e "/providecommand/s/hdvips/hypertex/" \
116 ${S}/texmf/tex/latex/hyperref/hyperref.cfg
117 }
118
119 tetex-3_src_compile() {
120 sed -i -e "/mktexlsr/,+3d" \
121 -e "s/\(updmap-sys\)/\1 --nohash/" \
122 Makefile.in || die
123
124 use amd64 && replace-flags "-O3" "-O2"
125
126 if use X ; then
127 if use motif ; then
128 toolkit="motif"
129 elif use neXt ; then
130 toolkit="neXtaw"
131 elif use Xaw3d ; then
132 toolkit="xaw3d"
133 else
134 toolkit="xaw"
135 fi
136
137 TETEX_ECONF="${TETEX_ECONF} --with-xdvi-x-toolkit=${toolkit}"
138 fi
139
140 tetex_src_compile
141 }
142
143 tetex-3_src_install() {
144
145 tetex_src_install
146
147 dodir /etc/env.d
148 echo 'CONFIG_PROTECT_MASK="/etc/texmf/web2c"' > ${D}/etc/env.d/98tetex
149 # populate /etc/texmf
150 keepdir /etc/texmf/web2c
151 cd ${D}/usr/share/texmf # not ${TEXMF_PATH}
152 for d in $(find . -name config -type d | sed -e "s:\./::g") ; do
153 dodir /etc/texmf/${d}
154 for f in $(find ${D}usr/share/texmf/$d -maxdepth 1 -mindepth 1); do
155 mv $f ${D}/etc/texmf/$d || die "mv $f failed"
156 dosym /etc/texmf/$d/$(basename $f) /usr/share/texmf/$d/$(basename $f)
157 done
158 done
159 cd -
160 cd ${D}${TEXMF_PATH}
161 for f in $(find . -name '*.cnf' -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
162 if [ "${f/config/}" != "${f}" ] ; then
163 continue
164 fi
165 dodir /etc/texmf/$(dirname $f)
166 mv ${D}${TEXMF_PATH}/$f ${D}/etc/texmf/$(dirname $f) || die "mv $f failed."
167 dosym /etc/texmf/$f ${TEXMF_PATH}/$f
168 done
169
170 # take care of updmap.cfg, fmtutil.cnf and texmf.cnf
171 dodir /etc/texmf/{updmap.d,fmtutil.d,texmf.d}
172 #cp ${D}/usr/share/texmf/web2c/updmap.cfg ${D}/etc/texmf/updmap.d/00updmap.cfg
173 dosym /etc/texmf/web2c/updmap.cfg ${TEXMF_PATH}/web2c/updmap.cfg
174 mv ${D}/usr/share/texmf/web2c/updmap.cfg ${D}/etc/texmf/updmap.d/00updmap.cfg
175 mv ${D}/etc/texmf/web2c/fmtutil.cnf ${D}/etc/texmf/fmtutil.d/00fmtutil.cnf
176 mv ${D}/etc/texmf/web2c/texmf.cnf ${D}/etc/texmf/texmf.d/00texmf.cnf
177
178 # xdvi
179 if use X ; then
180 dodir /etc/X11/app-defaults /etc/texmf/xdvi
181 mv ${D}${TEXMF_PATH}/xdvi/XDvi ${D}/etc/X11/app-defaults || die "mv XDvi failed"
182 dosym /etc/X11/app-defaults/XDvi ${TEXMF_PATH}/xdvi/XDvi
183 fi
184 cd -
185 }
186
187 tetex-3_pkg_preinst() {
188
189 ewarn "Removing ${ROOT}usr/share/texmf/web2c"
190 rm -rf "${ROOT}usr/share/texmf/web2c"
191
192 # take care of symlinks problems, see bug 120515
193 # this can be removed when that is not an issue anymore
194 # i.e., all users with problem has got them fixed
195 for conf in updmap.d/00updmap.cfg texmf.d/00texmf.cnf fmtutil.d/00fmtutil.cnf
196 do
197 if [ -L "${ROOT}etc/texmf/${conf}" ]
198 then
199 ewarn "Removing ${ROOT}etc/texmf/${conf}"
200 rm -f "${ROOT}etc/texmf/${conf}"
201 fi
202 done
203
204 # take care of config protection, upgrade from <=tetex-2.0.2-r4
205 for conf in updmap.cfg texmf.cnf fmtutil.cnf
206 do
207 if [ ! -d "${ROOT}etc/texmf/${conf/.*/.d}" -a -f "${ROOT}etc/texmf/${conf}" ]
208 then
209 mkdir "${ROOT}etc/texmf/${conf/.*/.d}"
210 cp "${ROOT}etc/texmf/${conf}" "${ROOT}etc/texmf/00${conf/.*/.d}"
211 fi
212 done
213 }
214
215 tetex-3_pkg_postinst() {
216 tetex_pkg_postinst
217 }

  ViewVC Help
Powered by ViewVC 1.1.20