/[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.14 Revision 1.15
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.14 2008/08/21 13:04:21 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.15 2008/08/22 11:31:40 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#
85 85
86[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc" 86[ -z "${PN##*documentation*}" ] || IUSE="${IUSE} doc"
87 87
88S="${WORKDIR}" 88S="${WORKDIR}"
89 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/langauge.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/langauge.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}
130
90# @FUNCTION: texlive-module_src_compile 131# @FUNCTION: texlive-module_src_compile
91# @DESCRIPTION: 132# @DESCRIPTION:
92# exported function: 133# exported function:
93# 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
94# (provided by texlive-core). The compiled format files will be sent to 135# (provided by texlive-core). The compiled format files will be sent to
136 addDvipsMap) 177 addDvipsMap)
137 echo "p +${parameter}" >> "${S}/${PN}-config.ps";; 178 echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
138 addDvipdfmMap) 179 addDvipdfmMap)
139 echo "f ${parameter}" >> "${S}/${PN}-config";; 180 echo "f ${parameter}" >> "${S}/${PN}-config";;
140 AddHyphen) 181 AddHyphen)
141 ewarn "Sorry, $command not implemented yet.";; 182 texlive-module_make_language_def_lines "$parameter"
183 texlive-module_make_language_dat_lines "$parameter";;
142 BuildFormat) 184 BuildFormat)
143 einfo "Format $parameter already built.";; 185 einfo "Format $parameter already built.";;
144 BuildLanguageDat) 186 BuildLanguageDat)
145 einfo "Language file $parameter already generated.";; 187 einfo "Language file $parameter already generated.";;
146 *) 188 *)
179 insinto /etc/texmf/dvips.d 221 insinto /etc/texmf/dvips.d
180 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps" 222 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
181 insinto /etc/texmf/dvipdfm/config 223 insinto /etc/texmf/dvipdfm/config
182 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config" 224 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
183 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
184 texlive-common_handle_config_files 236 texlive-common_handle_config_files
185} 237}
186 238
187# @FUNCTION: texlive-module_pkg_postinst 239# @FUNCTION: texlive-module_pkg_postinst
188# @DESCRIPTION: 240# @DESCRIPTION:

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

  ViewVC Help
Powered by ViewVC 1.1.20