From e7258e9df5a4bd73ed1be4afd13636946b04cfcf Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 11 Jun 2015 09:06:03 +0200 Subject: [PATCH] Cleanup patches --- jna-3.5.2-gcj-javadoc.patch | 13 ---------- jna-4.0.0-loadlibrary.patch | 43 ++++++++++++++++----------------- jna-4.1.0-junit.patch | 48 ------------------------------------- jna.spec | 17 +++++++------ 4 files changed, 28 insertions(+), 93 deletions(-) delete mode 100644 jna-3.5.2-gcj-javadoc.patch delete mode 100644 jna-4.1.0-junit.patch diff --git a/jna-3.5.2-gcj-javadoc.patch b/jna-3.5.2-gcj-javadoc.patch deleted file mode 100644 index 477ae64..0000000 --- a/jna-3.5.2-gcj-javadoc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up ./build.xml.gcj-javadoc ./build.xml ---- ./build.xml.gcj-javadoc 2013-04-29 14:59:19.748042560 +0200 -+++ ./build.xml 2013-04-29 15:00:00.678317442 +0200 -@@ -916,8 +916,6 @@ osname=macosx;processor=x86;processor=x8 - - - -- -- - - - -diff -up ./src/com/sun/jna/Function.java.gcj-javadoc ./src/com/sun/jna/Function.java diff --git a/jna-4.0.0-loadlibrary.patch b/jna-4.0.0-loadlibrary.patch index 959bc3a..540adf0 100644 --- a/jna-4.0.0-loadlibrary.patch +++ b/jna-4.0.0-loadlibrary.patch @@ -1,8 +1,6 @@ -diff --git a/src/com/sun/jna/Native.java b/src/com/sun/jna/Native.java -index 6bdf0db..763d2ef 100644 ---- a/src/com/sun/jna/Native.java -+++ b/src/com/sun/jna/Native.java -@@ -642,8 +642,8 @@ public final class Native implements Version { +--- jna-4.1.0/src/com/sun/jna/Native.java.loadlib 2014-03-06 17:06:40.000000000 +0100 ++++ jna-4.1.0/src/com/sun/jna/Native.java 2015-06-11 09:38:51.017572762 +0200 +@@ -642,102 +642,12 @@ /** * Loads the JNA stub library. @@ -12,11 +10,16 @@ index 6bdf0db..763d2ef 100644 + * unnecessary when JNA is properly installed with the OS. */ private static void loadNativeDispatchLibrary() { - -@@ -656,88 +656,19 @@ public final class Native implements Version { - } - } - +- +- if (!Boolean.getBoolean("jna.nounpack")) { +- try { +- removeTemporaryFiles(); +- } +- catch(IOException e) { +- System.err.println("JNA Warning: IOException removing temporary files: " + e.getMessage()); +- } +- } +- - String libName = System.getProperty("jna.boot.library.name", "jnidispatch"); - String bootPath = System.getProperty("jna.boot.library.path"); - if (bootPath != null) { @@ -80,9 +83,7 @@ index 6bdf0db..763d2ef 100644 - } - } - if (!Boolean.getBoolean("jna.nosys")) { -+ String[] libdirs = {"/usr/lib64/jna/", "/usr/lib/jna/"}; -+ for (String libdir: libdirs) { - try { +- try { - if (DEBUG_JNA_LOAD) { - System.out.println("Trying (via loadLibrary) " + libName); - } @@ -91,22 +92,18 @@ index 6bdf0db..763d2ef 100644 - System.out.println("Found jnidispatch on system path"); - } - return; -+ System.load(libdir + System.mapLibraryName("jnidispatch")); -+ jnidispatchPath = libdir + System.mapLibraryName("jnidispatch"); -+ break; - } - catch(UnsatisfiedLinkError e) { -+ if (libdir.equals(libdirs[libdirs.length - 1])) { -+ throw new RuntimeException(e); -+ } - } - } +- } +- catch(UnsatisfiedLinkError e) { +- } +- } - if (!Boolean.getBoolean("jna.noclasspath")) { - loadNativeDispatchLibraryFromClasspath(); - } - else { - throw new UnsatisfiedLinkError("Unable to locate JNA native support library"); - } ++ jnidispatchPath = "@LIBDIR@/" + System.mapLibraryName("jnidispatch"); ++ System.load(jnidispatchPath); } static final String JNA_TMPLIB_PREFIX = "jna"; diff --git a/jna-4.1.0-junit.patch b/jna-4.1.0-junit.patch deleted file mode 100644 index adeae5c..0000000 --- a/jna-4.1.0-junit.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -up ./build.xml.junit ./build.xml ---- ./build.xml.junit 2014-03-07 12:52:05.899899902 +0100 -+++ ./build.xml 2014-03-07 12:58:14.956255306 +0100 -@@ -290,7 +290,7 @@ - - - -- -+ - - - -@@ -486,7 +486,7 @@ osname=macosx;processor=x86;processor=x8 - - - -- -+ - - - -@@ -509,7 +509,7 @@ osname=macosx;processor=x86;processor=x8 - - - -- -+ - - - -@@ -822,7 +822,7 @@ osname=macosx;processor=x86;processor=x8 - - - -- -+ - - - -@@ -933,7 +933,7 @@ osname=macosx;processor=x86;processor=x8 - - - -- -+ - - - diff --git a/jna.spec b/jna.spec index 4ebdb44..5bcf0a8 100644 --- a/jna.spec +++ b/jna.spec @@ -20,10 +20,6 @@ Patch1: jna-4.0.0-loadlibrary.patch # and using a complex API like X11 through JNA just increases the potential # for problems. Patch2: jna-4.0.0-tests-headless.patch -# Build using GCJ javadoc -Patch3: jna-3.5.2-gcj-javadoc.patch -# junit cames from rpm -Patch4: jna-4.1.0-junit.patch Patch6: jna-4.0.0-ffi.patch Patch7: jna-4.0.0-fix-native-test.patch @@ -31,7 +27,7 @@ Patch7: jna-4.0.0-fix-native-test.patch # inside jars. Requires: java, jpackage-utils, libffi BuildRequires: java-devel, jpackage-utils, libffi-devel -BuildRequires: ant, ant-junit, junit +BuildRequires: ant, ant-junit, junit, reflections BuildRequires: libX11-devel, libXt-devel @@ -69,19 +65,22 @@ This package contains the contributed examples for %{name}. cp %{SOURCE1} . %patch0 -p1 -b .build %patch1 -p1 -b .loadlib -sed -i 's|@JNIPATH@|%{_libdir}/%{name}|' src/com/sun/jna/Native.java %patch2 -p1 -b .tests-headless -chmod -Rf a+rX,u+w,g-w,o-w . -%patch3 -p0 -b .gcj-javadoc -%patch4 -p1 -b .junit %patch6 -p1 -b .ffi %patch7 -p1 +chmod -Rf a+rX,u+w,g-w,o-w . +sed -i 's|@LIBDIR@|%{_libdir}/%{name}|' src/com/sun/jna/Native.java + # clean LICENSE.txt sed -i 's/\r//' LICENSE chmod -c 0644 LICENSE OTHERS CHANGES.md +sed s,',&,' -i build.xml + +build-jar-repository -s -p lib junit reflections +cp lib/native/aix-ppc64.jar lib/clover.jar %build # We pass -Ddynlink.native which comes from our patch because