Bug 160955 - dev-java/jmock-1.1.0.ebuild packages jmock-cglib-SNAPSHOT.jar, not jmock-SNAPSHOT.jar, into jmock.jar
Bug#: 160955 Product:  Gentoo Linux Version: 2006.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: java@gentoo.org Reported By: daisy@xs4all.nl
Component: Ebuilds
URL: 
Summary: dev-java/jmock-1.1.0.ebuild packages jmock-cglib-SNAPSHOT.jar, not jmock-SNAPSHOT.jar, into jmock.jar
Keywords:  
Status Whiteboard: 
Opened: 2007-01-08 17:42 0000
Description:   Opened: 2007-01-08 17:42 0000
The jmock-1.1.0.ebuild file contains an error. The java-pkg_newjar eclass
function is called twice, once to rename jmock-SNAPSHOT.jar into jmock.jar, and
once to rename jmock-cglib-SNAPSHOT.jar into jmock.jar.

This means that you end up with a bad jar. When you try to use the jmock.jar in
Java projects, you get lots of ClassNotFoundExceptions.

What should have been done is for the jmock-SNAPSHOT.jar to be repackaged into
jmock.jar, and jmock-cglib-SNAPSHOT.jar to be repackaged into jmock-cglib.jar. 

Below is a patch of the ebuild to fix this:

------------
--- jmock-1.1.0.ebuild.orig     2007-01-08 18:29:06.000000000 +0100
+++ jmock-1.1.0.ebuild  2007-01-08 18:09:33.000000000 +0100
@@ -46,7 +46,7 @@

 src_install() {
        java-pkg_newjar build/dist/jars/jmock-SNAPSHOT.jar jmock.jar
-       java-pkg_newjar build/dist/jars/jmock-cglib-SNAPSHOT.jar jmock.jar
+       java-pkg_newjar build/dist/jars/jmock-cglib-SNAPSHOT.jar
jmock-cglib.jar
        dodoc CHANGELOG
        dohtml overview.html

------------

Reproducible: Always

Steps to Reproduce:
1. Emerge jmock-1.1.0
2. Check the jmock.jar file in /usr/share/jmock-1.0/lib/
3. Unpack the jmock-1.1.0 distfile, and build the sources using the supplied
ant file.
4. Compare the jmock.jar in /usr/share/jmock-1.0/lib/ with the jar file you've
just built. They are very different in size.

Actual Results:  
I ended up with a single jmock.jar of size 3264 bytes.

Expected Results:  
I expected to find a much larger jmock.jar and a jmock-cglib.jar

------- Comment #1 From David Emmett 2007-01-08 17:45:47 0000 -------
Created an attachment (id=106069) [details]
Patch for ebuild, renaming the second java-pkg_newjar file

------- Comment #2 From Josh Nichols (RETIRED) 2007-01-09 05:00:06 0000 -------
Fixed with 1.1.0-r1, thanks for reporting!