rpms/jna/devel .cvsignore, 1.6, 1.7 jna-3.0.2-loadlibrary.patch, 1.1, 1.2 jna.spec, 1.12, 1.13 sources, 1.6, 1.7

Colin Walters walters at fedoraproject.org
Sat Nov 1 01:05:52 UTC 2008


Author: walters

Update of /cvs/pkgs/rpms/jna/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25793

Modified Files:
	.cvsignore jna-3.0.2-loadlibrary.patch jna.spec sources 
Log Message:
* Fri Oct 31 2008 Colin Walters <walters at redhat.com> - 3.0.9-1
- Rebase on upstream 3.0.9



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	1 Oct 2008 18:52:04 -0000	1.6
+++ .cvsignore	1 Nov 2008 01:05:21 -0000	1.7
@@ -1 +1 @@
-jna-3.0.4.svn729.tar.bz2
+jna-3.0.9.tar.bz2

jna-3.0.2-loadlibrary.patch:

Index: jna-3.0.2-loadlibrary.patch
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/jna-3.0.2-loadlibrary.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jna-3.0.2-loadlibrary.patch	4 Apr 2008 23:46:58 -0000	1.1
+++ jna-3.0.2-loadlibrary.patch	1 Nov 2008 01:05:21 -0000	1.2
@@ -1,11 +1,121 @@
---- jna-3.0.2.default/src/com/sun/jna/Native.java	2008-02-11 16:04:47.000000000 -0500
-+++ jna-3.0.2/src/com/sun/jna/Native.java	2008-04-03 23:30:03.000000000 -0400
-@@ -85,7 +85,7 @@
-     public static final int WCHAR_SIZE;
-     static {
+diff -ur jna-3.0.9/src/com/sun/jna/Native.java jna-3.0.9.orig/src/com/sun/jna/Native.java
+--- jna-3.0.9/src/com/sun/jna/Native.java	2008-10-31 20:35:02.000000000 -0400
++++ jna-3.0.9.orig/src/com/sun/jna/Native.java	2008-10-31 20:42:23.000000000 -0400
+@@ -504,109 +504,17 @@
+     }
+ 
+     /**
+-     * 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);
+-                    return;
+-                } catch (UnsatisfiedLinkError ex) {
+-                }
+-                if (Platform.isMac()) {
+-                    String orig, ext;
+-                    if (path.endsWith("dylib")) {
+-                        orig = "dylib";
+-                        ext = "jnilib";
+-                    } else {
+-                        orig = "jnilib";
+-                        ext = "dylib";
+-                    }
+-                    try {
+-                        System.load(path.substring(0, path.lastIndexOf(orig)) + ext);
+-                        return;
+-                    } catch (UnsatisfiedLinkError ex) {
+-                    }
+-                }
+-            }
+-        }
          try {
--            System.loadLibrary("jnidispatch");
-+	    System.load("@JNIPATH@/" + System.mapLibraryName("jnidispatch"));
+-            System.loadLibrary(libName);
+-        }
+-        catch(UnsatisfiedLinkError e) {
+-            loadNativeLibraryFromJar();
+-        }
+-    }
+-
+-    /**
+-     * Extracts and loads the JNA stub library from jna.jar
+-     */
+-    private static void loadNativeLibraryFromJar() {
+-        String libname = System.mapLibraryName("jnidispatch");
+-        String resourceName = getNativeLibraryResourcePath() + "/" + 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")) {
+-            // NOTE: use older API for 1.3 compatibility
+-            lib = new File(URLDecoder.decode(url.getPath()));
+-        }
+-        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
+-                lib = File.createTempFile("jna", null);
+-                lib.deleteOnExit();
+-                if (Platform.deleteNativeLibraryAfterVMExit()) {
+-                    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) { }
+-                }
+-            }
++            System.load("@JNIPATH@/" + System.mapLibraryName("jnidispatch"));
++        } catch(UnsatisfiedLinkError e) {
++	    throw new RuntimeException(e);
          }
-         catch(UnsatisfiedLinkError e) {
-             loadNativeLibrary();
+-        System.load(lib.getAbsolutePath());
+     }
+ 
+     /**
+Only in jna-3.0.9.orig/src/com/sun/jna: Native.java~


Index: jna.spec
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/jna.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- jna.spec	15 Oct 2008 05:08:44 -0000	1.12
+++ jna.spec	1 Nov 2008 01:05:21 -0000	1.13
@@ -1,6 +1,6 @@
 Name:           jna
-Version:        3.0.4
-Release:        10.svn729%{?dist}
+Version:        3.0.9
+Release:        1%{?dist}
 Summary:        Pure Java access to native libraries
 
 Group:          Development/Libraries
@@ -9,8 +9,9 @@
 # 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 dist/*
 #   tar -cjf jna-%{version}.tar.bz2 jna-%{version}
-Source0:        %{name}-%{version}.svn729.tar.bz2
+Source0:        %{name}-%{version}.tar.bz2
 # This patch is Fedora-specific for now until we get the huge
 # JNI library location mess sorted upstream
 Patch1:         jna-3.0.2-loadlibrary.patch
@@ -23,6 +24,8 @@
 Patch3:         jna-3.0.4-nativemapped-array.patch
 # https://jna.dev.java.net/issues/show_bug.cgi?id=XXX
 Patch4:         jna-stringarray-return.patch
+# https://jna.dev.java.net/issues/show_bug.cgi?id=XXX
+Patch5:         jna-callback-exception.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  java-devel >= 1.6 ant jpackage-utils ant-nodeps
@@ -51,11 +54,12 @@
 
 
 %prep
-%setup -q -n %{name}-%{version}-svn729
+%setup -q -n %{name}-%{version}
 sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
 %patch2 -p1 -b .tests-headless
 %patch3 -p1 -b .nativemapped-array
 %patch4 -p1 -b .stringarray-return
+#%patch5 -p1 -b .callback-exception
 
 # all java binaries must be removed from the sources
 find . -name '*.jar' -exec rm -f '{}' \;
@@ -64,9 +68,6 @@
 # remove internal copy of libffi
 rm -rf native/libffi
 
-# remove random unused zips
-rm dist/{src,doc}.zip
-
 # clean LICENSE.txt
 sed -i 's/\r//' LICENSE.txt
 chmod 0644 LICENSE.txt
@@ -112,6 +113,9 @@
 
 
 %changelog
+* Fri Oct 31 2008 Colin Walters <walters at redhat.com> - 3.0.9-1
+- Rebase on upstream 3.0.9
+
 * Tue Oct 14 2008 Colin Walters <walters at redhat.com> - 3.0.4-10.svn729
 - Add patch to support String[] returns
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/jna/devel/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources	1 Oct 2008 18:52:04 -0000	1.6
+++ sources	1 Nov 2008 01:05:21 -0000	1.7
@@ -1 +1 @@
-789cf82e63d0cbc11198d3b2015d3490  jna-3.0.4.svn729.tar.bz2
+1c13deae963a7b48af6f6b8d653affc5  jna-3.0.9.tar.bz2




More information about the fedora-extras-commits mailing list