rpms/jna/devel jna-3.2.5-direct.patch, NONE, 1.1 jna-3.2.5-junit.patch, NONE, 1.1 jna-3.2.5-loadlibrary.patch, NONE, 1.1 jna-3.2.7-gcj-javadoc.patch, NONE, 1.1 jna-pom.xml, NONE, 1.1 .cvsignore, 1.8, 1.9 import.log, 1.1, 1.2 jna.spec, 1.23, 1.24 sources, 1.8, 1.9 jna-3.2.4-gcj-javadoc.patch, 1.1, NONE jna-3.2.4-loadlibrary.patch, 1.1, NONE

Levente Farkas lfarkas at fedoraproject.org
Thu Jul 22 09:58:04 UTC 2010


Author: lfarkas

Update of /cvs/pkgs/rpms/jna/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23532/devel

Modified Files:
	.cvsignore import.log jna.spec sources 
Added Files:
	jna-3.2.5-direct.patch jna-3.2.5-junit.patch 
	jna-3.2.5-loadlibrary.patch jna-3.2.7-gcj-javadoc.patch 
	jna-pom.xml 
Removed Files:
	jna-3.2.4-gcj-javadoc.patch jna-3.2.4-loadlibrary.patch 
Log Message:
update to 3.2.7 plus add maven support


jna-3.2.5-direct.patch:
 dispatch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE jna-3.2.5-direct.patch ---
diff -up ./native/dispatch.c.old ./native/dispatch.c
--- ./native/dispatch.c.old	2010-05-12 09:56:55.478872622 +0200
+++ ./native/dispatch.c	2010-05-12 09:57:11.639872467 +0200
@@ -2808,7 +2808,7 @@ Java_com_sun_jna_Native_unregister(JNIEn
     free(md);
   }
   (*env)->ReleaseLongArrayElements(env, handles, data, 0);
-  (*env)->UnregisterNatives(env, cls);
+  //(*env)->UnregisterNatives(env, cls);
 }
 
 JNIEXPORT jlong JNICALL

jna-3.2.5-junit.patch:
 build.xml |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- NEW FILE jna-3.2.5-junit.patch ---
diff -up ./build.xml.junit ./build.xml
--- ./build.xml.junit	2010-05-01 12:18:55.547238394 +0200
+++ ./build.xml	2010-05-01 12:20:49.253989440 +0200
@@ -161,9 +161,6 @@
   	<path id="compile-test.path">
       <pathelement path="${test.src}"/>
       <path id="test.libs">
-        <fileset dir="lib">
-          <include name="junit.jar"/>   
-        </fileset>
         <pathelement path="${classes}"/>
       </path>
       <path id="compile.path">
@@ -419,13 +416,12 @@
     <mkdir dir="${build}/jws"/>
     <copy todir="${build}/jws" file="${build}/${jar}"/>
     <copy todir="${build}/jws" file="${build}/${testjar}"/>
-    <copy todir="${build}/jws" file="lib/junit.jar"/>
     <copy todir="${build}/jws" file="lib/clover.jar"/>
     <jar jarfile="${build}/jws/jnidispatch.jar">
       <fileset dir="${build.native}" includes="*jnidispatch.*"/>
     </jar>
     <signjar alias="jna" keystore="jna.keystore" storepass="jnadev" lazy="true"> 
-      <fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,junit.jar,jnidispatch.jar,clover.jar"/>
+      <fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,jnidispatch.jar,clover.jar"/>
     </signjar>
   </target>
 	
@@ -633,7 +629,7 @@
     <!-- Full sources required to build and test everything -->
     <zip zipfile="${dist}/src-full.zip">
       <zipfileset src="${dist}/src.zip"/>
-      <zipfileset dir="lib" includes="junit.jar,clover.jar" prefix="lib"/>
+      <zipfileset dir="lib" includes="clover.jar" prefix="lib"/>
       <zipfileset dir="." includes=".classpath,.project"/>
       <zipfileset dir="nbproject" includes="**/*" prefix="nbproject"/>
       <zipfileset dir="${native}" includes="libffi,libffi/**/*" prefix="native"/>

jna-3.2.5-loadlibrary.patch:
 Native.java |  126 +++---------------------------------------------------------
 1 file changed, 7 insertions(+), 119 deletions(-)

