/[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.63 Revision 1.67
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 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.63 2012/07/26 16:40:47 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.67 2013/09/25 15:18:28 ottxor 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# @AUTHOR: 8# @AUTHOR:
19# src_unpack does). 19# src_unpack does).
20# Starting from TeX Live 2009, the eclass provides a src_unpack function taking 20# Starting from TeX Live 2009, the eclass provides a src_unpack function taking
21# care of unpacking and relocating the files that need it. 21# care of unpacking and relocating the files that need it.
22# 22#
23# It inherits texlive-common and base for supporting patching via the PATCHES 23# It inherits texlive-common and base for supporting patching via the PATCHES
24# bash array with EAPI>=2. 24# bash array.
25 25
26# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS 26# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS
27# @DESCRIPTION: 27# @DESCRIPTION:
28# The list of packages that will be installed. This variable will be expanded to 28# The list of packages that will be installed. This variable will be expanded to
29# SRC_URI: 29# SRC_URI:
43# @DESCRIPTION: 43# @DESCRIPTION:
44# A space separated list of files that are in fact scripts installed in the 44# A space separated list of files that are in fact scripts installed in the
45# texmf tree and that we want to be available directly. They will be installed in 45# texmf tree and that we want to be available directly. They will be installed in
46# /usr/bin. 46# /usr/bin.
47 47
48# @ECLASS-VARIABLE: TEXLIVE_MODULE_BINLINKS
49# @DESCRIPTION:
50# A space separated list of links to add for BINSCRIPTS.
51# The systax is: foo:bar to create a symlink bar -> foo.
52
48# @ECLASS-VARIABLE: TL_PV 53# @ECLASS-VARIABLE: TL_PV
49# @DESCRIPTION: 54# @DESCRIPTION:
50# Normally the module's PV reflects the TeXLive release it belongs to. 55# Normally the module's PV reflects the TeXLive release it belongs to.
51# If this is not the case, TL_PV takes the version number for the 56# If this is not the case, TL_PV takes the version number for the
52# needed app-text/texlive-core. 57# needed app-text/texlive-core.
55# @DESCRIPTION: 60# @DESCRIPTION:
56# Information to display about the package. 61# Information to display about the package.
57# e.g. for enabling/disabling a feature 62# e.g. for enabling/disabling a feature
58 63
59inherit texlive-common base 64inherit texlive-common base
65
66case "${EAPI:-0}" in
67 0|1|2)
68 die "EAPI='${EAPI}' is not supported anymore"
69 ;;
70 *)
71 ;;
72esac
60 73
61HOMEPAGE="http://www.tug.org/texlive/" 74HOMEPAGE="http://www.tug.org/texlive/"
62 75
63COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}" 76COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}"
64 77
96S="${WORKDIR}" 109S="${WORKDIR}"
97 110
98# @FUNCTION: texlive-module_src_unpack 111# @FUNCTION: texlive-module_src_unpack
99# @DESCRIPTION: 112# @DESCRIPTION:
100# Only for TeX Live 2009 and later. 113# Only for TeX Live 2009 and later.
101# Gives tar.xz unpack support until we can use an EAPI with that support.
102# If EAPI supports tar.xz then it calls unpack instead of its own unpacker.
103# After unpacking, the files that need to be relocated are moved accordingly. 114# After unpacking, the files that need to be relocated are moved accordingly.
104 115
105RELOC_TARGET=texmf-dist 116RELOC_TARGET=texmf-dist
106 117
107texlive-module_src_unpack() { 118texlive-module_src_unpack() {
108 if has "${EAPI:-0}" 0 1 2 ; then
109 local i s
110 # Avoid installing world writable files
111 # Bugs #309997, #310039, #338881
112 umask 022
113 for i in ${A}
114 do
115 s="${DISTDIR%/}/${i}"
116 einfo "Unpacking ${s} to ${PWD}"
117 test -s "${s}" || die "${s} does not exist"
118 xz -dc -- "${s}" | tar xof - || die "Unpacking ${s} failed"
119 done
120 else
121 unpack ${A} 119 unpack ${A}
122 fi
123 120
124 grep RELOC tlpkg/tlpobj/* | awk '{print $2}' | sed 's#^RELOC/##' > "${T}/reloclist" 121 grep RELOC tlpkg/tlpobj/* | awk '{print $2}' | sed 's#^RELOC/##' > "${T}/reloclist"
125 { for i in $(<"${T}/reloclist"); do dirname $i; done; } | uniq > "${T}/dirlist" 122 { for i in $(<"${T}/reloclist"); do dirname $i; done; } | uniq > "${T}/dirlist"
126 for i in $(<"${T}/dirlist"); do 123 for i in $(<"${T}/dirlist"); do
127 [ -d "${RELOC_TARGET}/${i}" ] || mkdir -p "${RELOC_TARGET}/${i}" 124 [ -d "${RELOC_TARGET}/${i}" ] || mkdir -p "${RELOC_TARGET}/${i}"
140 137
141texlive-module_add_format() { 138texlive-module_add_format() {
142 local name engine mode patterns options 139 local name engine mode patterns options
143 eval $@ 140 eval $@
144 einfo "Appending to format.${PN}.cnf for $@" 141 einfo "Appending to format.${PN}.cnf for $@"
145 [ -d texmf/fmtutil ] || mkdir -p texmf/fmtutil 142 [ -d texmf-dist/fmtutil ] || mkdir -p texmf-dist/fmtutil
146 [ -f texmf/fmtutil/format.${PN}.cnf ] || { echo "# Generated for ${PN} by texlive-module.eclass" > texmf/fmtutil/format.${PN}.cnf; } 143 [ -f texmf-dist/fmtutil/format.${PN}.cnf ] || { echo "# Generated for ${PN} by texlive-module.eclass" > texmf-dist/fmtutil/format.${PN}.cnf; }
147 if [ "${mode}" = "disabled" ]; then 144 if [ "${mode}" = "disabled" ]; then
148 printf "#! " >> texmf/fmtutil/format.${PN}.cnf 145 printf "#! " >> texmf-dist/fmtutil/format.${PN}.cnf
149 fi 146 fi
150 [ -z "${patterns}" ] && patterns="-" 147 [ -z "${patterns}" ] && patterns="-"
151 printf "${name}\t${engine}\t${patterns}\t${options}\n" >> texmf/fmtutil/format.${PN}.cnf 148 printf "${name}\t${engine}\t${patterns}\t${options}\n" >> texmf-dist/fmtutil/format.${PN}.cnf
152} 149}
153 150
154# @FUNCTION: texlive-module_make_language_def_lines 151# @FUNCTION: texlive-module_make_language_def_lines
155# @DESCRIPTION: 152# @DESCRIPTION:
156# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d. 153# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d.
277 die "No rule to proccess ${command}. Please file a bug." 274 die "No rule to proccess ${command}. Please file a bug."
278 esac 275 esac
279 done 276 done
280 277
281 # Build format files 278 # Build format files
282 for i in texmf/fmtutil/format*.cnf; do 279 for i in texmf-dist/fmtutil/format*.cnf; do
283 if [ -f "${i}" ]; then 280 if [ -f "${i}" ]; then
284 einfo "Building format ${i}" 281 einfo "Building format ${i}"
282 [ -d texmf-var ] || mkdir texmf-var
283 [ -d texmf-var/web2c ] || mkdir texmf-var/web2c
285 VARTEXFONTS="${T}/fonts" TEXMFHOME="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\ 284 VARTEXFONTS="${T}/fonts" TEXMFHOME="${S}/texmf:${S}/texmf-dist:${S}/texmf-var"\
286 env -u TEXINPUTS fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\ 285 env -u TEXINPUTS fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
287 || die "failed to build format ${i}" 286 || die "failed to build format ${i}"
288 fi 287 fi
289 done 288 done
297# @DESCRIPTION: 296# @DESCRIPTION:
298# exported function: 297# exported function:
299# Installs texmf and config files to the system. 298# Installs texmf and config files to the system.
300 299
301texlive-module_src_install() { 300texlive-module_src_install() {
302 for i in texmf/fmtutil/format*.cnf; do 301 for i in texmf-dist/fmtutil/format*.cnf; do
303 [ -f "${i}" ] && etexlinks "${i}" 302 [ -f "${i}" ] && etexlinks "${i}"
304 done 303 done
305 304
306 dodir /usr/share 305 dodir /usr/share
307 if [ -z "${PN##*documentation*}" ] || use doc; then 306 if [ -z "${PN##*documentation*}" ] || use doc; then
308 [ -d texmf-doc ] && cp -pR texmf-doc "${D}/usr/share/" 307 [ -d texmf-doc ] && cp -pR texmf-doc "${ED}/usr/share/"
309 else 308 else
310 [ -d texmf/doc ] && rm -rf texmf/doc 309 [ -d texmf/doc ] && rm -rf texmf/doc
311 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc 310 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc
312 fi 311 fi
313 312
314 [ -d texmf ] && cp -pR texmf "${D}/usr/share/" 313 [ -d texmf ] && cp -pR texmf "${ED}/usr/share/"
315 [ -d texmf-dist ] && cp -pR texmf-dist "${D}/usr/share/" 314 [ -d texmf-dist ] && cp -pR texmf-dist "${ED}/usr/share/"
316 [ -d tlpkg ] && use source && cp -pR tlpkg "${D}/usr/share/" 315 [ -d tlpkg ] && use source && cp -pR tlpkg "${ED}/usr/share/"
317 316
318 insinto /var/lib/texmf 317 insinto /var/lib/texmf
319 [ -d texmf-var ] && doins -r texmf-var/* 318 [ -d texmf-var ] && doins -r texmf-var/*
320 319
321 insinto /etc/texmf/updmap.d 320 insinto /etc/texmf/updmap.d
339 insinto /etc/texmf/language.dat.lua.d 338 insinto /etc/texmf/language.dat.lua.d
340 doins "${S}/language.${PN}.dat.lua" 339 doins "${S}/language.${PN}.dat.lua"
341 fi 340 fi
342 341
343 [ -n "${TEXLIVE_MODULE_BINSCRIPTS}" ] && dobin_texmf_scripts ${TEXLIVE_MODULE_BINSCRIPTS} 342 [ -n "${TEXLIVE_MODULE_BINSCRIPTS}" ] && dobin_texmf_scripts ${TEXLIVE_MODULE_BINSCRIPTS}
343 if [ -n "${TEXLIVE_MODULE_BINLINKS}" ] ; then
344 for i in ${TEXLIVE_MODULE_BINLINKS} ; do
345 [ -f "${ED}/usr/bin/${i%:*}" ] || die "Trying to install an invalid BINLINK. This should not happen. Please file a bug."
346 dosym ${i%:*} /usr/bin/${i#*:}
347 done
348 fi
344 349
345 texlive-common_handle_config_files 350 texlive-common_handle_config_files
351 TEXMF_PATH=${TEXMF_DIST_PATH} texlive-common_handle_config_files
346} 352}
347 353
348# @FUNCTION: texlive-module_pkg_postinst 354# @FUNCTION: texlive-module_pkg_postinst
349# @DESCRIPTION: 355# @DESCRIPTION:
350# exported function: 356# exported function:

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.67

  ViewVC Help
Powered by ViewVC 1.1.20