Bug 386661

Summary: Review Request: writer2latex - OpenOffice.org to LaTeX/XHTML filter
Product: [Fedora] Fedora Reporter: Caolan McNamara <caolanm>
Component: Package ReviewAssignee: Jason Tibbitts <j>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aph, fedora-package-review, jan.kratochvil, j, notting
Target Milestone: ---Flags: j: fedora-review+
kevin: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-01 20:25:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for /usr/lib/python2.5/site-packages/aotcompile.py none

Description Caolan McNamara 2007-11-16 11:53:50 UTC
Spec URL: http://people.redhat.com/caolanm/writer2latex/writer2latex.spec
SRPM URL: http://people.redhat.com/caolanm/writer2latex/writer2latex-0.5-1.fc9.src.rpm
Description: OpenOffice.org currently includes a copy of this filter for converting OOo docs to LaTeX and XHTML, this packages it separately from OOo from the more up-to-date canonical upstream source.

Comment 1 Jason Tibbitts 2007-11-16 16:45:55 UTC
This failed to build for me( x86_64 rawhide).  javac spews no less then 395
complaints and kills the build:

    [javac] 395 problems (252 errors, 143 warnings)

I can paste a log if you'd like, but I suspect that something else is wrong
because it looks like you built this on rawhide.  This error seems telling, though:

    [javac] 16. ERROR in
/builddir/build/BUILD/writer2latex05/source/writer2latex/filter/ByteArrayXStream.java
    [javac]  (at line 36)
    [javac]     import com.sun.star.io.XInputStream;
    [javac]            ^^^^^^^^^^^^
    [javac] The import com.sun.star cannot be resolved

Many errors cascade from that one.

Comment 2 Caolan McNamara 2007-11-16 17:05:45 UTC
Yes I built on rawhide, I intend to add this to rawhide alone for F-9, as I know
it won't be installable on < F-9 as unopkg doesn't exist in F-8 in the form that
this needs. That said, I know why this initial error happened at build time, so
I've updated the .spec and .src.rpm to avoid that problem.

Comment 3 Jason Tibbitts 2007-11-16 17:52:45 UTC
Since you didn't bump your release, I can't tell if I have the updated file or
not but it seemed to build this time.

When I installed the resulting packages, things didn't go very well:

/var/tmp/rpm-tmp.26529: line 1: unopkg: command not found
error: %post(openoffice.org-writer2latex-0.5-1.fc9.x86_64) scriptlet failed,
exit status 127
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
/usr/bin/rebuild-gcj-db: line 5: 10242 Aborted                
/usr/bin/gcj-dbtool -n $dbLocation 64
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
xargs: /usr/bin/gcj-dbtool: terminated by signal 6
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat

So, what's supposed to provide unopkg?  Is it in the path by default?

In addition, there's one rpmlint complaint which I don't fully understand at
this time:

writer2latex.x86_64: W: class-path-in-manifest /usr/share/java/writer2latex-0.5.jar

Concensus on IRC is that this isn't a problem, but I don't know quite enough
about java to explain why.

Comment 4 Caolan McNamara 2007-11-16 18:07:07 UTC
unopkg is provided by openoffice.org-core in rawhide, you *might* get sort of
the desired effect in an older version with something like 

PATH=$PATH:/usr/lib64/openoffice.org/program

but that'd be an unsupported hack.

The class-path-in... etc warning is from Class-Path: in the manifest, 

> unzip /usr/share/java/writer2latex.jar META-INF/MANIFEST.MF
> grep Class-Path META-INF/MANIFEST.MF
Class-Path: jaxp.jar jaxp_parser_impl.jar

this sets java to look into those jars to find classes that are not found in the
current .jar or in the CLASSPATH variable etc. Fairly equivalent to what other
libraries a c library is linked against, the Requires: for the package specify
the packages that provide those .jars so that should be alright.

Comment 5 Jason Tibbitts 2007-11-16 18:28:14 UTC
I'm up to date with current rawhide and the only unopkg I see is:

