rpms/jna/EL-5 jna-3.2.4-loadlibrary.patch, NONE, 1.1 jna-3.2.4-tests-headless.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 import.log, 1.1, 1.2 jna.spec, 1.1, 1.2 sources, 1.2, 1.3 jna-3.0.2-loadlibrary.patch, 1.1, NONE jna-3.0.4-nativemapped-array.patch, 1.1, NONE jna-stringarray-return.patch, 1.1, NONE jna-tests-headless.patch, 1.1, NONE

Levente Farkas lfarkas at fedoraproject.org
Mon Nov 23 18:36:40 UTC 2009


Author: lfarkas

Update of /cvs/pkgs/rpms/jna/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4896/EL-5

Modified Files:
	.cvsignore import.log jna.spec sources 
Added Files:
	jna-3.2.4-loadlibrary.patch jna-3.2.4-tests-headless.patch 
Removed Files:
	jna-3.0.2-loadlibrary.patch jna-3.0.4-nativemapped-array.patch 
	jna-stringarray-return.patch jna-tests-headless.patch 
Log Message:
update to 3.2.4


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

--- NEW FILE jna-3.2.4-loadlibrary.patch ---
diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java
--- ./src/com/sun/jna/Native.java.loadlib	2009-11-09 10:23:05.000000000 +0100
+++ ./src/com/sun/jna/Native.java	2009-11-09 10:30:41.000000000 +0100
@@ -630,131 +630,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(url.toURI());
-            }
-            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.4-tests-headless.patch:
 build.xml |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE jna-3.2.4-tests-headless.patch ---
diff -up ./build.xml.tests-headless ./build.xml
--- ./build.xml.tests-headless	2009-11-09 10:35:40.000000000 +0100
+++ ./build.xml	2009-11-09 10:36:06.000000000 +0100
@@ -466,6 +466,7 @@
       <jvmarg value="-Djna.protected=true"/>
       <jvmarg value="-Djna.builddir=${build}"/>
       <jvmarg value="${vmopt.arch}"/>
+      <jvmarg value="-Djava.awt.headless=true"/>
       <classpath><path refid="test.runpath"/></classpath>
       <formatter type="xml"/>
       <batchtest todir="${results.junit}">


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/jna/EL-5/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	10 Nov 2008 15:39:51 -0000	1.2
+++ .cvsignore	23 Nov 2009 18:36:39 -0000	1.3
@@ -1 +1 @@
-jna-3.0.4.svn729.tar.bz2
+jna-3.2.4.tar.bz2


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/jna/EL-5/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- import.log	10 Nov 2008 15:39:51 -0000	1.1
+++ import.log	23 Nov 2009 18:36:39 -0000	1.2
@@ -1 +1,2 @@
 jna-3_0_4-10_svn729_fc10:EL-5:jna-3.0.4-10.svn729.fc10.src.rpm:1226331400
+jna-3_2_4-1_el5:EL-5:jna-3.2.4-1.el5.src.rpm:1259001372


Index: jna.spec
===================================================================
RCS file: /cvs/pkgs/rpms/jna/EL-5/jna.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- jna.spec	10 Nov 2008 15:39:51 -0000	1.1
+++ jna.spec	23 Nov 2009 18:36:40 -0000	1.2
@@ -1,6 +1,6 @@
 Name:           jna
-Version:        3.0.4
-Release:        10.svn729%{?dist}
+Version:        3.2.4
+Release:        1%{?dist}
 Summary:        Pure Java access to native libraries
 
 Group:          Development/Libraries
@@ -9,27 +9,29 @@ 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}
-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
+Patch1:         jna-3.2.4-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-tests-headless.patch
-# https://jna.dev.java.net/issues/show_bug.cgi?id=90
-Patch3:         jna-3.0.4-nativemapped-array.patch
-# https://jna.dev.java.net/issues/show_bug.cgi?id=XXX
-Patch4:         jna-stringarray-return.patch
+Patch2:         jna-3.2.4-tests-headless.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  java-devel >= 1.6 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 >= 1:1.6.0 jpackage-utils
+Requires:       java >= 1:1.6.0 jpackage-utils libffi
+# for ExcludeArch see bug: 468831
+%if 0%{?rhel} < 6
+ExcludeArch: ppc ppc64
+%endif
+
 
 %description
 JNA provides Java programs easy access to native shared libraries
@@ -50,12 +52,20 @@ Requires:       %{name} = %{version}-%{r
 This package contains the javadocs for %{name}.
 
 
+%package        examples
+Summary:        Examples for %{name}
+Group:          Documentation
+Requires:       %{name} = %{version}-%{release}
+
+
+%description    examples
+This package contains the examples for %{name}.
+
+
 %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
 
 # all java binaries must be removed from the sources
 find . -name '*.jar' -exec rm -f '{}' \;
@@ -64,9 +74,6 @@ find . -name '*.class' -exec rm -f '{}' 
 # 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
@@ -75,7 +82,7 @@ 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 jar -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true
+ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar examples
 ant javadoc
 
 
@@ -84,6 +91,7 @@ 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,
@@ -104,14 +112,43 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %doc LICENSE.txt
 %{_libdir}/%{name}
-%{_javadir}/*.jar
+%{_javadir}/%{name}.jar
+%{_javadir}/%{name}-%{version}.jar
+
 
 %files javadoc
 %defattr(-,root,root,-)
 %{_javadocdir}/%{name}-%{version}
 
 
+%files examples
+%defattr(-,root,root,-)
+%{_javadir}/%{name}-examples.jar
+%{_javadir}/%{name}-examples-%{version}.jar
+
+
 %changelog
+* Sat Nov 14 2009 Levente Farkas <lfarkas at lfarkas.org> - 3.2.4-1
+- Rebase on upstream 3.2.4
+
+* Thu Oct 29 2009 Lubomir Rintel <lkundrak at v3.sk> - 3.0.9-6
+- Add examples subpackage
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.9-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.9-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Tue Dec 30 2008 Colin Walters <walters at redhat.com> - 3.0.9-3
+- Add patch to allow opening current process
+
+* Sun Nov 30 2008 Colin Walters <walters at redhat.com> - 3.0.9-2
+- Fix library mapping, remove upstreamed patches
+
+* 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/EL-5/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	10 Nov 2008 15:39:52 -0000	1.2
+++ sources	23 Nov 2009 18:36:40 -0000	1.3
@@ -1 +1 @@
-789cf82e63d0cbc11198d3b2015d3490  jna-3.0.4.svn729.tar.bz2
+3e53de2ba6c9e3920ec681224114209e  jna-3.2.4.tar.bz2


--- jna-3.0.2-loadlibrary.patch DELETED ---


--- jna-3.0.4-nativemapped-array.patch DELETED ---


--- jna-stringarray-return.patch DELETED ---


--- jna-tests-headless.patch DELETED ---




More information about the scm-commits mailing list