/[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.66 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.66 2013/07/05 22:43:41 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:
60# @DESCRIPTION: 60# @DESCRIPTION:
61# Information to display about the package. 61# Information to display about the package.
62# e.g. for enabling/disabling a feature 62# e.g. for enabling/disabling a feature
63 63
64inherit 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
65 73
66HOMEPAGE="http://www.tug.org/texlive/" 74HOMEPAGE="http://www.tug.org/texlive/"
67 75
68COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}" 76COMMON_DEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}"
69 77
101S="${WORKDIR}" 109S="${WORKDIR}"
102 110
103# @FUNCTION: texlive-module_src_unpack 111# @FUNCTION: texlive-module_src_unpack
104# @DESCRIPTION: 112# @DESCRIPTION:
105# Only for TeX Live 2009 and later. 113# Only for TeX Live 2009 and later.
106# Gives tar.xz unpack support until we can use an EAPI with that support.
107# If EAPI supports tar.xz then it calls unpack instead of its own unpacker.
108# 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.
109 115
110RELOC_TARGET=texmf-dist 116RELOC_TARGET=texmf-dist
111 117
112texlive-module_src_unpack() { 118texlive-module_src_unpack() {
113 if has "${EAPI:-0}" 0 1 2 ; then
114 local i s
115 # Avoid installing world writable files
116 # Bugs #309997, #310039, #338881
117 umask 022
118 for i in ${A}
119 do
120 s="${DISTDIR%/}/${i}"
121 einfo "Unpacking ${s} to ${PWD}"
122 test -s "${s}" || die "${s} does not exist"
123 xz -dc -- "${s}" | tar xof - || die "Unpacking ${s} failed"
124 done
125 else
126 unpack ${A} 119 unpack ${A}
127 fi
128 120
129 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"
130 { 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"
131 for i in $(<"${T}/dirlist"); do 123 for i in $(<"${T}/dirlist"); do
132 [ -d "${RELOC_TARGET}/${i}" ] || mkdir -p "${RELOC_TARGET}/${i}" 124 [ -d "${RELOC_TARGET}/${i}" ] || mkdir -p "${RELOC_TARGET}/${i}"
310 [ -f "${i}" ] && etexlinks "${i}" 302 [ -f "${i}" ] && etexlinks "${i}"
311 done 303 done
312 304
313 dodir /usr/share 305 dodir /usr/share
314 if [ -z "${PN##*documentation*}" ] || use doc; then 306 if [ -z "${PN##*documentation*}" ] || use doc; then
315 [ -d texmf-doc ] && cp -pR texmf-doc "${D}/usr/share/" 307 [ -d texmf-doc ] && cp -pR texmf-doc "${ED}/usr/share/"
316 else 308 else
317 [ -d texmf/doc ] && rm -rf texmf/doc 309 [ -d texmf/doc ] && rm -rf texmf/doc
318 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc 310 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc
319 fi 311 fi
320 312
321 [ -d texmf ] && cp -pR texmf "${D}/usr/share/" 313 [ -d texmf ] && cp -pR texmf "${ED}/usr/share/"
322 [ -d texmf-dist ] && cp -pR texmf-dist "${D}/usr/share/" 314 [ -d texmf-dist ] && cp -pR texmf-dist "${ED}/usr/share/"
323 [ -d tlpkg ] && use source && cp -pR tlpkg "${D}/usr/share/" 315 [ -d tlpkg ] && use source && cp -pR tlpkg "${ED}/usr/share/"
324 316
325 insinto /var/lib/texmf 317 insinto /var/lib/texmf
326 [ -d texmf-var ] && doins -r texmf-var/* 318 [ -d texmf-var ] && doins -r texmf-var/*
327 319
328 insinto /etc/texmf/updmap.d 320 insinto /etc/texmf/updmap.d

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

  ViewVC Help
Powered by ViewVC 1.1.20