Sven Hoexter <[EMAIL PROTECTED]> wrote:

> Hello,
> I'm in the process of packaging dvipost ATM and I'm a little bit puzzled
> with the 'dvipost.sty' file coming along with dvipost.
> The makefile installs the dvipost.sty file into
> /usr/share/texmf-tetex/tex/latex/misc/
> and runs texhash afterwards.
>
> So I read http://people.debian.org/~frank/Debian-TeX-Policy/
> but could not find something that realy fits so I stayed with the
> installation path and put the "texhash" run into postinst and postrm.
>
> Is this the right way to deal with such stuff?

No, not completely.  I'll first tell you what's correct and why, and
then we come to the interesting part:  How to fix the package's autoconf
scripts.

Or, no, there's one more interesting part: How to fix the wording of the
Debian TeX Policy.  You know, we thought that it should be quite clear
that this is not correct, and that section 3 should "fit" quite well,
especially 3.2.  Please read it again, and tell me whether you just
didn't read it carefully enough, or how we should change it.

So now the what and why:

dvipost/sty should be put into /usr/share/texmf/tex/latex/misc/ or
/usr/share/texmf/tex/latex/dvipost/, as you like it.  The reason is that
/usr/share/texmf-tetex/ is reserved for the teTeX packages (as is
/usr/share/texmf-texlive for TeXlive), and it may not even be in the
search path if a user has both TeXLive and teTeX installed (or parts
of), but wants to use only TeXlive.


The most interesting part is how to fix it.  The path finds its way into
the upstream Makefile via this autoconf macro:

AC_MSG_CHECKING(latex environment)

if      texpath=`kpsewhich latex.ltx 2>/dev/null`
then    kpseflag=""
elif    texpath=`kpsewhich tex latex.ltx 2>/dev/null`
then    kpseflag="-DKPSEWHICH_NEED_TYPE"
else    texpath="."; kpseflag=""
fi

It is clearly wrong to search for latex.ltx; the correct thing to do
would be to use something like

kpsewhich --var-value='TEXMFMAIN'

However, things are more complicated, because the correct variable
depends on the configure prefix.  If configure is run with
--prefix=/usr, then, on a Debian system, TEXMFMAIN is the correct path
to look for (on other UNIX system, I don't know whether there's a sane
option).  If configured with --prefix=/usr/local (or without any
specification), it should look for TEXMFLOCAL, and if configured to
install into a user's home directory, TEXMFHOME.  To make things more
complicated, --var-value is quite new, in sarge one has to use 

kpsewhich --expand-braces='$TEXMFMAIN'

(which works in etch, too, but it's kind of ugly and not what it's meant
for).

I think the clean solution would be to change the autoconf script to
output the right thing; and autoconf wizards might be able to do this
(perl and emacs lisp might have similar problems).  However, for the
time being, I'd suggest to just move the file after "make install". 

Regards, Frank
-- 
Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX)

Reply via email to