2019-10-10 20:42:10 +02:00
|
|
|
#
|
|
|
|
# spec file for package jna
|
|
|
|
#
|
2024-01-23 16:34:21 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-10-10 20:42:10 +02:00
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-04-29 14:36:05 +02:00
|
|
|
# The automatic requires would be java-headless >= 9, but the
|
|
|
|
# binaries are java 8 compatible
|
|
|
|
%define __requires_exclude java-headless
|
2019-10-10 20:42:10 +02:00
|
|
|
Name: jna
|
2023-06-03 22:22:12 +02:00
|
|
|
Version: 5.13.0
|
2019-10-10 20:42:10 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Pure Java access to native libraries
|
2022-03-19 22:55:55 +01:00
|
|
|
License: Apache-2.0 OR LGPL-2.1-or-later
|
2023-06-03 22:54:29 +02:00
|
|
|
Group: Development/Libraries/Java
|
2019-10-10 20:42:10 +02:00
|
|
|
URL: https://github.com/twall/jna
|
2024-02-21 14:37:10 +01:00
|
|
|
Source0: %{name}-%{version}.tar.xz
|
2019-10-10 21:03:54 +02:00
|
|
|
Source1000: %{name}-rpmlintrc
|
2019-10-10 20:42:10 +02:00
|
|
|
Patch0: jna-build.patch
|
2019-10-10 20:44:38 +02:00
|
|
|
Patch1: jna-callback.patch
|
|
|
|
Patch2: jna-system-libjnidispatch.patch
|
2019-10-10 21:51:52 +02:00
|
|
|
Patch3: jna-java8compat.patch
|
2023-06-03 22:54:29 +02:00
|
|
|
Patch4: jna-old-libffi.patch
|
2019-10-10 20:42:10 +02:00
|
|
|
BuildRequires: ant
|
|
|
|
BuildRequires: dos2unix
|
|
|
|
BuildRequires: fdupes
|
2023-06-03 22:22:12 +02:00
|
|
|
BuildRequires: java-devel >= 9
|
2024-02-21 14:37:10 +01:00
|
|
|
BuildRequires: javapackages-local >= 6
|
2023-05-31 07:06:39 +02:00
|
|
|
BuildRequires: libX11-devel
|
|
|
|
BuildRequires: libXt-devel
|
2019-10-10 20:42:10 +02:00
|
|
|
BuildRequires: libffi-devel
|
2023-06-03 22:22:12 +02:00
|
|
|
BuildRequires: objectweb-asm
|
2024-02-21 14:37:10 +01:00
|
|
|
BuildRequires: pkgconfig
|
2024-04-29 14:36:05 +02:00
|
|
|
Requires: java-headless >= 1.8
|
2019-10-10 20:42:10 +02:00
|
|
|
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}
|
2023-06-03 22:54:29 +02:00
|
|
|
Group: Development/Libraries/Java
|
2019-10-10 20:42:10 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2024-04-29 14:36:05 +02:00
|
|
|
Requires: java-headless >= 1.8
|
2023-06-11 15:30:39 +02:00
|
|
|
Provides: jna-platform = %{version}-%{release}
|
|
|
|
Obsoletes: jna-platform < %{version}-%{release}
|
2019-10-10 20:42:10 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description contrib
|
|
|
|
This package contains the contributed examples for %{name}.
|
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: Javadocs for %{name}
|
2023-06-03 22:54:29 +02:00
|
|
|
Group: Documentation/HTML
|
2019-10-10 20:42:10 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
This package contains the javadocs for %{name}.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2024-02-21 14:37:10 +01:00
|
|
|
|
|
|
|
%patch -P 0 -p1 -b .orig
|
|
|
|
%patch -P 1 -p1
|
|
|
|
%patch -P 2 -p1
|
|
|
|
%patch -P 3 -p1
|
2023-06-03 23:51:09 +02:00
|
|
|
|
|
|
|
%if 0%{?suse_version} < 1550
|
2024-02-21 14:37:10 +01:00
|
|
|
%patch -P 4 -p1
|
2023-06-03 22:54:29 +02:00
|
|
|
%endif
|
2019-10-10 20:42:10 +02:00
|
|
|
|
|
|
|
sed -i 's|@LIBDIR@|%{_libdir}/%{name}|' src/com/sun/jna/Native.java
|
|
|
|
|
|
|
|
%build
|
|
|
|
build-jar-repository -s -p lib ant
|
2023-06-03 22:22:12 +02:00
|
|
|
ln -s $(find-jar objectweb-asm/asm) lib/asm-8.0.1.jar
|
2023-05-31 07:08:17 +02:00
|
|
|
%{ant} \
|
2019-10-10 20:42:10 +02:00
|
|
|
jar \
|
|
|
|
native \
|
|
|
|
platform-jar \
|
|
|
|
-Dcflags_extra.native="%{optflags}" \
|
|
|
|
-Dbuild-native=true -Drelease \
|
2022-03-19 22:55:55 +01:00
|
|
|
-Dcompatibility=1.8 -Dplatform.compatibility=1.8 \
|
2019-10-10 20:42:10 +02:00
|
|
|
-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}
|
2023-06-03 22:22:12 +02:00
|
|
|
install -p -m 644 build/jna-jpms.jar %{buildroot}%{_jnidir}/%{name}.jar
|
2019-10-10 20:42:10 +02:00
|
|
|
ln -sf ../%{name}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar
|
|
|
|
ln -sf %{_jnidir}/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar
|
2023-06-03 22:22:12 +02:00
|
|
|
install -p -m 644 ./contrib/platform/dist/jna-platform-jpms.jar %{buildroot}%{_javadir}/%{name}-platform.jar
|
2019-10-10 20:42:10 +02:00
|
|
|
ln -sf ../%{name}-platform.jar %{buildroot}%{_javadir}/%{name}/%{name}-platform.jar
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_mavenpomdir}
|
2024-02-21 14:37:10 +01:00
|
|
|
%{mvn_install_pom} build/pom-jna.xml %{buildroot}/%{_mavenpomdir}/%{name}.pom
|
2023-06-03 22:22:12 +02:00
|
|
|
%add_maven_depmap %{name}.pom %{name}.jar -a net.java.dev.jna:jna-jpms
|
2024-02-21 14:37:10 +01:00
|
|
|
%{mvn_install_pom} build/pom-jna-platform.xml %{buildroot}/%{_mavenpomdir}/%{name}-platform.pom
|
2023-06-03 22:22:12 +02:00
|
|
|
%add_maven_depmap %{name}-platform.pom %{name}-platform.jar -a net.java.dev.jna:platform,net.java.dev.jna:jna-platform-jpms -f contrib
|
2019-10-10 20:42:10 +02:00
|
|
|
|
|
|
|
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
|