From cec65550af1d2e215fce7cedb6ebc39410702eaf Mon Sep 17 00:00:00 2001 From: rcritten Date: Thu, 7 Jan 2010 16:11:31 +0000 Subject: [PATCH] Move location of libjss4.so to subdirectory and use System.load() to load it instead of System.loadLibrary() for Fedora packaging compliance (#533304) --- jss-loadlibrary.patch | 29 +++++++++++++++++++++++++++++ jss.spec | 15 +++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 jss-loadlibrary.patch diff --git a/jss-loadlibrary.patch b/jss-loadlibrary.patch new file mode 100644 index 0000000..ac841b1 --- /dev/null +++ b/jss-loadlibrary.patch @@ -0,0 +1,29 @@ +diff -uN --recursive jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/CryptoManager.java jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.java +--- jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/CryptoManager.java 2008-01-31 17:29:16.000000000 -0500 ++++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.java 2010-01-07 10:47:04.000000000 -0500 +@@ -1334,11 +1334,20 @@ + */ + synchronized static void loadNativeLibraries() + { +- if( ! mNativeLibrariesLoaded ) +- { +- System.loadLibrary("jss4"); +- Debug.trace(Debug.VERBOSE, "jss library loaded"); +- mNativeLibrariesLoaded = true; ++ if( ! mNativeLibrariesLoaded ) { ++ try { ++ System.load( "/usr/lib64/jss/libjss4.so" ); ++ Debug.trace(Debug.VERBOSE, "jss library loaded"); ++ mNativeLibrariesLoaded = true; ++ } catch( Exception e ) { ++ try { ++ System.load( "/usr/lib/jss/libjss4.so" ); ++ Debug.trace(Debug.VERBOSE, "jss library loaded"); ++ mNativeLibrariesLoaded = true; ++ } catch( Exception f ) { ++ Debug.trace(Debug.VERBOSE, "jss library load failed"); ++ } ++ } + } + } + static private boolean mNativeLibrariesLoaded = false; diff --git a/jss.spec b/jss.spec index 5e3f08e..bd4664f 100644 --- a/jss.spec +++ b/jss.spec @@ -1,6 +1,6 @@ Name: jss Version: 4.2.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Java Security Services (JSS) Group: System Environment/Libraries @@ -26,6 +26,7 @@ Patch1: jss-key_pair_usage_with_op_flags.patch Patch2: jss-javadocs-param.patch Patch3: jss-ipv6.patch Patch4: jss-ECC-pop.patch +Patch5: jss-loadlibrary.patch %description Java Security Services (JSS) is a java native interface which provides a bridge @@ -46,6 +47,7 @@ This package contains the API documentation for JSS. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build [ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java @@ -104,8 +106,8 @@ popd # We have to use the name libjss4.so because this is dynamically # loaded by the jar file. -install -d -m 0755 $RPM_BUILD_ROOT%{_libdir} -install -m 0755 mozilla/dist/Linux*.OBJ/lib/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/ +install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}/jss +install -m 0755 mozilla/dist/Linux*.OBJ/lib/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/jss/ # FIXME - sign jss4.jar. In order to use JSS as a JCE provider it needs to be # signed with a Sun-issued certificate. Since we would need to make this @@ -132,7 +134,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc mozilla/security/jss/jss.html MPL-1.1.txt gpl.txt lgpl.txt %{_jnidir}/* -%{_libdir}/lib*.so +%{_libdir}/jss/lib*.so %files javadoc %defattr(-,root,root,-) @@ -141,6 +143,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jan 7 2010 Rob Crittenden 4.2.6-5 +- Move location of libjss4.so to subdirectory and use System.load() to + load it instead of System.loadLibrary() for Fedora packaging compliance + (#533304) + * Fri Jul 31 2009 Rob Crittenden 4.2.6-4 - Support ECC POP on the server (#224688) - Server Sockets are hard coded to IPV4 (#469456)