--- NEW FILE jna-3.2.5-loadlibrary.patch ---
diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java
--- ./src/com/sun/jna/Native.java.loadlib	2010-05-01 10:54:09.949779524 +0200
+++ ./src/com/sun/jna/Native.java	2010-05-01 10:55:08.405824567 +0200
@@ -631,131 +631,19 @@ public final class Native {
     }
 
     /**
-     * Loads the JNA stub library.  It will first attempt to load this library
-     * from the directories specified in jna.boot.library.path.  If that fails,
-     * it will fallback to loading from the system library paths. Finally it will
-     * attempt to extract the stub library from from the JNA jar file, and load it.
-     * <p>
-     * The jna.boot.library.path property is mainly to support jna.jar being
-     * included in -Xbootclasspath, where java.library.path and LD_LIBRARY_PATH
-     * are ignored.  It might also be useful in other situations.
-     * </p>
+     * Loads the JNA stub library.
+     *
+     ** MODIFIED FROM UPSTREAM - we rip out all sorts of gunk here that is
+     ** unnecessary when JNA is properly installed with the OS.
      */
     private static void loadNativeLibrary() {
-        String libName = "jnidispatch";
-        String bootPath = System.getProperty("jna.boot.library.path");
-        if (bootPath != null) {
-            String[] dirs = bootPath.split(File.pathSeparator);
-            for (int i = 0; i < dirs.length; ++i) {
-                String path = new File(new File(dirs[i]), System.mapLibraryName(libName)).getAbsolutePath();
-                try {
-                    System.load(path);
-                    nativeLibraryPath = path;
-                    return;
-                } catch (UnsatisfiedLinkError ex) {
-                }
-                if (Platform.isMac()) {
-                    String orig, ext;
-                    if (path.endsWith("dylib")) {
-                        orig = "dylib";
-                        ext = "jnilib";
-                    } else {
-                        orig = "jnilib";
-                        ext = "dylib";
-                    }
-                    try {
-                        path = path.substring(0, path.lastIndexOf(orig)) + ext;
-                        System.load(path);
-                        nativeLibraryPath = path;
-                        return;
-                    } catch (UnsatisfiedLinkError ex) {
-                    }
-                }
-            }
-        }
         try {
-            System.loadLibrary(libName);
-            nativeLibraryPath = libName;
+            System.load("@JNIPATH@/" + System.mapLibraryName("jnidispatch"));
+            nativeLibraryPath = "@JNIPATH@/" + System.mapLibraryName("jnidispatch");
         }
         catch(UnsatisfiedLinkError e) {
-            loadNativeLibraryFromJar();
-        }
-    }
-
-    /**
-     * Attempts to load the native library resource from the filesystem,
-     * extracting the JNA stub library from jna.jar if not already available.
-     */
-    private static void loadNativeLibraryFromJar() {
-        String libname = System.mapLibraryName("jnidispatch");
-        String arch = System.getProperty("os.arch");
-        String name = System.getProperty("os.name");
-        String resourceName = getNativeLibraryResourcePath(Platform.getOSType(), arch, name) + "/" + libname;
-        URL url = Native.class.getResource(resourceName);
-                
-        // Add an ugly hack for OpenJDK (soylatte) - JNI libs use the usual
-        // .dylib extension 
-        if (url == null && Platform.isMac()
-            && resourceName.endsWith(".dylib")) {
-            resourceName = resourceName.substring(0, resourceName.lastIndexOf(".dylib")) + ".jnilib";
-            url = Native.class.getResource(resourceName);
-        }
-        if (url == null) {
-            throw new UnsatisfiedLinkError("jnidispatch (" + resourceName 
-                                           + ") not found in resource path");
-        }
-    
-        File lib = null;
-        if (url.getProtocol().toLowerCase().equals("file")) {
-            try {
-                lib = new File(new URI(url.toString()));
-            }
-            catch(URISyntaxException e) {
-                lib = new File(url.getPath());
-            }
-            if (!lib.exists()) {
-                throw new Error("File URL " + url + " could not be properly decoded");
-            }
-        }
-        else {
-            InputStream is = Native.class.getResourceAsStream(resourceName);
-            if (is == null) {
-                throw new Error("Can't obtain jnidispatch InputStream");
-            }
-            
-            FileOutputStream fos = null;
-            try {
-                // Suffix is required on windows, or library fails to load
-                // Let Java pick the suffix, except on windows, to avoid
-                // problems with Web Start.
-                lib = File.createTempFile("jna", Platform.isWindows()?".dll":null);
-                lib.deleteOnExit();
-                ClassLoader cl = Native.class.getClassLoader();
-                if (Platform.deleteNativeLibraryAfterVMExit()
-                    && (cl == null
-                        || cl.equals(ClassLoader.getSystemClassLoader()))) {
-                    Runtime.getRuntime().addShutdownHook(new DeleteNativeLibrary(lib));
-                }
-                fos = new FileOutputStream(lib);
-                int count;
-                byte[] buf = new byte[1024];
-                while ((count = is.read(buf, 0, buf.length)) > 0) {
-                    fos.write(buf, 0, count);
-                }
-            }
-            catch(IOException e) {
-                throw new Error("Failed to create temporary file for jnidispatch library: " + e);
-            }
-            finally {
-                try { is.close(); } catch(IOException e) { }
-                if (fos != null) {
-                    try { fos.close(); } catch(IOException e) { }
-                }
-            }
-            unpacked = true;
+            throw new RuntimeException(e);
         }
-        System.load(lib.getAbsolutePath());
-        nativeLibraryPath = lib.getAbsolutePath();
     }
 
     /**

jna-3.2.7-gcj-javadoc.patch:
 build.xml                     |    2 --
 src/com/sun/jna/Function.java |    6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

--- NEW FILE jna-3.2.7-gcj-javadoc.patch ---
diff -up ./build.xml.gcj-javadoc ./build.xml
--- ./build.xml.gcj-javadoc	2010-07-22 11:47:35.097371333 +0200
+++ ./build.xml	2010-07-22 11:47:56.222245622 +0200
@@ -555,8 +555,6 @@
 
       <group title="Java Native Access" packages="com.sun.jna,com.sun.jna.ptr,com.sun.jna.types,com.sun.jna.win32"/>
       <group title="Platform Specific" packages="com.sun.jna.platform"/>
-    	
-      <arg value="-notimestamp"/>
     </javadoc>
     <subant target="javadoc">
       <fileset dir="${contrib}" includes="platform/build.xml"/>
diff -up ./src/com/sun/jna/Function.java.gcj-javadoc ./src/com/sun/jna/Function.java
--- ./src/com/sun/jna/Function.java.gcj-javadoc	2010-07-22 11:48:33.732370892 +0200
+++ ./src/com/sun/jna/Function.java	2010-07-22 11:49:25.324392691 +0200
@@ -76,7 +76,7 @@ public class Function extends Pointer {
      *                  Library in which to find the native function
      * @param   functionName
      *                  Name of the native function to be linked with
-     * @throws {@link UnsatisfiedLinkError} if the library is not found or
+     * @throws UnsatisfiedLinkError if the library is not found or
      * the given function name is not found within the library.
      */
     public static Function getFunction(String libraryName, String functionName) {
@@ -97,7 +97,7 @@ public class Function extends Pointer {
      * @param   callFlags
      *                  Function <a href="#callflags">call flags</a>
      *                  
-     * @throws {@link UnsatisfiedLinkError} if the library is not found or
+     * @throws UnsatisfiedLinkError if the library is not found or
      * the given function name is not found within the library.
      */
     public static Function getFunction(String libraryName, String functionName, int callFlags) {
@@ -161,7 +161,7 @@ public class Function extends Pointer {
      *                 Name of the native function to be linked with
      * @param  callFlags
      *                 Function <a href="#callflags">call flags</a>
-     * @throws {@link UnsatisfiedLinkError} if the given function name is
+     * @throws UnsatisfiedLinkError if the given function name is
      * not found within the library.
      */
     Function(NativeLibrary library, String functionName, int callFlags) {


--- NEW FILE jna-pom.xml ---
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.java.dev.jna</groupId>
  <artifactId>jna</artifactId>
  <packaging>jar</packaging>
  <version>VERSION</version>
  <name>Java Native Access</name>
    
   <distributionManagement>
    <repository>
      <uniqueVersion>false</uniqueVersion>
      <id>java.net-maven2-repository</id>
      <url>java-net:/maven2-repository/trunk/repository/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <!-- fake out maven and install the binary artifact -->
      <plugin>
        <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
        <artifactId>maven-antrun-extended-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <!--<ant dir="." target="dist" />-->
                <attachArtifact file="dist/jna.jar" />
                <attachArtifact file="dist/src-mvn.zip" classifier="sources" type="jar"/>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <extensions>
      <extension>
        <groupId>org.jvnet.wagon-svn</groupId>
        <artifactId>wagon-svn</artifactId>
        <version>1.8</version>
      </extension>
    </extensions>
  </build>

</project>


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/.cvsignore,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- .cvsignore	23 Nov 2009 18:32:41 -0000	1.8
+++ .cvsignore	22 Jul 2010 09:58:03 -0000	1.9
@@ -1 +1 @@
-jna-3.2.4.tar.bz2
+jna-3.2.7.tar.bz2


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- import.log	23 Nov 2009 18:32:41 -0000	1.1
+++ import.log	22 Jul 2010 09:58:03 -0000	1.2
@@ -1 +1,2 @@
 jna-3_2_4-1_el5:HEAD:jna-3.2.4-1.el5.src.rpm:1259001126
+jna-3_2_7-1_fc12:HEAD:jna-3.2.7-1.fc12.src.rpm:1279792606


Index: jna.spec
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/jna.spec,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- jna.spec	22 Apr 2010 19:50:09 -0000	1.23
+++ jna.spec	22 Jul 2010 09:58:03 -0000	1.24
@@ -1,6 +1,6 @@
 Name:           jna
-Version:        3.2.4
-Release:        5%{?dist}
+Version:        3.2.7
+Release:        1%{?dist}
 Summary:        Pure Java access to native libraries
 
 Group:          Development/Libraries
@@ -9,29 +9,35 @@ URL:            https://jna.dev.java.net
 # The source for this package was pulled from upstream's vcs. Use the
 # following commands to generate the tarball:
 #   svn export https://jna.dev.java.net/svn/jna/tags/%{version}/jnalib/ --username guest jna-%{version}
-#   rm jna-%{version}/dist/*
-#   tar -cjf jna-%{version}.tar.bz2 jna-%{version}
+#   rm -rf jna-%{version}/dist/*
+#   tar cjf ~/rpm/SOURCES/jna-%{version}.tar.bz2 jna-%{version}
 Source0:        %{name}-%{version}.tar.bz2
+Source1:	%{name}-pom.xml
 # This patch is Fedora-specific for now until we get the huge
 # JNI library location mess sorted upstream
-Patch1:         jna-3.2.4-loadlibrary.patch
+Patch1:         jna-3.2.5-loadlibrary.patch
 # The X11 tests currently segfault; overall I think the X11 JNA stuff is just a 
 # Really Bad Idea, for relying on AWT internals, using the X11 API at all,
 # and using a complex API like X11 through JNA just increases the potential
 # for problems.
 Patch2:         jna-3.2.4-tests-headless.patch
-# Upstream appears to have some sort of MD5 check on the contents of their
 # native jar.  Carve that out so we always build it.
 Patch3:         jna-3.2.4-build-md5.patch
 # Build using GCJ javadoc
-Patch4:		jna-3.2.4-gcj-javadoc.patch
+Patch4:		jna-3.2.7-gcj-javadoc.patch
+# junit cames from rpm
+Patch5:		jna-3.2.5-junit.patch
+# see: https://jna.dev.java.net/issues/show_bug.cgi?id=154
+Patch6:		jna-3.2.5-direct.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:  java-devel ant jpackage-utils ant-nodeps
-BuildRequires:  libX11-devel libXt-devel libffi-devel
 # We manually require libffi because find-requires doesn't work
 # inside jars.
-Requires:       java jpackage-utils libffi
+Requires:       java >= 1:1.6.0 jpackage-utils libffi
+Requires(post):	jpackage-utils
+Requires(postun): jpackage-utils
+BuildRequires:  java-devel >= 1:1.6.0 ant jpackage-utils ant-nodeps
+BuildRequires:  libX11-devel libXt-devel libffi-devel
 # for ExcludeArch see bug: 468831
 %if 0%{?rhel} < 6 && 0%{?fedora} < 10
 ExcludeArch: ppc ppc64
@@ -57,26 +63,30 @@ Requires:       %{name} = %{version}-%{r
 This package contains the javadocs for %{name}.
 
 
-%package        examples
-Summary:        Examples for %{name}
+%package        contrib
+Summary:        Contrib for %{name}
 Group:          Documentation
 Requires:       %{name} = %{version}-%{release}
 
 
-%description    examples
-This package contains the examples for %{name}.
+%description    contrib
+This package contains the contributed examples for %{name}.
 
 
 %prep
 %setup -q -n %{name}-%{version}
 sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
 %patch2 -p1 -b .tests-headless
-%patch3 -p0 -R -b .md5
+#patch3 -p0 -R -b .md5
 %patch4 -p0 -b .gcj-javadoc
+%patch5 -p1 -b .junit
+#patch6 -p1 -b .direct
+cp %{SOURCE1} ./
 
 # all java binaries must be removed from the sources
-find . -name '*.jar' -exec rm -f '{}' \;
-find . -name '*.class' -exec rm -f '{}' \;
+#find . -name '*.jar' -delete
+rm lib/junit.jar
+find . -name '*.class' -delete
 
 # remove internal copy of libffi
 rm -rf native/libffi
@@ -89,16 +99,16 @@ chmod 0644 LICENSE.txt
 %build
 # We pass -Ddynlink.native which comes from our patch because
 # upstream doesn't want to default to dynamic linking.
-ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar examples
-ant javadoc
-
+ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar javadoc
+# remove compiled contribs
+find contrib -name build -delete || :
+sed -i "s/VERSION/%{version}/" %{name}-pom.xml
 
 %install
 rm -rf %{buildroot}
 
 # jars
 install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-%{version}.jar
 (cd %{buildroot}%{_javadir}/; for jar in `ls *-%{version}.jar`; do ln -s $jar `echo $jar | sed -e 's/-%{version}//'`; done)
 # NOTE: JNA has highly custom code to look for native jars in this
 # directory.  Since this roughly matches the jpackage guidelines,
@@ -106,21 +116,43 @@ install -D -m 644 build*/examples.jar %{
 install -d -m 755 %{buildroot}%{_libdir}/%{name}
 install -m 755 build*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
 
+# install maven pom file
+install -Dm 644 %{name}-pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}.pom
+
+# ... and maven depmap
+%add_to_maven_depmap net.java.dev.jna %{name} %{version} JPP %{name}
+
 # javadocs
 install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
 cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
 
 
+%if 0%{?fedora} >= 9
+%check
+#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true test
+%endif
+
+
 %clean
 rm -rf %{buildroot}
 
 
+%post
+%update_maven_depmap
+
+
+%postun
+%update_maven_depmap
+
+
 %files
 %defattr(-,root,root,-)
 %doc LICENSE.txt
 %{_libdir}/%{name}
 %{_javadir}/%{name}.jar
 %{_javadir}/%{name}-%{version}.jar
+%{_mavenpomdir}/*.pom
+%{_mavendepmapfragdir}/%{name}
 
 
 %files javadoc
@@ -128,13 +160,18 @@ rm -rf %{buildroot}
 %{_javadocdir}/%{name}-%{version}
 
 
-%files examples
+%files contrib
 %defattr(-,root,root,-)
-%{_javadir}/%{name}-examples.jar
-%{_javadir}/%{name}-examples-%{version}.jar
+%doc contrib
 
 
 %changelog
+* Thu Jul 22 2010 Levente Farkas <lfarkas at lfarkas.org> - 3.2.7-1
+- Rebase on upstream 3.2.7
+
+* Wed Jul 21 2010 Stanislav Ochotnicky <sochotnicky at redhat.com> - 3.2.4-6
+- Add maven depmap
+
 * Thu Apr 22 2010 Colin Walters <walters at verbum.org> - 3.2.4-5
 - Add patches to make the build happen with gcj
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/sources,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- sources	23 Nov 2009 18:32:42 -0000	1.8
+++ sources	22 Jul 2010 09:58:03 -0000	1.9
@@ -1 +1 @@
-3e53de2ba6c9e3920ec681224114209e  jna-3.2.4.tar.bz2
+59c5d5ac6b49f86b7ae701265f04a48c  jna-3.2.7.tar.bz2


--- jna-3.2.4-gcj-javadoc.patch DELETED ---


--- jna-3.2.4-loadlibrary.patch DELETED ---



More information about the scm-commits mailing list