Re: Too many conflicts? (tetex vs. texlive)
Hi Ralf, hi all!
On Sam, 15 Okt 2005, Ralf Stubner wrote:
> 4.1.1. Font configuration
> -------------------------
>
> A package that provides additional PostScript Type1 fonts for TeX
> should be useable with any Basic TeX Package. To achieve this, the
> font package should depend on `tex-common' but not on a Basic TeX
> Package. The font package should put the necessary `map' files below
> `/etc/texmf/map/' (which must be symlinked from
> `<TEXMFMAIN>/fonts/map' by the Basic TeX packages), and have them
> registered by putting a configuration file with extension `.cfg' into
> `/etc/texmf/updmap.d/' and calling `update-updmap --quiet'. The file
> contents will then be incorporated into
> `/var/lib/texmf/web2c/updmap.cfg', the effective configuration file
> for `updmap'. `mktexlsr' and `updmap-sys' have to be called
> afterwards. Since `mktexlsr' and `updmap-sys' are provided by the
> Basic TeX packages, the font package has to ensure that they are only
> called when they are present in `$PATH'.
> [...]
>
> Any comments? Anything missing? Should it be more detailed? Sould one
> include sample code?
I would add also the
/var/lib/tex-common/fontmap-cfg/$(package).list
file which includes a list of .cfg files installed under /etc/texmf/map
and the special magic string in the .cfg file.
Furthermore, I would suggest including some sample code for postinst,
postrm, something like this (basically from lmodern):
================= postinst skeleton ===================
update_fontmaps()
{
update-updmap --quiet
# mktexlsr is recommended now because updmap-sys relies heavily on
# Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
# better not to specify a particular directory to refresh because
# updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
# $TEXMFMAIN.
# According to the Debian TeX policy, running mktexlsr and updmap-sys
# should work as long as tex-common is configured and these files are
# available (general Debian policy wouldn't assure that without this
# override from the Debian TeX policy).
if which mktexlsr >/dev/null; then mktexlsr; fi
if which updmap-sys >/dev/null; then
printf "Running updmap-sys... "
updmap-sys --quiet
echo "done."
fi
return 0
}
case "$1" in
configure)
#
# Do whatever has to be done for this specific package
#
update_fontmaps
;;
abort-upgrade|abort-remove|abort-deconfigure)
#
# Do whatever has to be done for this specific package
#
update_fontmaps
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
==================== sample postinst ======================
and for postrm
==================== sample postrm ======================
#!/bin/sh -e
tell_that_errors_are_ok()
{
# Cheap option handling...
if [ "$1" = -n ]; then
prog="$2"
endwith=' '
else
prog="$1"
endwith='\n'
fi
# According to the Debian TeX policy, running mktexlsr and updmap-sys
# should work as long as tex-common is configured and these files are
# available (general Debian policy wouldn't assure that without this
# override from the Debian TeX policy).
printf "\
Trying to run '$prog' (error messages can be ignored if tex-common
is not configured)...$endwith"
return 0
}
# The function name is *try_to*_update_fontmaps because the following
# scenario might happen:
# 1. this package is deconfigured
# 2. tex-common and tetex-bin are removed
# 3. this package is removed or purged
#
# (cf. Policy § 6.5, step 2, about a conflicting package being removed due
# to the installation of the package being discussed).
#
# In this case, update-updmap, mktexlsr and updmap-sys would all be gone once
# tex-common and tetex-bin are removed, so we must append "|| true" to their
# calls.
try_to_update_fontmaps()
{
# Don't print alarming error messages if the programs aren't even
# available.
if which update-updmap >/dev/null; then
tell_that_errors_are_ok -n update-updmap
update-updmap --quiet || true
echo "done."
fi
# mktexlsr is recommended now because updmap-sys relies heavily on
# Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
# better not to specify a particular directory to refresh because
# updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
# $TEXMFMAIN.
if which mktexlsr >/dev/null; then
tell_that_errors_are_ok mktexlsr
mktexlsr || true
echo "done."
fi
if which updmap-sys >/dev/null; then
tell_that_errors_are_ok -n updmap-sys
updmap-sys --quiet || true
echo "done."
fi
return 0
}
case "$1" in
remove|disappear)
rm -rf /usr/share/texmf/fonts/type1/public/cm-super/
try_to_update_fontmaps
;;
purge)
# Supposing updmap.cfg & Co are clean (which I think is a reasonable
# assumption), we don't need to call try_to_update_fontmaps().
# Calling it on remove _and_ on purge just for hypothetical users
# who would break their config before purging this package seems to
# be more annoying than useful (it takes a lot of time).
;;
upgrade|failed-upgrade|abort-upgrade|abort-install)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
==================== sample postrm ======================
In fact these stuff could all be included into a dh_installtexfonts:
Preliminary ideas:
call
dh_installfonts <map files>
(or use the $(package).maps file under debian), this would result in:
. creation of a .cfg file including all the maps and the magic comment
. creation of the respective list file
. including these snippets above into the control scripts via the
#DEBHELPER# line
Wouldn't this be great?
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining AT logic DOT at> Università di Siena
sip:preining@at43.tuwien.ac.at +43 (0) 59966-690018
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
SADBERGE (n.)
A violent green shrub which is ground up, mixed with twigs and
gelatine and served with clonmult (q.v.) and buldoo (q.v.) in a
container referred to for no known reason as a 'relish tray'.
--- Douglas Adams, The Meaning of Liff
Reply to: