Bug 131141 - dev-java/xerces USE="-examples" should not install xercesSamples.jar
Bug#: 131141 Product:  Gentoo Linux Version: 2006.0 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: java@gentoo.org Reported By: h.mth@web.de
Component: Ebuilds
URL: 
Summary: dev-java/xerces USE="-examples" should not install xercesSamples.jar
Keywords:  
Status Whiteboard: 
Opened: 2006-04-24 13:17 0000
Description:   Opened: 2006-04-24 13:17 0000
Something like
  'use examples || rm ${S}/build/xercesSamples.jar'
in src_install before java-pkg_dojar.

------- Comment #1 From Andrew Yates 2006-08-02 22:34:30 0000 -------
I'm attaching a patch so that xercesSamples.jar is not installed into
/usr/share/xerces-2/lib when the examples use flag is not set. The patch is
against the xerces 2.7.1-r1 ebuild in portage. I've tested it, and the change
also works with the java experimental 2.8.0 ebuild.

------- Comment #2 From Andrew Yates 2006-08-02 22:35:15 0000 -------
Created an attachment (id=93313) [details]
only install xercesSamples.jar if examples flag is set

------- Comment #3 From Andrew Yates 2006-08-02 22:47:50 0000 -------
Created an attachment (id=93314) [details]
examples patch

I realized there was a better way to do this as soon as I submitted the last
patch.
This removes the samples jar file earlier in the build process. There's no
reason to wait until the samples jar is in image before removing it.

------- Comment #4 From Vlastimil Babka (Caster) 2006-08-03 02:17:30 0000 -------
Thanks for your attempt. However, compiled examples should never go to
/usr/share/package/lib through java-pkg_dojar, no matter the useflag. Examples
source should go to /usr/share/doc/${PF}/examples as the ebuild does, and
compiled examples are probably of no use so the jar can just be removed in any
case. Ideally it wouldn't even have to be built, that would probably require
some manual build.xml patching or finding a better target(s) to pass to eant.

------- Comment #5 From Andrew Yates 2006-08-03 08:27:15 0000 -------
You're right.
     [echo]  jar      --> generates the xercesImpl.jar file
     [echo]  jars --> generates xercesImpl & xercesSamples jars
It looks like we can change the build target to 'jar' and we won't have to deal
with the samples jar. As you mentioned, a binary examples jar isn't that useful
anyway. 
The jars target builds three files: xercesImpl.jar, xercesSamples.jar and
xml-apis.jar. The jar target only builds xercesImpl.jar.
xml-commons-external already provides xml-apis.jar, but according to Bug #82561
removing the jar from xerces will break some ebuilds. Those will have to be
fixed before the target can be changed.

------- Comment #6 From Vlastimil Babka (Caster) 2006-08-03 08:45:31 0000 -------
(In reply to comment #5)
> You're right.
>      [echo]  jar      --> generates the xercesImpl.jar file
>      [echo]  jars --> generates xercesImpl & xercesSamples jars
> It looks like we can change the build target to 'jar' and we won't have to deal
> with the samples jar. As you mentioned, a binary examples jar isn't that useful
> anyway. 

Yeah.

> The jars target builds three files: xercesImpl.jar, xercesSamples.jar and
> xml-apis.jar. The jar target only builds xercesImpl.jar.
> xml-commons-external already provides xml-apis.jar, but according to Bug #82561
> removing the jar from xerces will break some ebuilds. Those will have to be
> fixed before the target can be changed.

Well the jars target just copies the xml-apis.jar from one dir to another. It's
taken from xml-commons-external, not built here. So the ebuild could just copy
it itself (until bug 82561 is solved and this copying is no more needed) and
then jar target would be enough, without building the samples.

------- Comment #7 From Andrew Yates 2006-08-03 10:37:11 0000 -------
Created an attachment (id=93356) [details]
use jar target

This uses the jar target so that the samples are not built, and installs a
symlink so that xerces-2/lib/xml-apis.jar points to the xml-commons-external
jar that was used in building xerces.

------- Comment #8 From Vlastimil Babka (Caster) 2006-08-08 18:34:47 0000 -------
Fixed in 2.8.0-r1 in migrated-java-experimental-overlay.

------- Comment #9 From Vlastimil Babka (Caster) 2006-09-18 14:25:02 0000 -------
Fixed in xerces-2.7.1-r2 in the tree. Thanks everyone.