Update to upstream version 4.3.0

This commit is contained in:
Michael Simacek 2017-01-16 16:01:47 +01:00
parent 83c54cb023
commit 204ab98f9b
8 changed files with 83 additions and 117 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ jna-3.2.7.tar.bz2
/jna-4.2.0-clean.tar.xz
/jna-4.2.1-clean.tar.xz
/jna-4.2.2-clean.tar.xz
/jna-4.3.0-clean.tar.xz

View File

@ -1,7 +1,17 @@
diff -up ./native/Makefile.build ./native/Makefile
--- ./native/Makefile.build 2012-10-19 03:53:11.000000000 +0200
+++ ./native/Makefile 2012-10-26 11:25:19.003999925 +0200
@@ -90,7 +90,7 @@ CDEFINES=-D_REENTRANT
From c38ff2904958eeae70e3d47b7b2363f9f181013b Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 16 Jan 2017 11:29:06 +0100
Subject: [PATCH 1/3] Adapt build
---
native/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/native/Makefile b/native/Makefile
index fb5ac4b..be1b452 100644
--- a/native/Makefile
+++ b/native/Makefile
@@ -107,7 +107,7 @@ CDEFINES=-D_REENTRANT
PCFLAGS=-W -Wall -Wno-unused -Wno-parentheses
CFLAGS=$(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \
-DJNA_JNI_VERSION='"$(JNA_JNI_VERSION)"' -DCHECKSUM='"$(CHECKSUM)"'
@ -10,7 +20,7 @@ diff -up ./native/Makefile.build ./native/Makefile
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)
@@ -344,7 +344,6 @@ $(RSRC): $(BUILD)/jnidispatch.rc
@@ -442,7 +442,6 @@ $(BUILD)/$(JNA_JNI_VERSION).stamp:
$(LIBRARY): $(JNIDISPATCH_OBJS) $(FFI_LIB)
$(LD) $(LDFLAGS) $(JNIDISPATCH_OBJS) $(FFI_LIB) $(LIBS)
@ -18,3 +28,6 @@ diff -up ./native/Makefile.build ./native/Makefile
$(TESTLIB): $(BUILD)/testlib.o
$(LD) $(LDFLAGS) $< $(LIBS)
--
2.9.3

View File

