[libmatthew-java] Replace calls to System.loadLibrary with System.load using explicit paths

Omair Majid omajid at fedoraproject.org
Tue Oct 11 19:34:42 UTC 2011


commit 3808d87a9b365a7d1f08672765f76b9bfd5856ec
Author: Omair Majid <omajid at redhat.com>
Date:   Tue Oct 11 15:33:50 2011 -0400

    Replace calls to System.loadLibrary with System.load using explicit paths

 libmatthew-java.spec       |    6 +++++-
 native-library-paths.patch |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/libmatthew-java.spec b/libmatthew-java.spec
index fc082d7..f34b79d 100644
--- a/libmatthew-java.spec
+++ b/libmatthew-java.spec
@@ -1,6 +1,6 @@
 Name:           libmatthew-java
 Version:        0.8
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A few useful Java libraries
 Group:          Development/Libraries
 License:        MIT
@@ -14,6 +14,7 @@ Source1:        %{name}-hexdump-osgi-MANIFEST.MF
 Source2:        %{name}-unix-osgi-MANIFEST.MF
 
 Patch0:         install_doc.patch
+Patch1:         native-library-paths.patch
 Patch2:         classpath_fix.patch
 
 BuildRequires:  java-devel >= 1:1.6.0
@@ -93,6 +94,9 @@ make install \
 
 
 %changelog
+* Tue Oct 11 2011 Omair Majid <omajid at redhat.com> 0.8-2
+- Add patch to replace System.loadLibrary with System.load with explicit paths
+
 * Wed Jun 29 2011 Alexander Kurtakov <akurtako at redhat.com> 0.8-1
 - Update to new upstream version (0.8).
 - License changed to MIT.
diff --git a/native-library-paths.patch b/native-library-paths.patch
new file mode 100644
index 0000000..d87368f
--- /dev/null
+++ b/native-library-paths.patch
@@ -0,0 +1,36 @@
+diff -ruN libmatthew-java-0.8/cx/ath/matthew/cgi/CGI.java libmatthew-java-0.8/cx/ath/matthew/cgi/CGI.java
+--- libmatthew-java-0.8/cx/ath/matthew/cgi/CGI.java	2011-10-11 14:01:51.256893486 -0400
++++ libmatthew-java-0.8/cx/ath/matthew/cgi/CGI.java	2011-10-11 15:00:07.278193101 -0400
+@@ -59,7 +59,7 @@
+    private native Object[] getfullenv(Class c);
+    private native void setenv(String var, String value);
+    {
+-      System.loadLibrary("cgi-java");
++      System.load("@JNIPATH@/" + System.mapLibraryName("cgi-java"));
+    }
+ 
+    /**
+diff -ruN libmatthew-java-0.8/cx/ath/matthew/unix/UnixServerSocket.java libmatthew-java-0.8/cx/ath/matthew/unix/UnixServerSocket.java
+--- libmatthew-java-0.8/cx/ath/matthew/unix/UnixServerSocket.java	2011-10-11 14:01:51.272892474 -0400
++++ libmatthew-java-0.8/cx/ath/matthew/unix/UnixServerSocket.java	2011-10-11 15:03:24.299532318 -0400
+@@ -33,7 +33,7 @@
+  */
+ public class UnixServerSocket
+ {
+-   static { System.loadLibrary("unix-java"); }
++   static { System.load("@JNIPATH@/" + System.mapLibraryName("unix-java")); }
+    private native int native_bind(String address, boolean abs) throws IOException;
+    private native void native_close(int sock) throws IOException;
+    private native int native_accept(int sock) throws IOException;
+diff -ruN libmatthew-java-0.8/cx/ath/matthew/unix/UnixSocket.java libmatthew-java-0.8/cx/ath/matthew/unix/UnixSocket.java
+--- libmatthew-java-0.8/cx/ath/matthew/unix/UnixSocket.java	2011-10-11 14:01:51.260893231 -0400
++++ libmatthew-java-0.8/cx/ath/matthew/unix/UnixSocket.java	2011-10-11 15:00:56.194009686 -0400
+@@ -37,7 +37,7 @@
+  */
+ public class UnixSocket
+ {
+-   static { System.loadLibrary("unix-java"); }
++   static { System.load("@JNIPATH@/" + System.mapLibraryName("unix-java")); }
+    private native void native_set_pass_cred(int sock, boolean passcred) throws IOException;
+    private native int native_connect(String address, boolean abs) throws IOException;
+    private native void native_close(int sock) throws IOException;


More information about the scm-commits mailing list