/[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.11
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.11 2008/07/03 22:36:12 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
28 29
29inherit texlive-common 30inherit texlive-common
30 31
31HOMEPAGE="http://www.tug.org/texlive/" 32HOMEPAGE="http://www.tug.org/texlive/"
32 33
34COMMON_DEPEND=">=app-text/texlive-core-${PV}
35 ${TEXLIVE_MODULES_DEPS}"
36
37# TeX Live 2007 was providing .zip files of CTAN packages. For 2008 they are now
38# .tar.lzma
39if [ -z "${PV##2007*}" ] ; then
33for i in ${TEXLIVE_MODULE_CONTENTS}; do 40for i in ${TEXLIVE_MODULE_CONTENTS}; do
34 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip" 41 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
35done 42done
36
37COMMON_DEPEND=">=app-text/texlive-core-${PV}
38 ${TEXLIVE_MODULES_DEPS}"
39
40DEPEND="${COMMON_DEPEND} 43DEPEND="${COMMON_DEPEND}
41 app-arch/unzip" 44 app-arch/unzip"
45else
46for i in ${TEXLIVE_MODULE_CONTENTS}; do
47 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma"
48done
49DEPEND="${COMMON_DEPEND}
50 app-arch/lzma-utils"
51fi
42 52
43RDEPEND="${COMMON_DEPEND}" 53RDEPEND="${COMMON_DEPEND}"
44 54
45IUSE="doc" 55[ -z "${PN##*documentation*}" ] || IUSE="doc"
46 56
47S="${WORKDIR}" 57S="${WORKDIR}"
48 58
49# @FUNCTION: texlive-module_src_compile 59# @FUNCTION: texlive-module_src_compile
50# @DESCRIPTION: 60# @DESCRIPTION:
67 || die "failed to build format ${i}" 77 || die "failed to build format ${i}"
68 fi 78 fi
69 done 79 done
70 80
71 # Generate config files 81 # Generate config files
82 # TeX Live 2007 was providing lists. For 2008 they are now tlpobj.
83 if [ -z "${PV##2007*}" ] ; then
72 for i in "${S}"/texmf/lists/*; 84 for i in "${S}"/texmf/lists/*;
73 do 85 do
74 grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs" 86 grep '^!' "${i}" | sed -e 's/^!//' | tr ' ' '@' |sort|uniq >> "${T}/jobs"
75 done 87 done
88 else
89 for i in "${S}"/tlpkg/tlpobj/*;
90 do
91 grep '^execute ' "${i}" | sed -e 's/^execute //' | tr ' ' '@' |sort|uniq >> "${T}/jobs"
92 done
93 fi
76 94
77 for j in $(<"${T}/jobs"); 95 for i in $(<"${T}/jobs");
78 do 96 do
79 command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/') 97 j="$(echo $i | tr '@' ' ')"
80 parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/') 98 command=${j%% *}
99 parameter=${j#* }
81 case "${command}" in 100 case "${command}" in
82 addMap) 101 addMap)
83 echo "Map ${parameter}" >> "${S}/${PN}.cfg";; 102 echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
84 addMixedMap) 103 addMixedMap)
85 echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";; 104 echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
86 addDvipsMap) 105 addDvipsMap)
87 echo "p +${parameter}" >> "${S}/${PN}-config.ps";; 106 echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
88 addDvipdfmMap) 107 addDvipdfmMap)
89 echo "f ${parameter}" >> "${S}/${PN}-config";; 108 echo "f ${parameter}" >> "${S}/${PN}-config";;
109 AddHyphen)
110 ewarn "Sorry, $command not implemented yet.";;
111 BuildFormat)
112 elog "Format $parameter already built.";;
113 BuildLanguageDat)
114 elog "Language file $parameter already generated.";;
115 *)
116 die "No rule to proccess ${command}. Please file a bug."
90 esac 117 esac
91 done 118 done
92} 119}
93 120
94# @FUNCTION: texlive-module_src_install 121# @FUNCTION: texlive-module_src_install
100 for i in texmf/fmtutil/format*.cnf; do 127 for i in texmf/fmtutil/format*.cnf; do
101 [ -f "${i}" ] && etexlinks "${i}" 128 [ -f "${i}" ] && etexlinks "${i}"
102 done 129 done
103 130
104 insinto /usr/share 131 insinto /usr/share
105 if use doc; then 132 if [ -z "${PN##*documentation*}" ] || use doc; then
106 [ -d texmf-doc ] && doins -r texmf-doc 133 [ -d texmf-doc ] && doins -r texmf-doc
107 else 134 else
108 [ -d texmf/doc ] && rm -rf texmf/doc 135 [ -d texmf/doc ] && rm -rf texmf/doc
109 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc 136 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc
110 fi 137 fi
111 138
112 [ -d texmf ] && doins -r texmf 139 [ -d texmf ] && doins -r texmf
113 [ -d texmf-dist ] && doins -r texmf-dist 140 [ -d texmf-dist ] && doins -r texmf-dist
141 [ -d tlpkg ] && doins -r tlpkg
114 142
115 insinto /var/lib/texmf 143 insinto /var/lib/texmf
116 [ -d texmf-var ] && doins -r texmf-var/* 144 [ -d texmf-var ] && doins -r texmf-var/*
117 145
118 insinto /etc/texmf/updmap.d 146 insinto /etc/texmf/updmap.d

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

  ViewVC Help
Powered by ViewVC 1.1.20