@ -1,7 +1,17 @@
diff -up jna-4.2.0/src/com/sun/jna/Native.java.loadlib jna-4.2.0/src/com/sun/jna/Native.java
--- jna-4.2.0/src/com/sun/jna/Native.java.loadlib 2015-09-15 00:31:20.000000000 +0200
+++ jna-4.2.0/src/com/sun/jna/Native.java 2015-09-15 14:25:23.631580142 +0200
@@ -732,102 +732,12 @@ public final class Native implements Ver
From 3f48354a76a0d24fb21e9132482d9ff7af6df8b4 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 16 Jan 2017 11:31:32 +0100
Subject: [PATCH 2/3] Load system library
---
src/com/sun/jna/Native.java | 97 ++-------------------------------------------
1 file changed, 4 insertions(+), 93 deletions(-)
diff --git a/src/com/sun/jna/Native.java b/src/com/sun/jna/Native.java
index f51a152..b3ddbc3 100644
--- a/src/com/sun/jna/Native.java
+++ b/src/com/sun/jna/Native.java
@@ -788,101 +788,12 @@ public final class Native implements Version {
/**
* Loads the JNA stub library.
@ -11,7 +21,6 @@ diff -up jna-4.2.0/src/com/sun/jna/Native.java.loadlib jna-4.2.0/src/com/sun/jna
+ * unnecessary when JNA is properly installed with the OS.
*/
private static void loadNativeDispatchLibrary() {
-
- if (!Boolean.getBoolean("jna.nounpack")) {
- try {
- removeTemporaryFiles();
@ -103,8 +112,11 @@ diff -up jna-4.2.0/src/com/sun/jna/Native.java.loadlib jna-4.2.0/src/com/sun/jna
- else {
- throw new UnsatisfiedLinkError("Unable to locate JNA native support library");
- }
+ jnidispatchPath = "@LIBDIR@/" + System.mapLibraryName("jnidispatch");
+ System.load(jnidispatchPath);
+ jnidispatchPath = "@LIBDIR@/" + System.mapLibraryName("jnidispatch");
+ System.load(jnidispatchPath);
}
static final String JNA_TMPLIB_PREFIX = "jna";
--
2.9.3

24
0003-Tests-headless.patch Normal file
View File

@ -0,0 +1,24 @@
From 4a4aae7689b217a0057608667eb03d2eea3f3eba Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 16 Jan 2017 11:32:32 +0100
Subject: [PATCH 3/3] Tests headless
---
build.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/build.xml b/build.xml
index 09aeac2..d9be501 100644
--- a/build.xml
+++ b/build.xml
@@ -1008,6 +1008,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
<sysproperty key="jna.builddir" file="${build}"/>
<sysproperty key="jna.nativedir" file="${build.native}"/>
<jvmarg value="${vmopt.arch}"/>
+ <jvmarg value="-Djava.awt.headless=true"/>
<classpath><path refid="test.runpath"/></classpath>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
--
2.9.3

View File

@ -1,28 +0,0 @@
#!/bin/bash
set -e
version=`grep Version: *spec | sed -e 's/Version:\s*\(.*\)/\1/'`
wget https://github.com/java-native-access/jna/archive/${version}.tar.gz -O jna-${version}.tar.gz
rm -rf jna-${version}
tar xf jna-${version}.tar.gz
#mv twall-jna-* jna-${version}
# remove bundled things with unknown licensing
rm -rvf jna-${version}/{dist/*,www,native/libffi}
# jars in lib/native subdir need to be present in tarball so
# that final jar can be built. They can be empty and then have no
# effect on resulting jar. One jar (depending on architecture) will
# be replaced with full content (containing libjnidispatch.so)
for njar in jna-${version}/lib/native/*.jar; do
rm -v $njar
touch empty
jar cf $njar empty
rm -f empty
done
find jna-${version} -iname '*jar' ! -iname 'reflections*.jar' -size +1b -delete
find jna-${version} -name '*.class' -delete
tar cf jna-${version}-clean.tar jna-${version}
xz -9 jna-${version}-clean.tar

View File

@ -1,11 +0,0 @@
diff -up ./build.xml.tests-headless ./build.xml
--- ./build.xml.tests-headless 2013-07-04 20:42:30.000000000 +0200
+++ ./build.xml 2013-07-05 15:06:19.354441386 +0200
@@ -885,6 +885,7 @@ osname=macosx;processor=x86;processor=x8
<sysproperty key="jna.builddir" file="${build}"/>
<sysproperty key="jna.nativedir" file="${build.native}"/>
<jvmarg value="${vmopt.arch}"/>
+ <jvmarg value="-Djava.awt.headless=true"/>
<classpath><path refid="test.runpath"/></classpath>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>

View File

@ -1,5 +1,5 @@
Name: jna
Version: 4.2.2
Version: 4.3.0
Release: 1%{?dist}
Summary: Pure Java access to native libraries
# Most of code is dual-licensed under either LGPL 2.1 only or Apache
@ -10,35 +10,29 @@ URL: https://github.com/java-native-access/jna/
# ./generate-tarball.sh
Source0: %{name}-%{version}-clean.tar.xz
Source1: package-list
%if 0%{?fedora}
Source2: generate-tarball.sh
%else
Source2: generate-tarball-rhel.sh
%endif
Patch0: jna-3.5.0-build.patch
Patch0: 0001-Adapt-build.patch
# This patch is Fedora-specific for now until we get the huge
# JNI library location mess sorted upstream
Patch1: jna-4.2.0-loadlibrary.patch
Patch1: 0002-Load-system-library.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-4.0.0-tests-headless.patch
Patch2: 0003-Tests-headless.patch
# We manually require libffi because find-requires doesn't work
# inside jars.
Requires: java, jpackage-utils, libffi
BuildRequires: java-devel, jpackage-utils, libffi-devel
BuildRequires: ant, ant-junit, junit
BuildRequires: libX11-devel, libXt-devel
%if 0%{?fedora}
Requires: libffi
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: libffi-devel
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: junit
BuildRequires: libX11-devel
BuildRequires: libXt-devel
BuildRequires: reflections
%endif
# no
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: ant-nodeps, ant-trax
%endif
%description
JNA provides Java programs easy access to native shared libraries
@ -48,27 +42,18 @@ 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 javadoc
Summary: Javadocs for %{name}
Group: Documentation
%if 0%{?fedora} || 0%{?rhel} > 5
BuildArch: noarch
%endif
%description javadoc
This package contains the javadocs for %{name}.
%package contrib
Summary: Contrib for %{name}
License: LGPLv2 or ASL 2.0
Requires: %{name} = %{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} > 5
BuildArch: noarch
%endif
%description contrib
This package contains the contributed examples for %{name}.
@ -89,13 +74,8 @@ sed -i 's/\r//' LICENSE
chmod -c 0644 LICENSE OTHERS CHANGES.md
%if 0%{?rhel}
sed s,'<include name="junit.jar"/>,&<include name="reflections-0.9.8.jar"/>,' -i build.xml
build-jar-repository -s -p lib junit
%else
sed s,'<include name="junit.jar"/>,&<include name="reflections.jar"/>,' -i build.xml
build-jar-repository -s -p lib junit reflections
%endif
cp lib/native/aix-ppc64.jar lib/clover.jar
@ -119,7 +99,6 @@ find contrib -name '*.jar' -exec cp {} %{buildroot}%{_javadir}/%{name}/ \;
install -d -m 755 %{buildroot}%{_libdir}/%{name}
install -m 755 build/native*/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
%if 0%{?fedora}
# install maven pom file
install -Dm 644 pom-%{name}.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
install -Dm 644 pom-%{name}-platform.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-platform.pom
@ -127,54 +106,30 @@ install -Dm 644 pom-%{name}-platform.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}
# ... and maven depmap
%add_maven_depmap JPP-%{name}.pom %{name}.jar
%add_maven_depmap JPP.%{name}-%{name}-platform.pom -f platform %{name}/%{name}-platform.jar -a "net.java.dev.jna:platform"
%endif
# javadocs
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
#if 0%{?rhel} >= 6 || 0%{?fedora}
#ifnarch ppc s390 s390x
#check
#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true test
#endif
#endif
%if 0%{?fedora}
%files -f .mfiles
%else
%files
%{_javadir}/%{name}.jar
%endif
%doc OTHERS README.md CHANGES.md TODO
%if 0%{?fedora}
%license LICENSE LGPL2.1 ASL2.0
%else
%doc LICENSE LGPL2.1 ASL2.0
%endif
%license LICENSE LGPL2.1 AL2.0
%{_libdir}/%{name}
%files javadoc
%if 0%{?fedora}
%license LICENSE LGPL2.1 ASL2.0
%else
%doc LICENSE LGPL2.1 ASL2.0
%endif
%license LICENSE LGPL2.1 AL2.0
%{_javadocdir}/%{name}
%if 0%{?fedora}
%files contrib -f .mfiles-platform
%else
%files contrib
%endif
%{_javadir}/%{name}
%changelog
* Mon Jan 16 2017 Michael Simacek <msimacek@redhat.com> - 4.3.0-1
- Update to upstream version 4.3.0
- Cleanup rhel macros, because packages was retired in EPEL
* Thu Mar 24 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.2-1
- Update to upstream version 4.2.2

View File

@ -1 +1 @@
8693dcf043cd54fbfa77ea07cd19eaee jna-4.2.2-clean.tar.xz
SHA512 (jna-4.3.0-clean.tar.xz) = 693d4056e98c40dbcf5af2ef170bcbc5127ef27b55cb96319ed81db3d2b65865a3c75f1f6da3b47ed6e44b17a092a6fc9a1ce68b81340c1f61409eeed38c4655