~> rpm -ql openoffice.org-core|grep unopkg
/usr/lib/openoffice.org/program/unopkg
/usr/lib/openoffice.org/program/unopkg.bin
/usr/lib/openoffice.org/share/config/javasettingsunopkginstall.xml

~> rpm -q openoffice.org-core
openoffice.org-core-2.3.0-6.7.fc9.i386

Comment 6 Caolan McNamara 2007-11-16 19:37:19 UTC
The packages are lagging behind a lot at the moment: I built and pushed
http://koji.fedoraproject.org/packages/openoffice.org/2.3.1/9.2.fc9/
on thursday, but it hasn't gone into rawhide yet, they'll have unopkg in /usr/bin

Comment 7 Jason Tibbitts 2007-11-18 21:47:53 UTC
There was a rawhide push today, so I have 1:2.3.1-9.2.fc9.  Unfortunately the
package still doesn't install cleanly:

javaldx: Could not find a Java Runtime Environment!
javaldx: Could not find a Java Runtime Environment!

unopkg failed.
error: %post(openoffice.org-writer2latex-0.5-1.fc9.x86_64) scriptlet failed,
exit status 1
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
/usr/bin/rebuild-gcj-db: line 5: 10590 Aborted                
/usr/bin/gcj-dbtool -n $dbLocation 64
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat
xargs: /usr/bin/gcj-dbtool: terminated by signal 6
GC Warning: Couldn't read /proc/stat
GC Warning: GC_get_nprocs() returned -1
Couldn't read /proc/self/stat


Comment 8 Caolan McNamara 2007-11-19 08:53:07 UTC
I have no such problems on x86_64 or i386 and these really don't sound like
direct problems with the package. Nevertheless, what is your java, i.e. java
-version, and what is ls -asl /proc/stat

Comment 9 Jason Tibbitts 2007-11-19 15:37:13 UTC
This is all installed into the mock buildroot, so the only packages present are
those that are either build dependencies or runtime dependencies of the package,
or things that are in the minimal buildroot.  If something's missing that is
needed for this package to install correctly, then that's either a bug in this
package (missing dependency) or a bug in one of the packages it depends on.

The java is java-1.5.0-gcj-devel-1.5.0.0-17.fc8.x86_64, installed as a build
dependency of this package.

The /proc/stat stuff is the result of /proc not being mounted at all while these
pacakges are being installed.  Certainly rebuild-gcj-db should try not to blow
up in this situation, but that's not the real problem, and it goes away when I
make sure that /proc is mounted in the chroot before installing this package.

Next problem: the debuginfo package is broken, in the usual way for Java
packages.  Trying to fix that up now.

Comment 10 Caolan McNamara 2007-11-19 16:14:24 UTC
k, so for clarity; After /proc is mounted what are the outstanding problems
blocking the package ?

Comment 11 Jason Tibbitts 2007-11-19 16:22:33 UTC
Well, there's this:

javaldx: Could not find a Java Runtime Environment!
javaldx: Could not find a Java Runtime Environment!

unopkg failed.
error: %post(openoffice.org-writer2latex-0.5-1.fc9.x86_64) scriptlet failed,

And the debuginfo issue, which I'm still looking at.

Comment 12 Caolan McNamara 2007-11-19 17:24:28 UTC
oky doky, in that case I reckon that the "unable to find java" problem is solved
by these updated .spec and .src.rpm

http://people.redhat.com/caolanm/writer2latex/writer2latex.spec
http://people.redhat.com/caolanm/writer2latex/writer2latex-0.5-2.fc9.src.rpm

Comment 13 Jason Tibbitts 2007-11-21 20:39:48 UTC
OK, that does install cleanly.

One minor issue is that nothing seems to own /usr/share/writer2latex
({_datadir}/%{name}).  Probably the openoffice.org-writer2latex package should
own it.

However, the major issue is the debuginfo package, and this is where I'm really
not the best person to be reviewing this package.  The issue is that the
debuginfo doesn't include any of the source files due to what seems to me to be
some disconnect between the filenames appearing in the debugging symbols and the
actual location of the source files.  The result is that I get this:

extracting debug info from
/var/tmp/writer2latex-0.5-buildroot/usr/lib64/gcj/writer2latex/writer2latex-0.5.jar.so

cpio:
writer2latex05/aot-compile-rpm/usr/lib64/gcj/writer2latex/writer2latex-0.5.jar.1.jar:
Cannot stat: No such file or directory

cpio:
writer2latex05/aot-compile-rpm/usr/lib64/gcj/writer2latex/writer2latex/Application.java:
Cannot stat: No such file or directory

with the last line repeated for each source file in the tarball.

Now, in the past I've reviewed some java packages and this was easily solved by
making a symlink, but this method has actually stopped working.

So in the end I just don't know what to do.  If it's fixable in this package
then obviously that's what should be done, but otherwise the only options are to
disable the debuginfo package or leave things as they are.

So, who knows enough java to say whether this issue is fixable, or whether the
debuginfo package is useful as-is?

Comment 14 Caolan McNamara 2007-11-21 22:51:07 UTC
Is there a sample java package without debuginfo disabled which was known to
work ? If so then perhaps the thing is just to see what the status of that
package is, and if it matches this package's status then its generic and not a
blocker, and if it still works and this one doesn't we can sort it out.

Comment 15 Jason Tibbitts 2007-11-21 23:49:01 UTC
Unfortunately it seems that even the java packages which used to have working
debuginfo now don't.  So I'm at a complete loss here.  I posted to
fedora-devel-list about it, so hopefully someone who understands this will speak up.

However, honestly I don't think there's anything wrong with this package that
isn't already wrong with every other Java-using package, so I'm thinking that it
would be pointlessly obstructive to block this just because there's no solution
to what is a distro-wide issue that this package happens to exhibit.  So let me
do a full review....

Comment 16 Andrew Haley 2007-11-26 17:52:14 UTC
Created attachment 269131 [details]
Patch for /usr/lib/python2.5/site-packages/aotcompile.py

Comment 17 Caolan McNamara 2007-11-27 11:18:56 UTC
Updated this slightly in the light of the improvements made in
openoffice.org-2.3.1-9.3 to allow the installation of unpacked components
without copying

http://people.redhat.com/caolanm/writer2latex/writer2latex.spec
http://people.redhat.com/caolanm/writer2latex/writer2latex-0.5-3.fc9.src.rpm

Comment 18 Jason Tibbitts 2007-11-30 07:27:05 UTC
Sorry for being slow to act here; I've been really ill this week and just
haven't been up to sitting at a computer.

Summary
=======
Remove javadoc scriptlets.
Possibly protect the remaining scriptlets against failure.
Fix BuildRoot:.

Comments
========
I'll ignore the debuginfo bits for now.  There's nothing this package can do to
fix the issue and disabling debuginfo generation would be wrong, so everything's
fine as is.  Java-using packages may all need a rebuild once the issue gets
fixed, bbut that has no bearing on this review.

I made some inquiries on fedora-devel about the javadoc scriptlets; the result
seems to be that we really don't want them.  You can make the symlink if you
like and simply include it in the package.  Or not.  But there's no point in
messing with the link at install/remove time.

I'll admit to not understanding the point of the gcj_support stuff in Fedora
given that you can't pass flags to the buildsys, but it's common to java
packages for whatever reason so I guess it's acceptable, but the spec would be a
good bit simpler without it.  I'll have to see if I can't get some feedback on
that as well.

The BuildRoot: is not correct.  Minimally, %{release} needs to be in there.  See
http://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot

You include COPYING.TXT twice; I guess technically that violates the "no
duplicates in %files" rule but while it's not really necessary I don't see it as
a problem.

I don't know enough about unopkg to know if it can ever fail.  If it can, you'll
need to protect the three openiffice.org-* scriptlets against failure.

I guess the same goes for the rebuild-gcj-db calls.

rpmlint output
==============
  openoffice.org-writer2latex.x86_64: W: class-path-in-manifest 
   /usr/share/writer2latex.uno.pkg/writer2latex.jar
  writer2latex.x86_64: W: class-path-in-manifest 
   /usr/share/java/writer2latex-0.5.jar
