/[gentoo-x86]/eclass/texlive-common.eclass
Gentoo

Diff of /eclass/texlive-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.20 Revision 1.21
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2014 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-common.eclass,v 1.20 2013/06/26 15:54:48 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.21 2014/03/18 16:52:10 ottxor Exp $
4 4
5# @ECLASS: texlive-common.eclass 5# @ECLASS: texlive-common.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# tex@gentoo.org 7# tex@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
12# Purpose: Provide various functions used by both texlive-core and texlive 12# Purpose: Provide various functions used by both texlive-core and texlive
13# modules. 13# modules.
14# 14#
15# Note that this eclass *must* not assume the presence of any standard tex tool 15# Note that this eclass *must* not assume the presence of any standard tex tool
16 16
17case "${EAPI:-0}" in
18 0|1|2)
19 die "EAPI='${EAPI}' is not supported anymore"
20 ;;
21 *)
22 ;;
23esac
17 24
18TEXMF_PATH=/usr/share/texmf 25TEXMF_PATH=/usr/share/texmf
19TEXMF_DIST_PATH=/usr/share/texmf-dist 26TEXMF_DIST_PATH=/usr/share/texmf-dist
20TEXMF_VAR_PATH=/var/lib/texmf 27TEXMF_VAR_PATH=/var/lib/texmf
21 28
26# from their original location. This is to allow easy update of texlive's 33# from their original location. This is to allow easy update of texlive's
27# configuration 34# configuration
28 35
29texlive-common_handle_config_files() { 36texlive-common_handle_config_files() {
30 # Handle config files properly 37 # Handle config files properly
31 [ -d "${D}${TEXMF_PATH}" ] || return 38 [ -d "${ED}${TEXMF_PATH}" ] || return
32 cd "${D}${TEXMF_PATH}" 39 cd "${ED}${TEXMF_PATH}"
33 for f in $(find . -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do 40 for f in $(find . -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
34 if [ "${f#*config}" != "${f}" -o "${f#doc}" != "${f}" ] ; then 41 if [ "${f#*config}" != "${f}" -o "${f#doc}" != "${f}" ] ; then
35 continue 42 continue
36 fi 43 fi
37 dodir /etc/texmf/$(dirname ${f}).d 44 dodir /etc/texmf/$(dirname ${f}).d
38 einfo "Moving (and symlinking) ${TEXMF_PATH}/${f} to /etc/texmf/$(dirname ${f}).d" 45 einfo "Moving (and symlinking) ${EPREFIX}${TEXMF_PATH}/${f} to ${EPREFIX}/etc/texmf/$(dirname ${f}).d"
39 mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed." 46 mv "${ED}/${TEXMF_PATH}/${f}" "${ED}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed."
40 dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f} 47 dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f}
41 done 48 done
42} 49}
43 50
44# @FUNCTION: texlive-common_is_file_present_in_texmf 51# @FUNCTION: texlive-common_is_file_present_in_texmf
76 ;; 83 ;;
77 *) 84 *)
78 if [ $1 = $2 ]; 85 if [ $1 = $2 ];
79 then 86 then
80 einfo "Symlink $1 -> $2 skipped" 87 einfo "Symlink $1 -> $2 skipped"
81 elif [ -e "${D}/usr/bin/$1" ]; 88 elif [ -e "${ED}/usr/bin/$1" ];
82 then 89 then
83 einfo "Symlink $1 skipped (file exists)" 90 einfo "Symlink $1 skipped (file exists)"
84 else 91 else
85 einfo "Making symlink from $1 to $2" 92 einfo "Making symlink from $1 to $2"
86 dosym $2 /usr/bin/$1 93 dosym $2 /usr/bin/$1
117 124
118dobin_texmf_scripts() { 125dobin_texmf_scripts() {
119 while [ $# -gt 0 ] ; do 126 while [ $# -gt 0 ] ; do
120 local trg=$(basename ${1} | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]') 127 local trg=$(basename ${1} | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]')
121 einfo "Installing ${1} as ${trg} bin wrapper" 128 einfo "Installing ${1} as ${trg} bin wrapper"
122 [ -x "${D}/usr/share/${1}" ] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" 129 [ -x "${ED}/usr/share/${1}" ] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}"
123 dosym ../share/${1} /usr/bin/${trg} || die "failed to install ${1} as $trg" 130 dosym ../share/${1} /usr/bin/${trg} || die "failed to install ${1} as $trg"
124 shift 131 shift
125 done 132 done
126} 133}
127 134
131# Runs texmf-update if it is available and prints a warning otherwise. This 138# Runs texmf-update if it is available and prints a warning otherwise. This
132# function helps in factorizing some code. 139# function helps in factorizing some code.
133 140
134etexmf-update() { 141etexmf-update() {
135 if has_version 'app-text/texlive-core' ; then 142 if has_version 'app-text/texlive-core' ; then
136 if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then 143 if [ "$ROOT" = "/" ] && [ -x "${EPREFIX}"/usr/sbin/texmf-update ] ; then
137 /usr/sbin/texmf-update 144 "${EPREFIX}"/usr/sbin/texmf-update
138 else 145 else
139 ewarn "Cannot run texmf-update for some reason." 146 ewarn "Cannot run texmf-update for some reason."
140 ewarn "Your texmf tree might be inconsistent with your configuration" 147 ewarn "Your texmf tree might be inconsistent with your configuration"
141 ewarn "Please try to figure what has happened" 148 ewarn "Please try to figure what has happened"
142 fi 149 fi
149# Runs fmtutil-sys if it is available and prints a warning otherwise. This 156# Runs fmtutil-sys if it is available and prints a warning otherwise. This
150# function helps in factorizing some code. 157# function helps in factorizing some code.
151 158
152efmtutil-sys() { 159efmtutil-sys() {
153 if has_version 'app-text/texlive-core' ; then 160 if has_version 'app-text/texlive-core' ; then
154 if [ "$ROOT" = "/" ] && [ -x /usr/bin/fmtutil-sys ] ; then 161 if [ "$ROOT" = "/" ] && [ -x "${EPREFIX}"/usr/bin/fmtutil-sys ] ; then
155 einfo "Rebuilding formats" 162 einfo "Rebuilding formats"
156 /usr/bin/fmtutil-sys --all &> /dev/null 163 "${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null
157 else 164 else
158 ewarn "Cannot run fmtutil-sys for some reason." 165 ewarn "Cannot run fmtutil-sys for some reason."
159 ewarn "Your formats might be inconsistent with your installed ${PN} version" 166 ewarn "Your formats might be inconsistent with your installed ${PN} version"
160 ewarn "Please try to figure what has happened" 167 ewarn "Please try to figure what has happened"
161 fi 168 fi

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20