/[gentoo-x86]/eclass/texlive-module.eclass
Gentoo

Diff of /eclass/texlive-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.27 Revision 1.30
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.27 2010/01/07 18:17:35 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.30 2010/01/07 19:16:52 aballier Exp $
4 4
5# @ECLASS: texlive-module.eclass 5# @ECLASS: texlive-module.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# tex@gentoo.org 7# tex@gentoo.org
8# 8#
89 89
90[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc" 90[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc"
91 91
92S="${WORKDIR}" 92S="${WORKDIR}"
93 93
94if [ "${PV#2008}" == "${PV}" ]; then
95
96# @FUNCTION: texlive-module_src_unpack
97# @DESCRIPTION:
98# Only for TeX Live 2009.
99# Gives tar.xz unpack support until we can use an EAPI with that support.
100
101RELOC_TARGET=texmf-dist
102
103texlive-module_src_unpack() {
104 local i s
105 for i in ${A}
106 do
107 s="${DISTDIR%/}/${i}"
108 einfo "Unpacking ${s} to ${PWD}"
109 test -s "${s}" || die "${s} does not exist"
110 xz -dc -- "${s}" | tar xof - || die "Unpacking ${s} failed"
111 done
112 grep RELOC tlpkg/tlpobj/* | awk '{print $2}' | sed 's#^RELOC/##' > "${T}/reloclist"
113 { for i in $(<"${T}/reloclist"); do dirname $i; done; } | uniq | sort -r > "${T}/dirlist"
114 for i in $(<"${T}/dirlist"); do
115 [ -d "${RELOC_TARGET}/${i}" ] || mkdir -p "${RELOC_TARGET}/${i}"
116 done
117 for i in $(<"${T}/reloclist"); do
118 mv "${i}" "${RELOC_TARGET}"/$(dirname "${i}") || die "failed to relocate ${i} to ${RELOC_TARGET}/$(dirname ${i})"
119 done
120}
121
122fi
94 123
95# @FUNCTION: texlive-module_make_language_def_lines 124# @FUNCTION: texlive-module_make_language_def_lines
96# @DESCRIPTION: 125# @DESCRIPTION:
97# Only valid for TeXLive 2008.
98# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d 126# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d
99# It parses the AddHyphen directive of tlpobj files to create it. 127# It parses the AddHyphen directive of tlpobj files to create it.
100 128
101texlive-module_make_language_def_lines() { 129texlive-module_make_language_def_lines() {
102 local lefthyphenmin righthyphenmin synonyms name file 130 local lefthyphenmin righthyphenmin synonyms name file
142# The next step is to generate config files that are to be installed in 170# The next step is to generate config files that are to be installed in
143# /etc/texmf; texmf-update script will take care of merging the different config 171# /etc/texmf; texmf-update script will take care of merging the different config
144# files for different packages in a single one used by the whole tex installation. 172# files for different packages in a single one used by the whole tex installation.
145 173
146texlive-module_src_compile() { 174texlive-module_src_compile() {
147 # Build format files
148 for i in texmf/fmtutil/format*.cnf; do
149 if [ -f "${i}" ]; then
150 einfo "Building format ${i}"
151 VARTEXFONTS="${T}/fonts" TEXMFHOME="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\
152 env -u TEXINPUTS fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
153 || die "failed to build format ${i}"
154 fi
155 done
156
157 # Generate config files 175 # Generate config files
158 # TeX Live 2007 was providing lists. For 2008 they are now tlpobj. 176 # TeX Live 2007 was providing lists. For 2008 they are now tlpobj.
159 for i in "${S}"/tlpkg/tlpobj/*; 177 for i in "${S}"/tlpkg/tlpobj/*;
160 do 178 do
161 grep '^execute ' "${i}" | sed -e 's/^execute //' | tr ' ' '@' |sort|uniq >> "${T}/jobs" 179 grep '^execute ' "${i}" | sed -e 's/^execute //' | tr ' ' '@' |sort|uniq >> "${T}/jobs"
185 *) 203 *)
186 die "No rule to proccess ${command}. Please file a bug." 204 die "No rule to proccess ${command}. Please file a bug."
187 esac 205 esac
188 done 206 done
189 207
208 # Build format files
209 for i in texmf/fmtutil/format*.cnf; do
210 if [ -f "${i}" ]; then
211 einfo "Building format ${i}"
212 VARTEXFONTS="${T}/fonts" TEXMFHOME="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\
213 env -u TEXINPUTS fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
214 || die "failed to build format ${i}"
215 fi
216 done
217
190 # Delete ls-R files, these should not be created but better be certain they 218 # Delete ls-R files, these should not be created but better be certain they
191 # do not end up being installed. 219 # do not end up being installed.
192 find . -name 'ls-R' -delete 220 find . -name 'ls-R' -delete
193} 221}
194 222
268 ewarn "Your texmf tree might be inconsistent with your configuration" 296 ewarn "Your texmf tree might be inconsistent with your configuration"
269 ewarn "Please try to figure what has happened" 297 ewarn "Please try to figure what has happened"
270 fi 298 fi
271} 299}
272 300
301if [ "${PV#2008}" != "${PV}" ]; then
273EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm 302EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
303else
304EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm
305fi

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20