commit dec4edc0a2711e85e08a91fa59d3f8d03558d9c0f0df1bddd2e2ef3ede8b636e Author: Adrian Schröter Date: Fri May 3 14:04:18 2024 +0200 Sync from SUSE:SLFO:Main jna revision 2c1ad2ba7b9a8d1ccd8c79c6e8a1d667 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/5.13.0.tar.gz b/5.13.0.tar.gz new file mode 100644 index 0000000..a30c685 --- /dev/null +++ b/5.13.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:526bff8ffcbc2067a7403f55b01ad8d7a781c098abca79c4ea6c9e80198bb5fd +size 116027625 diff --git a/jna-build.patch b/jna-build.patch new file mode 100644 index 0000000..7ce6995 --- /dev/null +++ b/jna-build.patch @@ -0,0 +1,301 @@ +--- jna-5.13.0/build.xml 2023-05-30 11:38:06.363232087 +0200 ++++ jna-5.13.0/build.xml 2023-05-30 15:27:50.875085921 +0200 +@@ -370,7 +370,7 @@ + + + +- ++ + + + +@@ -440,7 +440,7 @@ + + + +- + +- + + + +@@ -596,108 +515,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +@@ -781,7 +598,7 @@ + + + +- ++ + + + +@@ -1196,7 +1013,7 @@ + + + +- + + + +- +- + + + +@@ -1486,7 +1301,6 @@ + JNA API Documentation +
${header}
+ ${footer} +- + + + +@@ -1504,13 +1318,14 @@ + + + ++ + + + + +
+ +- + + +--- jna-5.13.0/native/Makefile 2023-05-30 11:38:06.515233135 +0200 ++++ jna-5.13.0/native/Makefile 2023-05-30 12:04:00.394037184 +0200 +@@ -97,7 +97,7 @@ + PCFLAGS=-W -Wall -Wno-unused -Wno-parentheses + CFLAGS=$(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \ + -DJNA_JNI_VERSION='"$(JNA_JNI_VERSION)"' -DCHECKSUM='"$(CHECKSUM)"' +-LDFLAGS=-o $@ -shared ++LDFLAGS=$(RPM_LD_FLAGS) -o $@ -shared + ifeq ($(DYNAMIC_LIBFFI),true) + CFLAGS += $(shell pkg-config --cflags libffi 2>/dev/null || echo) + LIBS += $(shell pkg-config --libs libffi 2>/dev/null || echo -lffi) +@@ -356,11 +356,11 @@ + GCC_MAJOR_VERSION = $(shell gcc -dumpversion | cut -f 1 -d '.') + ifneq ($(GCC_MAJOR_VERSION),4) + ifneq ($(GCC_MAJOR_VERSION),3) +- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable -Wno-alloca-larger-than ++ LOC_CC_OPTS=-Wno-error -Wno-clobbered -Wno-unused-variable -Wno-alloca-larger-than + endif + endif + else +- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable ++ LOC_CC_OPTS=-Wno-error -Wno-clobbered -Wno-unused-variable + endif + + # Enable 64-bit builds if the arch demands it +@@ -486,7 +486,6 @@ + + $(LIBRARY): $(JNIDISPATCH_OBJS) $(FFI_LIB) + $(LD) $(LDFLAGS) $(JNIDISPATCH_OBJS) $(FFI_LIB) $(LIBS) +- $(STRIP) $@ + + $(TESTLIB): $(BUILD)/testlib.o + $(LD) $(LDFLAGS) $< $(LIBS) diff --git a/jna-callback.patch b/jna-callback.patch new file mode 100644 index 0000000..18fd73b --- /dev/null +++ b/jna-callback.patch @@ -0,0 +1,74 @@ +--- jna-5.4.0/native/testlib.c 2019-07-19 21:22:03.000000000 +0200 ++++ jna-5.4.0/native/testlib.c 2019-10-10 18:45:58.780052342 +0200 +@@ -804,8 +804,8 @@ + } + + EXPORT callback_t +-callCallbackWithCallback(cb_callback_t cb) { +- return (*cb)((callback_t)(void*)cb); ++callCallbackWithCallback(cb_callback_t cb, callback_t arg) { ++ return (*cb)(arg); + } + + static int32_t +--- jna-5.4.0/test/com/sun/jna/CallbacksTest.java 2019-07-19 21:22:03.000000000 +0200 ++++ jna-5.4.0/test/com/sun/jna/CallbacksTest.java 2019-10-10 18:43:51.679371223 +0200 +@@ -194,9 +194,9 @@ + int callCallbackWithByReferenceArgument(CopyArgToByReference cb, int arg, IntByReference result); + TestStructure.ByValue callCallbackWithStructByValue(TestStructure.TestCallback callback, TestStructure.ByValue cbstruct); + interface CbCallback extends Callback { +- CbCallback callback(CbCallback arg); ++ Callback callback(Callback arg); + } +- CbCallback callCallbackWithCallback(CbCallback cb); ++ Callback callCallbackWithCallback(CbCallback cb, Callback arg); + + interface Int32CallbackX extends Callback { + public int callback(int arg); +@@ -843,7 +843,7 @@ + return arg; + } + }; +- TestLibrary.CbCallback cb2 = lib.callCallbackWithCallback(cb); ++ TestLibrary.Callback cb2 = lib.callCallbackWithCallback(cb, cb); + assertEquals("Callback reference should be reused", cb, cb2); + } + +@@ -859,7 +859,7 @@ + throw ERROR; + } + }; +- TestLibrary.CbCallback cb2 = lib.callCallbackWithCallback(cb); ++ TestLibrary.Callback cb2 = lib.callCallbackWithCallback(cb, cb); + String output = s.toString(); + assertTrue("Default handler not called", output.length() > 0); + } +@@ -890,7 +890,7 @@ + throw ERROR; + } + }; +- TestLibrary.CbCallback cb2 = lib.callCallbackWithCallback(cb); ++ TestLibrary.Callback cb2 = lib.callCallbackWithCallback(cb, cb); + assertNotNull("Exception handler not called", CALLBACK[0]); + assertEquals("Wrong callback argument to handler", cb, CALLBACK[0]); + assertEquals("Wrong exception passed to handler", +@@ -935,7 +935,7 @@ + } + }; + TestLibrary.CbCallback cb = new TestProxy(); +- TestLibrary.CbCallback cb2 = lib.callCallbackWithCallback(cb); ++ TestLibrary.CbCallback cb2 = lib.callCallbackWithCallback(cb, cb); + assertNotNull("Exception handler not called", CALLBACK[0]); + assertEquals("Wrong callback argument to handler", cb, CALLBACK[0]); + assertEquals("Wrong exception passed to handler", +--- jna-5.4.0/test/com/sun/jna/DirectCallbacksTest.java 2019-07-19 21:22:03.000000000 +0200 ++++ jna-5.4.0/test/com/sun/jna/DirectCallbacksTest.java 2019-10-10 18:43:51.675371201 +0200 +@@ -65,7 +65,7 @@ + @Override + public native TestStructure.ByValue callCallbackWithStructByValue(TestStructure.TestCallback callback, TestStructure.ByValue cbstruct); + @Override +- public native CbCallback callCallbackWithCallback(CbCallback cb); ++ public native Callback callCallbackWithCallback(CbCallback cb, Callback arg); + @Override + public native Int32CallbackX returnCallback(); + @Override diff --git a/jna-java8compat.patch b/jna-java8compat.patch new file mode 100644 index 0000000..b813d44 --- /dev/null +++ b/jna-java8compat.patch @@ -0,0 +1,136 @@ +--- jna-5.13.0/build.xml 2023-05-30 15:30:31.116195853 +0200 ++++ jna-5.13.0/build.xml 2023-05-30 15:31:56.400786710 +0200 +@@ -106,8 +106,14 @@ + JDK 11 is the last JDK, that supports creation of Java 6 compatible class + files. + --> +- ++ ++ + ++ ++ ++ ++ ++ + + + +--- jna-5.13.0/contrib/platform/src/com/sun/jna/platform/mac/XAttrUtil.java 2023-05-30 15:30:31.140196020 +0200 ++++ jna-5.13.0/contrib/platform/src/com/sun/jna/platform/mac/XAttrUtil.java 2023-05-30 15:30:47.452309013 +0200 +@@ -23,6 +23,7 @@ + */ + package com.sun.jna.platform.mac; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.charset.Charset; + import java.util.ArrayList; +@@ -102,11 +103,11 @@ + bb.mark(); // first key starts from here + while (bb.hasRemaining()) { + if (bb.get() == 0) { +- ByteBuffer nameBuffer = (ByteBuffer) bb.duplicate().limit(bb.position() - 1).reset(); ++ ByteBuffer nameBuffer = (ByteBuffer) ((Buffer)(bb.duplicate())).limit(bb.position() - 1).reset(); + if (nameBuffer.hasRemaining()) { + names.add(decodeString(nameBuffer)); + } +- bb.mark(); // next key starts from here ++ ((Buffer)bb).mark(); // next key starts from here + } + } + +--- jna-5.13.0/test/com/sun/jna/BufferArgumentsMarshalTest.java 2023-05-30 15:30:31.288197044 +0200 ++++ jna-5.13.0/test/com/sun/jna/BufferArgumentsMarshalTest.java 2023-05-30 15:30:47.452309013 +0200 +@@ -23,6 +23,7 @@ + */ + package com.sun.jna; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.DoubleBuffer; +@@ -108,7 +109,7 @@ + for (int i=0;i < buf.capacity();i++) { + assertEquals("Bad value at index " + i, MAGIC, buf.get(i)); + } +- buf.position(512); ++ ((Buffer)buf).position(512); + lib.fillInt8Buffer(buf, 512, (byte)0); + for (int i=0;i < buf.capacity();i++) { + assertEquals("Bad value at index " + i, +--- jna-5.13.0/test/com/sun/jna/PerformanceTest.java 2023-05-30 15:30:31.288197044 +0200 ++++ jna-5.13.0/test/com/sun/jna/PerformanceTest.java 2023-05-30 15:30:47.452309013 +0200 +@@ -396,7 +396,7 @@ + start = System.currentTimeMillis(); + for (int i=0;i < COUNT;i++) { + byte[] bytes = str.getBytes(); +- b.position(0); ++ ((Buffer)b).position(0); + b.put(bytes); + b.put((byte)0); + int iresult = CLibrary.strlen(b); +@@ -413,7 +413,7 @@ + for (int i=0;i < COUNT;i++) { + b.putInt(8, (int)pb.peer + 12); + b.putInt(12, (int)pb.peer + 16); +- b.position(16); ++ ((Buffer)b).position(16); + // This operation is very expensive! + b.put(str.getBytes()); + b.put((byte)0); +@@ -454,7 +454,7 @@ + + start = System.currentTimeMillis(); + for (int i=0;i < COUNT;i++) { +- b.position(0); ++ ((Buffer)b).position(0); + b.put(bulk); + } + delta = System.currentTimeMillis() - start; +--- jna-5.13.0/test/com/sun/jna/PointerBufferTest.java 2023-05-30 15:30:31.288197044 +0200 ++++ jna-5.13.0/test/com/sun/jna/PointerBufferTest.java 2023-05-30 15:30:47.452309013 +0200 +@@ -24,6 +24,7 @@ + + package com.sun.jna; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.DoubleBuffer; +@@ -42,7 +43,7 @@ + final String ENCODING = "utf8"; + Memory m = new Memory(1024); + ByteBuffer buf = m.getByteBuffer(0, m.size()).order(ByteOrder.nativeOrder()); +- buf.put(MAGIC.getBytes(ENCODING)).put((byte) 0).flip(); ++ ((Buffer)(buf.put(MAGIC.getBytes(ENCODING)).put((byte) 0))).flip(); + assertEquals("String not written to memory", MAGIC, + m.getString(0, ENCODING)); + } +@@ -50,7 +51,7 @@ + final byte MAGIC = (byte)0xED; + Memory m = new Memory(8); + ByteBuffer buf = m.getByteBuffer(0, m.size()).order(ByteOrder.nativeOrder()); +- buf.put(MAGIC).flip(); ++ ((Buffer)(buf.put(MAGIC))).flip(); + assertEquals("Byte not written to memory", MAGIC, + m.getByte(0)); + } +@@ -58,7 +59,7 @@ + final int MAGIC = 0xABEDCF23; + Memory m = new Memory(8); + ByteBuffer buf = m.getByteBuffer(0, m.size()).order(ByteOrder.nativeOrder()); +- buf.putInt(MAGIC).flip(); ++ ((Buffer)(buf.putInt(MAGIC))).flip(); + assertEquals("Int not written to memory", MAGIC, + m.getInt(0)); + } +@@ -66,7 +67,7 @@ + final long MAGIC = 0x1234567887654321L; + Memory m = new Memory(8); + ByteBuffer buf = m.getByteBuffer(0, m.size()).order(ByteOrder.nativeOrder()); +- buf.putLong(MAGIC).flip(); ++ ((Buffer)(buf.putLong(MAGIC))).flip(); + assertEquals("Long not written to memory", MAGIC, + m.getLong(0)); + } diff --git a/jna-old-libffi.patch b/jna-old-libffi.patch new file mode 100644 index 0000000..aa28c42 --- /dev/null +++ b/jna-old-libffi.patch @@ -0,0 +1,14 @@ +--- jna-5.13.0/native/dispatch.c 2023-06-03 22:40:07.554822192 +0200 ++++ jna-5.13.0/native/dispatch.c 2023-06-03 22:40:35.518255491 +0200 +@@ -443,11 +443,6 @@ + "%s: Invalid structure definition (native typedef error, FFI_BAD_TYPEDEF)", op); + throwByName(env, EIllegalArgument, msg); + return JNI_TRUE; +- case FFI_BAD_ARGTYPE: +- snprintf(msg, sizeof(msg), +- "%s: Invalid argument type (FFI_BAD_ARGTYPE)", op); +- throwByName(env, EIllegalArgument, msg); +- return JNI_TRUE; + default: + snprintf(msg, sizeof(msg), "%s failed (%d)", op, status); + throwByName(env, EError, msg); diff --git a/jna-rpmlintrc b/jna-rpmlintrc new file mode 100644 index 0000000..afcf7ea --- /dev/null +++ b/jna-rpmlintrc @@ -0,0 +1,2 @@ +# Rpm doesn't detect the library dependency on Java packages +addFilter("^jna.*: W: explicit-lib-dependency libjnidispatch") diff --git a/jna-system-libjnidispatch.patch b/jna-system-libjnidispatch.patch new file mode 100644 index 0000000..8540fd2 --- /dev/null +++ b/jna-system-libjnidispatch.patch @@ -0,0 +1,91 @@ +--- jna-5.4.0/src/com/sun/jna/Native.java 2019-07-19 21:22:03.000000000 +0200 ++++ jna-5.4.0/src/com/sun/jna/Native.java 2019-10-10 18:58:56.464572605 +0200 +@@ -912,84 +912,12 @@ + * Loads the JNA stub library. + * First tries jna.boot.library.path, then the system path, then from the + * jar file. ++ * 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 loadNativeDispatchLibrary() { +- if (!Boolean.getBoolean("jna.nounpack")) { +- try { +- removeTemporaryFiles(); +- } +- catch(IOException e) { +- LOG.log(Level.WARNING, "JNA Warning: IOException removing temporary files", e); +- } +- } +- +- String libName = System.getProperty("jna.boot.library.name", "jnidispatch"); +- String bootPath = System.getProperty("jna.boot.library.path"); +- if (bootPath != null) { +- // String.split not available in 1.4 +- StringTokenizer dirs = new StringTokenizer(bootPath, File.pathSeparator); +- while (dirs.hasMoreTokens()) { +- String dir = dirs.nextToken(); +- File file = new File(new File(dir), System.mapLibraryName(libName).replace(".dylib", ".jnilib")); +- String path = file.getAbsolutePath(); +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Looking in {0}", path); +- if (file.exists()) { +- try { +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying {0}", path); +- System.setProperty("jnidispatch.path", path); +- System.load(path); +- jnidispatchPath = path; +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch at {0}", path); +- return; +- } catch (UnsatisfiedLinkError ex) { +- // Not a problem if already loaded in anoteher class loader +- // Unfortunately we can't distinguish the difference... +- //System.out.println("File found at " + file + " but not loadable: " + ex.getMessage()); +- } +- } +- if (Platform.isMac()) { +- String orig, ext; +- if (path.endsWith("dylib")) { +- orig = "dylib"; +- ext = "jnilib"; +- } else { +- orig = "jnilib"; +- ext = "dylib"; +- } +- path = path.substring(0, path.lastIndexOf(orig)) + ext; +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Looking in {0}", path); +- if (new File(path).exists()) { +- try { +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying {0}", path); +- System.setProperty("jnidispatch.path", path); +- System.load(path); +- jnidispatchPath = path; +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch at {0}", path); +- return; +- } catch (UnsatisfiedLinkError ex) { +- LOG.log(Level.WARNING, "File found at " + path + " but not loadable: " + ex.getMessage(), ex); +- } +- } +- } +- } +- } +- String jnaNosys = System.getProperty("jna.nosys", "true"); +- if ((!Boolean.parseBoolean(jnaNosys)) || Platform.isAndroid()) { +- try { +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying (via loadLibrary) {0}", libName); +- System.loadLibrary(libName); +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch on system path"); +- return; +- } +- 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.changes b/jna.changes new file mode 100644 index 0000000..1aca442 --- /dev/null +++ b/jna.changes @@ -0,0 +1,569 @@ +------------------------------------------------------------------- +Tue Jan 23 15:33:23 UTC 2024 - Fridrich Strba + +- Modified patch: + * jna-java8compat.patch + + force java 1.8 compatibility for all JDKs which support it + +------------------------------------------------------------------- +Wed Aug 30 10:34:18 UTC 2023 - Fridrich Strba + +- Upgrade to upstream version 5.13.0 +- Changes in version 5.13.0: + * Features: + + #1454: Add 'c.s.j.p.win32.Psapi.QueryWorkingSetEx' and + associated Types + + #1459: Add 'VirtualLock' and 'VirtualUnlock' in + 'c.s.j.p.win32.Kernel32' + + #1471: Add + 'c.s.j.p.win32.Advapi32Util#isCurrentProcessElevated' and + associated Types + + #1474: Add + 'c.s.j.p.win32.WbemCli#IWbemClassObject.IWbemQualifierSet', + 'IWbemServices.GetObject', 'IWbemContext.SetValue' and + associated methods + + #1482: Add multilingual support of + 'Kernel32Util.formatMessage' + + #1490: Adds support for a custom 'SymbolProvider' in + 'NativeLibrary' & 'Library' + + #1491: Update libffi to v3.4.4 + + #1487: Add 'uses' information to OSGI metadata in MANIFEST.MF + to improve stability of package resolution + * Bug Fixes: + + #1452: Fix memory allocation/handling for error message + generation in native library code ('dispatch.c') + + #1460: Fix win32 variant date conversion in DST offest window + and with millisecond values + + #1472: Fix incorrect bitmask in + 'c.s.j.Pointer#createConstant(int)' + + #1481: Fix NPE in NativeLibrary when unpacking from classpath + is disabled + + #1489: Fixes typo in 'OpenGL32Util#wglGetProcAddress', instead + of parameter 'procName' the hardcoded value 'wglEnumGpusNV' + was used +- Changes in version 5.12.1: + * Bug Fixes: + + #1447: Null-check cleanable in 'c.s.j.Memory#close' +- Changes in version 5.12.0: + * Features: + + #1433: Add 'CFEqual', 'CFDictionaryRef.ByReference', + 'CFStringRef.ByReference' to 'c.s.j.p.mac.CoreFoundation' + + #978: Remove use of finalizers in JNA and improve concurrency + for 'Memory', 'CallbackReference' and 'NativeLibrary' + + #1440: Support for LoongArch64 + + #1444: Update embedded libffi to + 1f14b3fa92d4442a60233e9596ddec428a985e3c and rebuild native + libraries + * Bug Fixes: + + #1438: Handle arrays in structures with differing size + + #1442: Handle race condition in + 'c.s.j.p.win32.PdhUtil#PdhEnumObjectItems' + * Important Changes: + + 'Memory#dispose', 'CallbackReference#dispose' and + 'NativeLibrary#dispose' were called by the 'Object#finalize' + override. These calls were replaced by the use of a cleaner. + It is not guaranteed anymore, that 'dispose' is called on + subclasses on finalization. +- Changes in version 5.11.0: + * Features: + + #1398: Increase 'c.s.j.p.win32.Sspi#MAX_TOKEN_SIZE' on + Windows 8/Server 2012 and later + + #1403: Rebuild AIX binaries with libffi 3.4.2 (other + architectures were part of 5.10) + + #1404: Added Solaris Kstat2 library + + #1416: Add 'CFDictionaryGetCount' to + 'c.s.j.p.mac.CoreFoundation' + + #1418: Add 'CertOpenStore' to 'c.s.j.p.win32.Crypt32' + * Bug Fixes: + + #1411: Do not throw 'Win32Exception' on success for empty + section in 'Kernel32Util#getPrivateProfileSection' + + #1414: Fix definition of 'c.s.j.p.unix.X11.XK_Shift_R' + + #1323. Fix crashes in direct callbacks on mac OS aarch64 + + #1422: Load jawt library relative to 'sun.boot.library.path' + system on unix OSes + + #1427: Rebuild all binaries with fix from #1422 and #1323 +- Changes in version 5.10.0: + * Features: + + #1377: Add 'RegLoadAppKey' to 'c.s.j.p.win32.Advapi32' and + 'registryLoadAppKey' to 'c.s.j.p.win32.Advapi32Util' + + #1093: Add 'OpenFileMapping' to 'c.s.j.p.win32.Kernel32' + + #1388: Map the arch 'zarch_64' as reported by SAPJVM8 to + 's390x' + + #1381: Update embedded libffi to 3.4.2 + + #1393: Update native encoding detection for JEP400 / JDK 18 + ('file.encoding' now defaults to 'UTF-8') + * Bug Fixes: + + #1378: Handle failure in 'ffi_closure_alloc' +- Changes in version 5.9.0: + * Features: + + #1336: Add 'HKEY_CURRENT_USER_LOCAL_SETTINGS' to + 'c.s.j.p.win32.WinReg' + + #1337: Add 'REG_NOTIFY_THREAD_AGNOSTIC' to + 'c.s.j.p.win32.WinNet' and update 'REG_LEGAL_CHANGE_FILTER' + + #1338: Add 'RegNotifyChangeKeyValue' to + 'c.s.j.p.win32.Advapi32' + + #1340: Add 'CM_Get_DevNode_Registry_Property' to + 'c.s.j.p.win32.Cfgmgr32' and corresponding util in + 'c.s.j.p.win32.Cfgmgr32Util' + + #1352: Add 'BringWindowToTop' to 'c.s.j.p.win32.User32' + + #1354: Add 'GetParent' to 'c.s.j.p.win32.User32' + + #1360: Add 'CommandLineToArgvW' to 'c.s.j.p.win32.Shell32' + and corresponding util in 'c.s.j.p.win32.Shell32Util' + + #1363: Update 'NUMA_NODE_RELATIONSHIP' in + 'c.s.j.p.win32.WinNT' to new version of the structure and + improve support for future values of + 'c.s.j.p.win32.WinNT.LOGICAL_PROCESSOR_RELATIONSHIP' + * Bug Fixes: + + #1343: 'c.s.j.p.mac.CoreFoundation.CFStringRef#stringValue' + buffer needs space for a null byte + + #1351: Define 'c.s.j.p.unix.size_t.ByReference' and fix macOS + sysctl 'size_t *' parameters + + #1362: Clear security sensitive data after usage in + 'c.s.j.p.win32.Crypt32Util#cryptProtectData' and + '#cryptUnprotectData' + + #1361: Make 'c.s.j.p.win32.Crypt32Util#cryptProtectData' and + '#cryptUnprotectData' properly handle 0-length array as input +- Changes in version 5.8.0: + * Features: + + #1313: Normalize 'RESOURCE_PREFIX' for darwin to + 'darwin-$arch' and split jnidispatch library per architecture + + #1318: Add support for linux-riscv64 + + #1327: Add partial support for future values of + 'c.s.j.p.win32.WinNT.LOGICAL_PROCESSOR_RELATIONSHIP' enum + present in Windows Insider builds + * Bug Fixes: + + #1317: Change the maven coordinates of the JPMS artifacts from + classifier 'jpms' to custom artifact ids 'jna-jpms' and + 'jna-platform-jpms' + + #1322: Handle 0-length domain names in + 'c.s.j.p.win32.Advapi32Util#getAccountBySid' + + #1326: Ensure pointers indirected from Memory and pointing + into Memory retain originating object + * Important Changes: + + The maven coordinates of the experimental JPMS (java module + system) artifacts were moved from using the classifier 'jpms' + to custom artifact ids 'jna-jpms' and 'jna-platform-jpms', + without an classifier. The reason for this is, that the + platform artifacts depend on the jna artifacts and need to + pull in the right variant. This is not possible if the + classifier is used. + + 'RESOURCE_PREFIX' for darwin (mac OS) was changed from + 'darwin' to 'darwin-$arch' as the fat binaries on mac OS + causes various problems: It was reported, that binaries were + rejected from the appstore because x86 binaries were found in + the application (jnidispatch for mac OS x86) and that builds + needed to be special cased so that the native library can be + assembled. The latter is also true for JNA. + While the prefix is changed, the old prefix is still searched + as a fallback location, so if only a fat binary is present, it + can still be loaded. +- Changes in version 5.7.0: + * Features: + + #1301: Improve bindings of the printer notification functions + ('FindFirstPrinterChangeNotification', + 'FindNextPrinterChangeNotification') in 'c.s.j.p.w.Winspool' + + #1238: Add macOS 'aarch64' architecture to universal 'darwin' + target + + #1264: Update libffi to v3.3; Add Windows 'aarch64' target. + + #1293: Bind part of Windows Application Recovery and Restart + API: 'RegisterApplicationRestart', + 'UnregisterApplicationRestart' and + 'GetApplicationRestartSettings' in 'c.s.j.p.w.Kernel32' + + #1217: Add mappings for AIX 'Perfstat' library to + 'c.s.j.p.unix.aix' + + #1231: The test suite can now be executed on Windows using + either ANSI or UNICODE win32 API by passing + '-Dw32.ascii=true/false' to ant. Previously, UNICODE was + always used. + + #1237: *Experimental:* Add artifacts that make jna and + jna-platform named modules (provide 'module-info.class'). + The new artifacts are named 'jna-jpms.jar' and + 'jna-platform-jpms.jar' + + #1242: Add CallWindowProc to User32 + + #1239: Improve performance of allocation of 'c.s.j.Memory' + objects + + #1246: Improve performance of 'c.s.j.Structure#read' and + 'c.s.j.Structure#write' + + #1260: Add mapping for X11 generic events + + #1263: Add LowLevelMouseProc + + #1265: Add mapping for XQueryExtension + + #1299: Add 'c.s.j.p.win32.IPHlpApi#GetExtendedTcpTable', + 'c.s.j.p.win32.IPHlpApi#GetExtendedUdpTable', and supporting + structures. + * Bug Fixes: + + #1286: Fix bindings of 'c.s.j.p.win32.DBT' + + #326: Fix loading library that re-uses pointers for different + callbacks + + #1244: Fix building on GCC 10 + + #1252: Fix bindings of 'CTL_ENTRY#getRgAttribute', + 'CTL_INFO#getRgCTLEntry', 'CTL_INFO#getRgExtension', + 'CERT_EXTENSIONS#getRgExtension', 'CERT_INFO#getRgExtension', + 'CRL_INFO#getRgCRLEntry', 'CRL_INFO#getRgExtension', + 'CRL_ENTRY#getRgExtension'. + Add bindings for 'CertEnumCertificatesInStore', + 'CertEnumCTLsInStore', 'CertEnumCRLsInStore' and + 'CryptQueryObject' in 'c.s.j.p.win32.Crypt32'. + *WARNING:* The signatures for 'CTL_INFO#getRgCTLEntry' and + 'CTL_INFO#getRgExtension' were changed - as the original + signatures were obviously wrong and read the wrong attributes, + it is not considered an API break + + #1275: Fix 'CFStringRef#stringValue' for empty Strings + + #1279: Remove 'DLLCallback' import from 'CallbackReference' + + #1278: Improve compatibility of + 'c.s.j.p.WindowUtils#getProcessFilePath' and fix unittests for + windows 32bit intel + + #1284: Fix illegal access exceptions, when retrieving options + for private library interfaces with an instance field + + #1300: Deprecate 'c.s.j.p.win32.WTypes.BSTR' String + constructor and 'setValue' method, as 'BSTR' allocation should + be managed by COM, Automation, and Interop functions + * Breaking Changes: + + Prebuild native library for darwin x86 (32bit java on mac OS) + was removed +- Changes in version 5.6.0: + * Features: + + #1160: Make FileUtils#moveToTrash a varargs method + + #1167: Add 'c.s.j.p.win32.Kernel32#GetProcessAffinityMask' + + #1168: Add 'c.s.j.p.win32.Kernel32#SetProcessAffinityMask' + + #1169: Wait for process in getLinuxLdPaths + + #1178: Add 'c.s.j.p.win32.IPHlpAPI#GetTcpStatistics', + 'c.s.j.p.win32.IPHlpAPI#GetUdpStatistics', + 'c.s.j.p.win32.IPHlpAPI#GetTcpStatisticsEx' and + 'c.s.j.p.win32.IPHlpAPI#GetUdpStatisticsEx' + + #1182: Add 'toString' to classes extending + 'c.s.j.ptr.ByReference' + + #1191: Add 'c.s.j.p.win32.Advapi32Util#getTokenPrimaryGroup' + + #1194: Add 'GetConsoleScreenBufferInfo', 'ReadConsoleInput' + and 'WriteConsole' with associated structures to + 'c.s.j.p.win32.Wincon' + + #1198: Add 'NetSessionEnum' to 'c.s.j.p.win32.Netapi32' and + 'WTSEnumerateSessions', 'WTSQuerySessionInformation', and + 'WTSFreeMemory' to 'c.s.j.p.win32.Wtsapi32' + + #1200: Add mappings for 'libudev' to 'c.s.j.p.linux.Udev' + + #1202: Add mappings supporting shared memory including + 'c.s.j.p.unix.LibCAPI' types 'size_t' and 'ssize_t', + 'c.s.j.p.linux.LibC' methods 'munmap()', 'msync()', and + 'close()', 'c.s.j.p.unix.LibCUtil' mapping 'mmap()' and + 'ftruncate()', and 'c.s.j.p.linux.LibRT' methods 'shm_open()' + and 'shm_unlink()' + + #1209: Add mappings for 'Thread32First' and 'Thread32Next' to + 'c.s.j.p.win32.Kernel32' + + #1214: Add mapping for EnumProcesses to 'c.s.j.p.win32.Psapi' + and 'c.s.j.p.win32.PsapiUtil' + * Bug Fixes: + + #1183: 'c.s.j.p.win32.WinDef.CHARByReference#getValue' should + only read one byte + + #1184: 'c.s.j.p.win32.WinDef.ULONGLONG' should always be 8 + bytes + + #1196: 'c.s.j.p.win32.WinNT.LARGE_INTEGER' needs to populate + both union fields + + #1216: Failure loading frameworks on macOS 11 +- Modified patches: + * jna-build.patch + * jna-java8compat.patch + + rediff to changed context +- Added patch: + * jna-old-libffi.patch + + patch out an enum that is not present in less recent libffi + used on some older systems + +------------------------------------------------------------------- +Sat Mar 19 21:55:37 UTC 2022 - Fridrich Strba + +- Build with java source/target levels 8 + +------------------------------------------------------------------- +Mon Oct 12 10:02:30 UTC 2020 - Dominique Leuenberger + +- %{suffix} is an rpm internal macro that extracts a suffix + (extension) from a filename. With RPM 4.16, it verifies that a + filename is passed (e.g. %{suffix:filename.spec}); earlier + versions returned "", meaning we can just strip it from the + install command, as we rely on an empty return value. + +------------------------------------------------------------------- +Thu Jun 4 06:38:27 UTC 2020 - Fridrich Strba + +- Upgrade to 5.5.0 + * Features + + Add CoreFoundation, IOKit, and DiskArbitration mappings in + c.s.j.p.mac. + + c.s.j.p.mac.SystemB now extends c.s.j.p.unix.LibCAPI. + + Add additional OSGi headers for the JNA bundle to support + 32bit ARM (hardfloat) + + Include Win32 COM utils (c.s.j.p.win32.com.util and + c.s.j.p.win32.com.annotation) in OSGI bundle + * Bug Fixes + + Fix signature for c.s.j.p.win32.Kernel32#CreateRemoteThread + and bind VirtualAllocEx, VirtualFreeEx, GetExitCodeThread in + c.s.j.p.win32.Kernel32 + + Windows needs a wide string in + c.s.j.p.win32.COM.IShellFolder#ParseDisplayName + + KEY_ALL_ACCESS value is incorrect in c.s.j.p.win32.WinNT.java + + Ensure JARs created from the build system don't contain + invalid Info-ZIP Unicode Path extra info + + Read correct member of + WinBase.SYSTEM_INFO.processorArchitecture union + + Fix passing unions containing integer and floating point + members as parameters by value +- Modified patch: + * jna-build.patch + + rediff to the changed context + + disable warnings as errors + + fix build on ppc64 and s390x + +------------------------------------------------------------------- +Thu Oct 10 18:33:20 UTC 2019 - Fridrich Strba + +- Rename package to jna, since the jna package must be anyway + archful +- Upgrade to 5.4.0 +- Split the package into: + * jna + + archful package + + provides and obsoletes the libjnidispatch package + + packages the libjnidispatch.so + * jna-contrib + + noarch package + + contains the jna-platform examples +- Removed patches: + * jna-4.5.1-nojavah.patch + * jna-getpeer.patch + * jna-msgsize.patch + + not needed anymore with this version +- Modified patches: + * jna-build.patch + * jna-callback.patch + + Adapted to changed context +- Added patches: + * jna-system-libjnidispatch.patch + + Load the libjnidispatch from system + * jna-java8compat.patch + + Add casts to prevent using of java9+ only ByteBuffer + methods + +------------------------------------------------------------------- +Wed Mar 13 19:03:23 UTC 2019 - Fridrich Strba + +- Decide whether to apply the jna-4.5.0-nojavah.patch according + to what java-devel version is used for build + +------------------------------------------------------------------- +Wed Oct 24 14:23:37 UTC 2018 - Fridrich Strba + +- Install the provided pom*.xml files in order to make maven aware + about the jna-platform too + +------------------------------------------------------------------- +Thu Jul 26 11:50:51 UTC 2018 - msuchanek@suse.com + +- Fix dealing with different java environments +- Fix license warning + +------------------------------------------------------------------- +Wed Jun 13 12:01:21 UTC 2018 - msuchanek@suse.com + +- do not apply nojavah on Leap 42.3 - breaks build +- quiet warnings + + jna-msgsize.patch + + jna-callback.patch + + delete jna-no-werror.patch + +------------------------------------------------------------------- +Tue Jun 12 06:17:20 UTC 2018 - fstrba@suse.com + +- Upstrem version 4.5.1 +- Modified patch: + * jna-4.5.0-nojavah.patch -> jna-4.5.1-nojavah.patch + + Rediff to changed context, rework dependency chain and do not + try to load urls in the no-network build environment +- Added patch: + * jna-no-werror.patch + + Disable -Werror to enable build with two new warnings +- Build with compatibility 1.8 + +------------------------------------------------------------------- +Tue Jan 9 16:30:43 UTC 2018 - fstrba@suse.com + +- Added patch: + * jna-4.5.0-nojavah.patch + + Fix build with jdk10 + + Generate relevant header files during javac run + +------------------------------------------------------------------- +Tue Jan 2 17:57:53 UTC 2018 - fstrba@suse.com + +- Force build with jdk < 10 + +------------------------------------------------------------------- +Mon Oct 30 13:12:41 UTC 2017 - ecsos@opensuse.org + +- change version and name from jna-4.1.0.pom to jna-4.5.0.pom +- fix require libjnidispatch-version in jna-package + +------------------------------------------------------------------- +Tue Sep 19 14:53:38 UTC 2017 - fstrba@suse.com + +- Upstream version 4.5.0 +- Removed patch: + * reproducible.patch + + integrated upstream +- Added patch: + * jna-getpeer.patch + + upstream workaround to the inaccessibility of the getPeer + method + + Fix build with jdk9 +- Modified patch: + * jna-build.patch + + rediff to the new context + +------------------------------------------------------------------- +Tue Sep 19 12:19:45 UTC 2017 - fstrba@suse.com + +- Build with source and target levels 1.6 +- Force building with java-devel < 1.9, since the code uses APIs + removed in jdk9 + +------------------------------------------------------------------- +Fri May 19 11:48:29 UTC 2017 - dziolkowski@suse.com + +- New build dependency: javapackages-local +- drop conditionals for unsupported SUSE versions + +------------------------------------------------------------------- +Fri Feb 24 21:03:28 UTC 2017 - msuchanek@suse.com + +- Upstream version 4.2.2 + * adds some symbols needed by Arduino IDE. + +------------------------------------------------------------------- +Fri Mar 18 15:07:15 UTC 2016 - bwiedemann@suse.com + +- Add reproducible.patch to fix build-compare + +------------------------------------------------------------------- +Sun Nov 8 23:31:55 UTC 2015 - p.drouand@gmail.com + +- Update to version 4.2.1 + * Add support for linux-sparcv9. + * Added `GetCommState`, `GetCommTimeouts` `SetCommState` and `SetCommTimeouts` + to `com.sun.jna.platform.win32.Kernel32`. Added `DCB` structure to + `com.sun.jna.platform.win32.WinBase. + * Make loading debug flags mutable. + * Added `host_processor_info` to `com.sun.jna.platform.mac.SystemB`. + * Added JNA functional overview. + * Update linux-arm natives omitted in 4.2. +- Update jna-4.1.0-build.patch > jna-build.patch + +------------------------------------------------------------------- +Wed Mar 18 09:46:16 UTC 2015 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Mon Nov 3 16:20:03 UTC 2014 - cbosdonnat@suse.com + +- Updated to 4.1.0. See the changelog on: + https://github.com/twall/jna/blob/master/CHANGES.md + +- Updated jna-3.4.0-build.patch into jna-4.1.0-build.patch + +- Added libjnidispatch.rpmlintrc to silence warning about explicit + library dependency between jna and libjnidistach: rpm doesn't + detect library dependencies on Java packages, we need to force it. + +- Removed libffi patches: now using the libffi package. + * libffi-aarch64.patch + * libffi-ppc64le.patch + +- Added rpmlint filters: + * libjnidispatch-rpmlintrc + +------------------------------------------------------------------- +Tue Jul 8 10:50:16 UTC 2014 - tchvatal@suse.com + +- Do not depend on ant-trax and run spec-cleaner. + +------------------------------------------------------------------- +Mon Dec 9 21:23:45 UTC 2013 - dvaleev@suse.com + +- enable ppc64le + +- added patches: + * libffi-ppc64le.patch +------------------------------------------------------------------- +Wed Sep 11 10:21:12 UTC 2013 - mvyskocil@suse.com + +- use add_maven_depmap from javapackages-tools + +------------------------------------------------------------------- +Mon Sep 9 11:06:11 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Thu Apr 11 15:11:35 UTC 2013 - schwab@suse.de + +- libffi-aarch64.patch: import aarch64 support for libffi + +------------------------------------------------------------------- +Wed Dec 12 18:15:53 UTC 2012 - dvaleev@suse.com + +- enable ppc and ppc64 builds + +------------------------------------------------------------------- +Wed Nov 14 13:10:40 UTC 2012 - mvyskocil@suse.com + +- fix a build for non-suse distros + +------------------------------------------------------------------- +Tue Jun 19 09:19:04 UTC 2012 - mvyskocil@suse.cz + +- fix a build with jdk7 +- rename to libjnidispatch to follow packaging policy (provides jna-native) +- jna and jna-javadoc are now noarch subpackages of it +- don't strip a binary during a build + +------------------------------------------------------------------- +Thu Feb 9 13:53:29 UTC 2012 - mvyskocil@suse.cz + +- Update to 3.4.0 + * moved object creation out into pure Java code reduce JNI crossing + * add native peer value accessors for Pointer + * avoid loading any system-provided JNA via jna.nosys=true + * override default jnidispatch library name with jna.boot.library + * throw an error if JNA is not with a library + * linux/arm and linux/ppc 32-bit support + * preliminary linux/ppc64 support + * linux multi-arch support (kohsuke). + * add to `platform.unix.x11`: `XGrabKey`, `XUngrabKey`, `XSetErrorHandler`. + * and a lot of bugfixes (see /usr/share/packages/doc/jna/README.md) +- fix bnc#745571 enable build of jna-native as well + +------------------------------------------------------------------- +Thu Apr 8 06:44:52 UTC 2010 - mvyskocil@suse.cz + +- update to 3.1.0 (jna-3.1.0-2.jpp6.src.rpm) + * raw JNI mapping of static Java methods increased performance + * library option to allow passing/return of Java Objects. + * handling of uncaught callback exceptions (Issue 63). + * object oriented interface to X server (see contrib/x11) + * Memory class more accessible. + * allow implicit library access to current process on linux (issue 98). + * open all shared libraries with RTLD_GLOBAL, if applicable. This was the default behavior on OSX and changes the default behavior on linux. + * allow NIO Buffer as Structure field (with limitations) (Issue 57) + * add size_t size. + * Bug Fixes + +------------------------------------------------------------------- +Mon Jun 1 09:32:27 CEST 2009 - mvyskocil@suse.cz + +- fixed bnc#507734: jna declared LGPL but contains GPL files and binaries + * removed all jars from source archive + * added gpl to docdir + +------------------------------------------------------------------- +Tue May 19 12:22:46 CEST 2009 - mvyskocil@suse.cz + +- 'Initial SUSE packaging from jpackage.org 5.0' + diff --git a/jna.spec b/jna.spec new file mode 100644 index 0000000..a592916 --- /dev/null +++ b/jna.spec @@ -0,0 +1,151 @@ +# +# spec file for package jna +# +# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2000-2009, JPackage Project +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: jna +Version: 5.13.0 +Release: 0 +Summary: Pure Java access to native libraries +License: Apache-2.0 OR LGPL-2.1-or-later +Group: Development/Libraries/Java +URL: https://github.com/twall/jna +Source0: https://github.com/twall/%{name}/archive/%{version}.tar.gz +Source1000: %{name}-rpmlintrc +Patch0: jna-build.patch +Patch1: jna-callback.patch +Patch2: jna-system-libjnidispatch.patch +Patch3: jna-java8compat.patch +Patch4: jna-old-libffi.patch +BuildRequires: ant +BuildRequires: dos2unix +BuildRequires: fdupes +BuildRequires: java-devel >= 9 +BuildRequires: javapackages-local +BuildRequires: libX11-devel +BuildRequires: libXt-devel +BuildRequires: libffi-devel +BuildRequires: objectweb-asm +BuildRequires: pkg-config +Requires: java >= 1.8 +Provides: jna-native = %{version}-%{release} +Obsoletes: jna-native < %{version}-%{release} +Provides: libjnidispatch = %{version}-%{release} +Obsoletes: libjnidispatch < %{version}-%{release} + +%description +JNA provides Java programs easy access to native shared libraries +(DLLs on Windows) without writing anything but Java code. JNA's +design aims to provide native access in a natural way with a +minimum of effort. No boilerplate or generated code is required. +While some attention is paid to performance, correctness and ease +of use take priority. + +%package contrib +Summary: Contrib for %{name} +Group: Development/Libraries/Java +Requires: %{name} = %{version}-%{release} +Provides: jna-platform = %{version}-%{release} +Obsoletes: jna-platform < %{version}-%{release} +BuildArch: noarch + +%description contrib +This package contains the contributed examples for %{name}. + +%package javadoc +Summary: Javadocs for %{name} +Group: Documentation/HTML +BuildArch: noarch + +%description javadoc +This package contains the javadocs for %{name}. + +%prep +%setup -q +# Cleanup the dist tarball +find . -name '*jar' | xargs rm +rm -rf dist +dos2unix OTHERS +# Then apply patches +%patch0 -p1 -b .orig +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +%if 0%{?suse_version} < 1550 +%patch4 -p1 +%endif + +sed -i 's|@LIBDIR@|%{_libdir}/%{name}|' src/com/sun/jna/Native.java + +%build +build-jar-repository -s -p lib ant +ln -s $(find-jar objectweb-asm/asm) lib/asm-8.0.1.jar +%{ant} \ + jar \ + native \ + platform-jar \ + -Dcflags_extra.native="%{optflags}" \ + -Dbuild-native=true -Drelease \ + -Dcompatibility=1.8 -Dplatform.compatibility=1.8 \ + -Ddynlink.native=true \ + jar \ + native \ + platform-jar \ + javadoc + +%install +# NOTE: JNA has highly custom code to look for native jars in this +# directory. Since this roughly matches the jpackage guidelines, +# we'll leave it unchanged. +install -d -m 755 %{buildroot}%{_libdir}/%{name} +install -m 755 build/native*/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/ + +install -d -m 755 %{buildroot}%{_jnidir}/%{name} +install -d -m 755 %{buildroot}%{_javadir}/%{name} +install -p -m 644 build/jna-jpms.jar %{buildroot}%{_jnidir}/%{name}.jar +ln -sf ../%{name}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar +ln -sf %{_jnidir}/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar +install -p -m 644 ./contrib/platform/dist/jna-platform-jpms.jar %{buildroot}%{_javadir}/%{name}-platform.jar +ln -sf ../%{name}-platform.jar %{buildroot}%{_javadir}/%{name}/%{name}-platform.jar + +install -d -m 755 %{buildroot}%{_mavenpomdir} +install -p -m 644 build/pom-jna.xml %{buildroot}/%{_mavenpomdir}/%{name}.pom +install -p -m 644 build/pom-jna-platform.xml %{buildroot}/%{_mavenpomdir}/%{name}-platform.pom +%add_maven_depmap %{name}.pom %{name}.jar -a net.java.dev.jna:jna-jpms +%add_maven_depmap %{name}-platform.pom %{name}-platform.jar -a net.java.dev.jna:platform,net.java.dev.jna:jna-platform-jpms -f contrib + +install -d -m 755 %{buildroot}%{_javadocdir}/%{name} +cp -pr doc/javadoc/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/libjnidispatch.so +%{_jnidir}/%{name} +%{_javadir}/%{name}.jar +%license LICENSE +%doc CHANGES.md OTHERS README.md TODO + +%files contrib -f .mfiles-contrib +%{_javadir}/%{name} + +%files javadoc +%{_javadocdir}/jna +%license LICENSE + +%changelog