/[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.8 Revision 1.14
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.8 2008/02/14 09:02:11 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.14 2008/08/21 13:04:21 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#
22# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS 22# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS
23# @DESCRIPTION: 23# @DESCRIPTION:
24# The list of packages that will be installed. This variable will be expanded to 24# The list of packages that will be installed. This variable will be expanded to
25# SRC_URI: 25# SRC_URI:
26# 26#
27# foo -> texlive-module-foo-${PV}.zip 27# For TeX Live 2007: foo -> texlive-module-foo-${PV}.zip
28# For TeX Live 2008: foo -> texlive-module-foo-${PV}.tar.lzma
29
30# @ECLASS-VARIABLE: TEXLIVE_MODULE_DOC_CONTENTS
31# @DESCRIPTION:
32# The list of packages that will be installed if the doc useflag is enabled.
33# Expansion to SRC_URI is the same as for TEXLIVE_MODULE_CONTENTS. This is only
34# valid for TeX Live 2008
35
36# @ECLASS-VARIABLE: TEXLIVE_MODULE_SRC_CONTENTS
37# @DESCRIPTION:
38# The list of packages that will be installed if the source useflag is enabled.
39# Expansion to SRC_URI is the same as for TEXLIVE_MODULE_CONTENTS. This is only
40# valid for TeX Live 2008
28 41
29inherit texlive-common 42inherit texlive-common
30 43
31HOMEPAGE="http://www.tug.org/texlive/" 44HOMEPAGE="http://www.tug.org/texlive/"
32 45
46COMMON_DEPEND=">=app-text/texlive-core-${PV}
47 ${TEXLIVE_MODULES_DEPS}"
48
49IUSE=""
50
51# TeX Live 2007 was providing .zip files of CTAN packages. For 2008 they are now
52# .tar.lzma
53if [ -z "${PV##2007*}" ] ; then
33for i in ${TEXLIVE_MODULE_CONTENTS}; do 54for i in ${TEXLIVE_MODULE_CONTENTS}; do
34 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip" 55 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
35done 56done
36
37COMMON_DEPEND=">=app-text/texlive-core-${PV}
38 ${TEXLIVE_MODULES_DEPS}"
39
40DEPEND="${COMMON_DEPEND} 57DEPEND="${COMMON_DEPEND}
41 app-arch/unzip" 58 app-arch/unzip"
59else
60for i in ${TEXLIVE_MODULE_CONTENTS}; do
61 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma"
62done
63DEPEND="${COMMON_DEPEND}
64 app-arch/lzma-utils"
65IUSE="${IUSE} source"
66
67# Forge doc SRC_URI
68[ -n "${PN##*documentation*}" ] && [ -n "${TEXLIVE_MODULE_DOC_CONTENTS}" ] && SRC_URI="${SRC_URI} doc? ("
69for i in ${TEXLIVE_MODULE_DOC_CONTENTS}; do
70 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma"
71done
72[ -n "${PN##*documentation*}" ] && [ -n "${TEXLIVE_MODULE_DOC_CONTENTS}" ] && SRC_URI="${SRC_URI} )"
73
74# Forge source SRC_URI
75if [ -n "${TEXLIVE_MODULE_SRC_CONTENTS}" ] ; then
76 SRC_URI="${SRC_URI} source? ("
77 for i in ${TEXLIVE_MODULE_SRC_CONTENTS}; do
78 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma"
79 done
80 SRC_URI="${SRC_URI} )"
81fi
82fi
42 83
43RDEPEND="${COMMON_DEPEND}" 84RDEPEND="${COMMON_DEPEND}"
44 85
45IUSE="doc" 86[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc"
46 87
47S="${WORKDIR}" 88S="${WORKDIR}"
48 89
49# @FUNCTION: texlive-module_src_compile 90# @FUNCTION: texlive-module_src_compile
50# @DESCRIPTION: 91# @DESCRIPTION:
67 || die "failed to build format ${i}" 108 || die "failed to build format ${i}"
68 fi 109 fi
69 done 110 done
70 111
71 # Generate config files 112 # Generate config files
113 # TeX Live 2007 was providing lists. For 2008 they are now tlpobj.
114 if [ -z "${PV##2007*}" ] ; then
72 for i in "${S}"/texmf/lists/*; 115 for i in "${S}"/texmf/lists/*;
73 do 116 do
74 grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs" 117 grep '^!' "${i}" | sed -e 's/^!//' | tr ' ' '@' |sort|uniq >> "${T}/jobs"
75 done 118 done
76 119 else
77 for j in $(<"${T}/jobs"); 120 for i in "${S}"/tlpkg/tlpobj/*;
78 do 121 do
79 command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/') 122 grep '^execute ' "${i}" | sed -e 's/^execute //' | tr ' ' '@' |sort|uniq >> "${T}/jobs"
80 parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/') 123 done
124 fi
125
126 for i in $(<"${T}/jobs");
127 do
128 j="$(echo $i | tr '@' ' ')"
129 command=${j%% *}
130 parameter=${j#* }
81 case "${command}" in 131 case "${command}" in
82 addMap) 132 addMap)
83 echo "Map ${parameter}" >> "${S}/${PN}.cfg";; 133 echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
84 addMixedMap) 134 addMixedMap)
85 echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";; 135 echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
86 addDvipsMap) 136 addDvipsMap)
87 echo "p +${parameter}" >> "${S}/${PN}-config.ps";; 137 echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
88 addDvipdfmMap) 138 addDvipdfmMap)
89 echo "f ${parameter}" >> "${S}/${PN}-config";; 139 echo "f ${parameter}" >> "${S}/${PN}-config";;
140 AddHyphen)
141 ewarn "Sorry, $command not implemented yet.";;
142 BuildFormat)
143 einfo "Format $parameter already built.";;
144 BuildLanguageDat)
145 einfo "Language file $parameter already generated.";;
146 *)
147 die "No rule to proccess ${command}. Please file a bug."
90 esac 148 esac
91 done 149 done
92} 150}
93 151
94# @FUNCTION: texlive-module_src_install 152# @FUNCTION: texlive-module_src_install
100 for i in texmf/fmtutil/format*.cnf; do 158 for i in texmf/fmtutil/format*.cnf; do
101 [ -f "${i}" ] && etexlinks "${i}" 159 [ -f "${i}" ] && etexlinks "${i}"
102 done 160 done
103 161
104 insinto /usr/share 162 insinto /usr/share
105 if use doc; then 163 if [ -z "${PN##*documentation*}" ] || use doc; then
106 [ -d texmf-doc ] && doins -r texmf-doc 164 [ -d texmf-doc ] && doins -r texmf-doc
107 else 165 else
108 [ -d texmf/doc ] && rm -rf texmf/doc 166 [ -d texmf/doc ] && rm -rf texmf/doc
109 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc 167 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc
110 fi 168 fi
111 169
112 [ -d texmf ] && doins -r texmf 170 [ -d texmf ] && doins -r texmf
113 [ -d texmf-dist ] && doins -r texmf-dist 171 [ -d texmf-dist ] && doins -r texmf-dist
172 [ -n "${PV##2007*}" ] && [ -d tlpkg ] && use source && doins -r tlpkg
114 173
115 insinto /var/lib/texmf 174 insinto /var/lib/texmf
116 [ -d texmf-var ] && doins -r texmf-var/* 175 [ -d texmf-var ] && doins -r texmf-var/*
117 176
118 insinto /etc/texmf/updmap.d 177 insinto /etc/texmf/updmap.d

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20