[xml/sgml-pkgs] Bug#721366: xmlto: craps out if DESTDIR is specified

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Aug 30 18:43:56 UTC 2013


Package: xmlto
Version: 0.0.25-2
Severity: normal

My use case is I am building and installing a particular package
(PLplot) using

make DESTDIR=<whatever> install

where the install target depends on the all target which builds part
of the package documentation using xmlto --with-fop.  The underlying
fop command could not find anything for this case.

To show this for yourself by hand, try

env DESTDIR=whatever xmlto --with-fop pdf <somedocbook>.xml
Making portrait pages on letter paper (215.9mmx279.4mm)
[warning] /usr/bin/fop: Unable to locate commons-io in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate avalon-framework in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate serializer in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate xalan2 in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate xml-apis in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate batik-all in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate commons-logging in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate servlet-api in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate xercesImpl in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate xmlgraphics-commons in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate xml-apis-ext in whatever/usr/share/java
[warning] /usr/bin/fop: Unable to locate fop in whatever/usr/share/java
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/fop/cli/Main
Caused by: java.lang.ClassNotFoundException: org.apache.fop.cli.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	Could not find the main class: org.apache.fop.cli.Main.
Program will exit.
/tmp/xmlto.UTTOD3

The solution for this issue that I am going to use in the PLplot case
is to always invoke xmlto from the build system with

env DESTDIR="" xmlto

But that feels like a workaround to me since I don't believe
xmlto should be sensitive to the DESTDIR value.  So I looked further.

xmlto --with-fop invokes

/usr/share/xmlto/format/docbook/pdf

which invokes

/usr/share/xmlto/format/fo/pdf

which invokes

/usr/bin/fop

which includes

/usr/lib/java-wrappers/java-wrappers.sh

which sets

JAVA_JARPATH=$DESTDIR/usr/share/java

which I believe is likely the cause of all the above "Unable to locate"
warnings when DESTDIR is set.

I have no clue whether this is a bug in java-wrappers (which contains
the file
/usr/lib/java-wrappers/java-wrappers.sh) or a bug in fop (due to
misusing /usr/lib/java-wrappers/java-wrappers.sh by not setting
DESTDIR="" before including that file or else a bug in xmlto for not
setting DESTDIR="" before invoking fop.  So I leave the decision about
where this bug report should actually end up to you.

-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xmlto depends on:
ii  debianutils    4.3.2
ii  docbook-xml    4.5-7.2
ii  docbook-xsl    1.76.1+dfsg-1
ii  libc6          2.13-38
ii  libxml2-utils  2.8.0+dfsg1-7+nmu1
ii  sgml-base      1.26+nmu4
ii  xsltproc       1.1.26-14.1

Versions of packages xmlto recommends:
ii  dblatex         0.3.4-2
ii  fop             1:1.0.dfsg2-6
ii  libpaper-utils  1.1.24+nmu2
ii  zip             3.0-6

Versions of packages xmlto suggests:
pn  w3m | lynx-cur | links  <none>
ii  xmltex                  1.9.debian.1-3

-- no debconf information



More information about the debian-xml-sgml-pkgs mailing list