From: Alexis Ballier <aballier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Modular texlive eclasses up for review
Date: Tue, 9 Oct 2007 13:17:46 +0200 [thread overview]
Message-ID: <20071009131746.4fcfba57@toz.strangled.net> (raw)
In-Reply-To: <1191914011.2619.7.camel@uberpc.marples.name>
[-- Attachment #1.1: Type: text/plain, Size: 856 bytes --]
On Tue, 09 Oct 2007 08:13:31 +0100
Roy Marples <uberlord@gentoo.org> wrote:
> grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
> Could be done with a 1 sed and 1 sort call, but whatever floats your
> boat.
well as this is very inspired from texlive install-pkg.sh script, I'd
prefer not differing that much.
> if [ "${f/config/}" != "${f}" ]
> Should be
> if [ "${f#*config*}" != "${f}" ]
changed that one, the "semantics" looks better indeed; what is wanted
here is to exclude $f containing "config". Am I missing something when
I understand it as the exact same thing but more readable ?
> return $([ -f "${mark}" ])
> Could be written as
> [ -f "${mark}" ]
thanks, too much influence from other programming languages...
Attached try3, with some more comments on the functions of
texlive-module.eclass.
Alexis.
[-- Attachment #1.2: texlive-module.eclass --]
[-- Type: application/octet-stream, Size: 3346 bytes --]
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
# only have to inherit this eclass.
# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list
# of packages that it will install.
# TEXLIVE_MODULE_CONTENTS will be expanded to SRC_URI :
# foo -> texlive-module-foo-${PV}.zip
# What is assumed is that it unpacks texmf and texmf-dist directories to
# ${WORKDIR}.
#
inherit texlive-common
HOMEPAGE="http://www.tug.org/texlive/"
for i in ${TEXLIVE_MODULE_CONTENTS}; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
done
COMMON_DEPEND=">=app-text/texlive-core-${PV}
${TEXLIVE_MODULES_DEPS}"
DEPEND="${COMMON_DEPEND}
app-arch/unzip"
RDEPEND="${COMMON_DEPEND}"
IUSE="doc"
S="${WORKDIR}"
# src_compile, exported function:
# Will look for format.foo.cnf and build foo format files using fmtutil
# (provided by texlive-core). The compiled format files will be sent to
# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the
# sandbox
# The next step is to generate config files that are to be installed in
# /etc/texmf; texmf-update script will take care of merging the different config
# files for different packages in a single one used by the whole tex installation.
texlive-module_src_compile() {
# Build format files
for i in texmf/fmtutil/format*.cnf; do
if [ -f "${i}" ]; then
einfo "Building format ${i}"
TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
|| die "failed to build format ${i}"
fi
done
# Generate config files
for i in "${S}"/texmf/lists/*;
do
grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
done
for j in $(<"${T}/jobs");
do
command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/')
parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/')
case "${command}" in
addMap)
echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
addMixedMap)
echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
addDvipsMap)
echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
addDvipdfmMap)
echo "f ${parameter}" >> "${S}/${PN}-config";;
esac
done
}
# src_install, exported function:
# Install texmf and config files to the system
texlive-module_src_install() {
insinto /usr/share
[ -d texmf ] && doins -r texmf
[ -d texmf-dist ] && doins -r texmf-dist
[ -d texmf-var ] && doins -r texmf-var
use doc && [ -d texmf-doc ] && doins -r texmf-doc
insinto /etc/texmf/updmap.d
[ -f "${S}/${PN}.cfg" ] && doins "${S}/${PN}.cfg"
insinto /etc/texmf/dvips/config
[ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
insinto /etc/texmf/dvipdfm/config
[ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
texlive-common_handle_config_files
}
# pkg_postinst and pkg_postrm, exported functions:
# run texmf-update to ensure the tex installation is consistent with the
# installed texmf trees.
texlive-module_pkg_postinst() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
texlive-module_pkg_postrm() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
[-- Attachment #1.3: texlive-common.eclass --]
[-- Type: application/octet-stream, Size: 1442 bytes --]
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide various functions used by both texlive-core and texlive
# modules.
# Note that this eclass *must* not assume the presence of any standard tex tool
#
TEXMF_PATH=/usr/share/texmf
TEXMF_DIST_PATH=/usr/share/texmf-dist
TEXMF_VAR_PATH=/usr/share/texmf-var
# Has to be called in src_install after having installed the files in ${D}
# This function will move the relevant files to /etc/texmf and symling them
# from their original location. This is to allow easy update of texlive's
# configuration
texlive-common_handle_config_files() {
# Handle config files properly
cd "${D}${TEXMF_PATH}"
for f in $(find . -name '*.cnf' -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
if [ "${f#*config*}" != "${f}" ] ; then
continue
fi
dodir /etc/texmf/$(dirname ${f}).d
mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed."
dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f}
done
}
# Return if a file is present in the texmf tree
# Call it from the directory containing texmf and texmf-dist
texlive-common_is_file_present_in_texmf() {
local mark="${T}/$1.found"
find texmf -name $1 -exec touch "${mark}" \;
find texmf-dist -name $1 -exec touch "${mark}" \;
[ -f "${mark}" ]
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-10-09 11:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 21:47 [gentoo-dev] Modular texlive eclasses up for review Alexis Ballier
2007-10-08 23:03 ` Alexis Ballier
2007-10-09 0:08 ` Jeroen Roovers
2007-10-09 7:13 ` Roy Marples
2007-10-09 11:17 ` Alexis Ballier [this message]
2007-10-09 12:00 ` Roy Marples
2007-10-09 12:49 ` Francesco Riosa
2007-10-10 9:58 ` Alexis Ballier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071009131746.4fcfba57@toz.strangled.net \
--to=aballier@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox