/[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.1 Revision 1.8
1# Copyright 1999-2004 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.1 2007/10/14 07:47:10 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.8 2008/02/14 09:02:11 aballier Exp $
4 4
5# @ECLASS: texlive-module.eclass
6# @MAINTAINER:
7# tex@gentoo.org
5# 8#
6# 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
11# @DESCRIPTION:
7# 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
8# only have to inherit this eclass. 13# only have to inherit this eclass.
9# 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
10# of packages that it will install. 15# of packages that it will install. (See below)
11# TEXLIVE_MODULE_CONTENTS will be expanded to SRC_URI : 16#
12# foo -> texlive-module-foo-${PV}.zip
13# What is assumed is that it unpacks texmf and texmf-dist directories to 17# What is assumed is that it unpacks texmf and texmf-dist directories to
14# ${WORKDIR}. 18# ${WORKDIR}.
15# 19#
20# It inherits texlive-common
21
22# @ECLASS-VARIABLE: TEXLIVE_MODULE_CONTENTS
23# @DESCRIPTION:
24# The list of packages that will be installed. This variable will be expanded to
25# SRC_URI:
26#
27# foo -> texlive-module-foo-${PV}.zip
16 28
17inherit texlive-common 29inherit texlive-common
18 30
19HOMEPAGE="http://www.tug.org/texlive/" 31HOMEPAGE="http://www.tug.org/texlive/"
20 32
32 44
33IUSE="doc" 45IUSE="doc"
34 46
35S="${WORKDIR}" 47S="${WORKDIR}"
36 48
49# @FUNCTION: texlive-module_src_compile
50# @DESCRIPTION:
37# src_compile, exported function: 51# exported function:
38# Will look for format.foo.cnf and build foo format files using fmtutil 52# Will look for format.foo.cnf and build foo format files using fmtutil
39# (provided by texlive-core). The compiled format files will be sent to 53# (provided by texlive-core). The compiled format files will be sent to
40# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the 54# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the
41# sandbox 55# sandbox
42# The next step is to generate config files that are to be installed in 56# The next step is to generate config files that are to be installed in
75 echo "f ${parameter}" >> "${S}/${PN}-config";; 89 echo "f ${parameter}" >> "${S}/${PN}-config";;
76 esac 90 esac
77 done 91 done
78} 92}
79 93
94# @FUNCTION: texlive-module_src_install
95# @DESCRIPTION:
80# src_install, exported function: 96# exported function:
81# Install texmf and config files to the system 97# Install texmf and config files to the system
82 98
83texlive-module_src_install() { 99texlive-module_src_install() {
100 for i in texmf/fmtutil/format*.cnf; do
101 [ -f "${i}" ] && etexlinks "${i}"
102 done
103
84 insinto /usr/share 104 insinto /usr/share
105 if use doc; then
106 [ -d texmf-doc ] && doins -r texmf-doc
107 else
108 [ -d texmf/doc ] && rm -rf texmf/doc
109 [ -d texmf-dist/doc ] && rm -rf texmf-dist/doc
110 fi
111
85 [ -d texmf ] && doins -r texmf 112 [ -d texmf ] && doins -r texmf
86 [ -d texmf-dist ] && doins -r texmf-dist 113 [ -d texmf-dist ] && doins -r texmf-dist
114
115 insinto /var/lib/texmf
87 [ -d texmf-var ] && doins -r texmf-var 116 [ -d texmf-var ] && doins -r texmf-var/*
88 use doc && [ -d texmf-doc ] && doins -r texmf-doc
89 117
90 insinto /etc/texmf/updmap.d 118 insinto /etc/texmf/updmap.d
91 [ -f "${S}/${PN}.cfg" ] && doins "${S}/${PN}.cfg" 119 [ -f "${S}/${PN}.cfg" ] && doins "${S}/${PN}.cfg"
92 insinto /etc/texmf/dvips/config 120 insinto /etc/texmf/dvips.d
93 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps" 121 [ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
94 insinto /etc/texmf/dvipdfm/config 122 insinto /etc/texmf/dvipdfm/config
95 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config" 123 [ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
96 124
97 texlive-common_handle_config_files 125 texlive-common_handle_config_files
98} 126}
99 127
100# pkg_postinst and pkg_postrm, exported functions: 128# @FUNCTION: texlive-module_pkg_postinst
129# @DESCRIPTION:
130# exported function:
101# run texmf-update to ensure the tex installation is consistent with the 131# run texmf-update to ensure the tex installation is consistent with the
102# installed texmf trees. 132# installed texmf trees.
103 133
104texlive-module_pkg_postinst() { 134texlive-module_pkg_postinst() {
105 if [ "$ROOT" = "/" ] ; then 135 if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then
106 /usr/sbin/texmf-update 136 /usr/sbin/texmf-update
137 else
138 ewarn "Cannot run texmf-update for some reason."
139 ewarn "Your texmf tree might be inconsistent with your configuration"
140 ewarn "Please try to figure what has happened"
107 fi 141 fi
108} 142}
109 143
144# @FUNCTION: texlive-module_pkg_postrm
145# @DESCRIPTION:
146# exported function:
147# run texmf-update to ensure the tex installation is consistent with the
148# installed texmf trees.
149
110texlive-module_pkg_postrm() { 150texlive-module_pkg_postrm() {
111 if [ "$ROOT" = "/" ] ; then 151 if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then
112 /usr/sbin/texmf-update 152 /usr/sbin/texmf-update
153 else
154 ewarn "Cannot run texmf-update for some reason."
155 ewarn "Your texmf tree might be inconsistent with your configuration"
156 ewarn "Please try to figure what has happened"
113 fi 157 fi
114} 158}
115 159
116EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm 160EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20