/[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.12 Revision 1.16
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.12 2008/07/14 16:42:48 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.16 2008/08/22 11:32:30 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#
9# Original Author: Alexis Ballier <aballier@gentoo.org> 9# Original Author: Alexis Ballier <aballier@gentoo.org>
10# @BLURB: Provide generic install functions so that modular texlive's texmf ebuild will only have to inherit this eclass 10# @BLURB: Provide generic install functions so that modular texlive's texmf ebuild will only have to inherit this eclass
11# @DESCRIPTION: 11# @DESCRIPTION:
12# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will 12# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
13# only have to inherit this eclass. 13# only have to inherit this eclass.
14# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list 14# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list
15# of packages that it will install. (See below) 15# of packages that it will install. (See below)
16# 16#
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# For TeX Live 2007: 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# 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
29 41
30inherit texlive-common 42inherit texlive-common
31 43
32HOMEPAGE="http://www.tug.org/texlive/" 44HOMEPAGE="http://www.tug.org/texlive/"
33 45
49 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma" 61 SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.lzma"
50done 62done
51DEPEND="${COMMON_DEPEND} 63DEPEND="${COMMON_DEPEND}
52 app-arch/lzma-utils" 64 app-arch/lzma-utils"
53IUSE="${IUSE} source" 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} )"
54fi 81fi
82fi
55 83
56RDEPEND="${COMMON_DEPEND}" 84RDEPEND="${COMMON_DEPEND}"
57 85
58[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc" 86[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc"
59 87
60S="${WORKDIR}" 88S="${WORKDIR}"
89
90
91# @FUNCTION: texlive-module_make_language_def_lines
92# @DESCRIPTION:
93# Only valid for TeXLive 2008.
94# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d
95# It parses the AddHyphen directive of tlpobj files to create it.
96
97texlive-module_make_language_def_lines() {
98 local lefthyphenmin righthyphenmin synonyms name file
99 eval $@
100 einfo "Generating language.def entry for $@"
101 [ -z "$lefthyphenmin" ] && lefthyphenmin="2"
102 [ -z "$righthyphenmin" ] && righthyphenmin="3"
103 echo "\\addlanguage{$name}{$file}{}{$lefthyphenmin}{$righthyphenmin}" >> "${S}/language.${PN}.def"
104 if [ -n "$synonyms" ] ; then
105 for i in $(echo $synonyms | tr ',' ' ') ; do
106 einfo "Generating language.def synonym $i for $@"
107 echo "\\addlanguage{$i}{$file}{}{$lefthyphenmin}{$righthyphenmin}" >> "${S}/language.${PN}.def"
108 done
109 fi
110}
111
112# @FUNCTION: texlive-module_make_language_dat_lines
113# @DESCRIPTION:
114# Only valid for TeXLive 2008.
115# Creates a language.${PN}.dat entry to put in /etc/texmf/language.dat.d
116# It parses the AddHyphen directive of tlpobj files to create it.
117
118texlive-module_make_language_dat_lines() {
119 local lefthyphenmin righthyphenmin synonyms name file
120 eval $@
121 einfo "Generating language.dat entry for $@"
122 echo "$name $file" >> "${S}/language.${PN}.dat"
123 if [ -n "$synonyms" ] ; then
124 for i in $(echo $synonyms | tr ',' ' ') ; do
125 einfo "Generating language.dat synonym $i for $@"
126 echo "=$i" >> "${S}/language.${PN}.dat"
127 done
128 fi
129}
61 130
62# @FUNCTION: texlive-module_src_compile 131# @FUNCTION: texlive-module_src_compile
63# @DESCRIPTION: 132# @DESCRIPTION:
64# exported function: 133# exported function:
65# Will look for format.foo.cnf and build foo format files using fmtutil 134# Will look for format.foo.cnf and build foo format files using fmtutil
108 addDvipsMap) 177 addDvipsMap)
109 echo "p +${parameter}" >> "${S}/${PN}-config.ps";; 178 echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
110 addDvipdfmMap) 179 addDvipdfmMap)
111 echo "f ${parameter}" >> "${S}/${PN}-config";; 180 echo "f ${parameter}" >> "${S}/${PN}-config";;
112 AddHyphen) 181 AddHyphen)
113 ewarn "Sorry, $command not implemented yet.";; 182 texlive-module_make_language_def_lines "$parameter"
183 texlive-module_make_language_dat_lines "$parameter";;
114 BuildFormat) 184 BuildFormat)
115 elog "Format $parameter already built.";; 185 einfo "Format $parameter already built.";;
116 BuildLanguageDat) 186 BuildLanguageDat)
117 elog "Language file $parameter already generated.";; 187 einfo "Language file $parameter already generated.";;
118 *) 188 *)
119 die "No rule to proccess ${command}. Please file a bug." 189 die "No rule to proccess ${command}. Please file a bug."
120 esac 190 esac
121 done 191 done
122} 192}
151 insinto /etc/texmf/dvips.d 221 insinto /etc/texmf/dvips.d
152 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps" 222 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
153 insinto /etc/texmf/dvipdfm/config 223 insinto /etc/texmf/dvipdfm/config
154 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config" 224 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
155 225
226 if [ -f "${S}/language.${PN}.def" ] ; then
227 insinto /etc/texmf/language.def.d
228 doins "${S}/language.${PN}.def"
229 fi
230
231 if [ -f "${S}/language.${PN}.dat" ] ; then
232 insinto /etc/texmf/language.dat.d
233 doins "${S}/language.${PN}.dat"
234 fi
235
156 texlive-common_handle_config_files 236 texlive-common_handle_config_files
157} 237}
158 238
159# @FUNCTION: texlive-module_pkg_postinst 239# @FUNCTION: texlive-module_pkg_postinst
160# @DESCRIPTION: 240# @DESCRIPTION:

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20