OK as discussed earlier.

  writer2latex.x86_64: W: non-standard-group Text Processing/Markup/XML
  writer2latex-javadoc.x86_64: W: non-standard-group Development/Documentation
We don't really care what goes in Group:.

  writer2latex-javadoc.x86_64: W: dangerous-command-in-%post rm
  writer2latex-javadoc.x86_64: W: dangerous-command-in-%preun rm
These will go away when the javadoc scriptlets are removed.

Checklist
=========
* source files match upstream:
   c1d9576bcc51105798b40c7d9273e9dbc59efb5c87fd238d97cbab9fe7eaf309  
   writer2latex05.zip
* package meets naming and versioning guidelines.
* specfile is properly named, is cleanly written and uses macros consistently.
* summary is OK.
* description is OK.
* dist tag is present.
X build root is not correct.
* license field matches the actual license.
* license is open source-compatible.
* license text included in package.
* latest version is being packaged.
* BuildRequires are proper.
* compiler flags are appropriate (as far as I can tell for java)
* %clean is present.
* package builds in mock (rawhide, x86_64).
* package installs properly
X rpmlint has complaints which will go away with the javadoc scriptlets.
* final provides and requires are sane:
  openoffice.org-writer2latex-0.5-3.fc9.x86_64.rpm
   openoffice.org-writer2latex = 0.5-3.fc9
  =
   /bin/sh
   openoffice.org-core

  writer2latex-0.5-3.fc9.x86_64.rpm
   writer2latex-0.5.jar.so()(64bit)
   writer2latex = 0.5-3.fc9
  =
   /bin/sh
   libgcc_s.so.1()(64bit)
   libgcc_s.so.1(GCC_3.0)(64bit)
   libgcj_bc.so.1()(64bit)
   libz.so.1()(64bit)
   xalan-j2
   xerces-j2

  writer2latex-javadoc-0.5-3.fc9.x86_64.rpm
   writer2latex-javadoc = 0.5-3.fc9
  =
?  /bin/ln
?  /bin/rm
?  /bin/sh
  (These three will go away with the javadoc scriptlets.)

* %check is not present; no test suite upstream.
* no shared libraries are added to the regular linker search paths.
* owns the directories it creates.
* doesn't own any directories it shouldn't.
* no duplicates in %files (besides COPYING.TXT, which is OK)
* file permissions are appropriate.
X javadoc scriptlets need to go; other scriptlets may need protection against 
   failure.
* code, not content.
* documentation is small, so no -docs subpackage is necessary.
* %docs are not necessary for the proper functioning of the package.

Comment 20 Jason Tibbitts 2007-12-01 03:49:50 UTC
BuildRoot: is fixed.
openoffice.org-* package scriptlets protected from failure.
javadoc scriptlets banished.

rpmlint is down t:
openoffice.org-writer2latex.x86_64: W: no-documentation
openoffice.org-writer2latex.x86_64: W: class-path-in-manifest 
  /usr/share/writer2latex.uno.pkg/writer2latex.jar
writer2latex.x86_64: W: class-path-in-manifest 
  /usr/share/java/writer2latex-0.5.jar
writer2latex.x86_64: W: non-standard-group Text Processing/Markup/XML
writer2latex-javadoc.x86_64: W: non-standard-group Development/Documentation
all of which are OK.

So everything looks good to me; APPROVED

Comment 21 Caolan McNamara 2007-12-01 10:06:16 UTC
New Package CVS Request
=======================
Package Name: writer2latex
Short Description: OpenOffice.org to LaTeX/XHTML filter
Owners: caolanm
Branches: devel
InitialCC:
Cvsextras Commits: yes

Comment 22 Kevin Fenzi 2007-12-01 17:54:28 UTC
cvs done.

Comment 23 Caolan McNamara 2007-12-01 20:25:19 UTC
Thanks guys for reviews, generic gcj debuginfo fixing and cvs work