Hello community,

here is the log from the commit of package native-platform for 
openSUSE:Leap:15.2 checked in at 2020-02-05 07:28:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/native-platform (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.native-platform.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "native-platform"

Wed Feb  5 07:28:03 2020 rev:1 rq:763277 version:0.14

Changes:
--------
New Changes file:

--- /dev/null   2019-12-19 10:12:34.003146842 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.native-platform.new.26092/native-platform.changes 
    2020-02-05 07:28:04.694712824 +0100
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Tue Nov 12 17:54:26 UTC 2019 - Fridrich Strba <fst...@suse.com>
+
+- Initial packaging of native-platform 0.14

New:
----
  0.14.tar.gz
  0001-Load-lib-from-system.patch
  0002-Use-library-name-without-arch.patch
  native-platform-0.7-Makefile
  native-platform.changes
  native-platform.spec

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ native-platform.spec ++++++
#
# spec file for package native-platform
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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:           native-platform
Version:        0.14
Release:        0
Summary:        Java bindings for various native APIs
License:        Apache-2.0
URL:            https://github.com/adammurdoch/native-platform
Source0:        
https://github.com/adammurdoch/native-platform/archive/%{version}.tar.gz
# From Debian
Source4:        %{name}-0.7-Makefile
# Try to load native library from /usr/lib*/native-platform
# instead of extractDir or classpath.
Patch0:         0001-Load-lib-from-system.patch
# Use generate libraries without arch references
# Add support for arm and other x64 arches
Patch1:         0002-Use-library-name-without-arch.patch
BuildRequires:  fdupes
# build tools and deps
BuildRequires:  gcc-c++
BuildRequires:  java-devel >= 1.8
BuildRequires:  javapackages-local
BuildRequires:  jopt-simple
BuildRequires:  ncurses-devel
BuildRequires:  xmvn-install
BuildRequires:  xmvn-resolve

%description
A collection of cross-platform Java APIs
for various native APIs.

These APIs support Java 5 and later. Some
of these APIs overlap with APIs available
in later Java versions.

%package javadoc
Summary:        Javadoc for %{name}
BuildArch:      noarch

%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q -n %{name}-%{version}
find .  -name "*.jar" -delete
find .  -name "*.class" -delete

%patch0 -p1
%patch1 -p1

cp -p %{SOURCE4} Makefile

chmod 644 readme.md
sed -i 's/\r//' readme.md

# TODO
mv src/curses/cpp/*.cpp src/main/cpp
mv src/shared/cpp/* src/main/cpp

%build
CFLAGS="${CFLAGS:-%{optflags}}" ; export CFLAGS ;
CPPFLAGS="${CPPFLAGS:-%{optflags}}" ; export CPPFLAGS ;
CXXFLAGS="${CXXFLAGS:-%{optflags}}" ; export CXXFLAGS ;
make %{?_smp_mflags} JAVA_HOME=%{_jvmdir}/java

%{mvn_artifact} net.rubygrapefruit:%{name}:%{version} build/%{name}.jar
%{mvn_file} : %{name}

%install
%mvn_install -J build/docs/javadoc
%fdupes -s %{buildroot}%{_javadocdir}

mkdir -p %{buildroot}%{_libdir}/%{name}
install -pm 0755 build/binaries/libnative-platform-curses.so 
%{buildroot}%{_libdir}/%{name}/
install -pm 0755 build/binaries/libnative-platform.so 
%{buildroot}%{_libdir}/%{name}/

%files -f .mfiles
%{_libdir}/%{name}
%doc readme.md
%license LICENSE

%files javadoc -f .mfiles-javadoc
%license LICENSE

%changelog
++++++ 0001-Load-lib-from-system.patch ++++++
>From eaa1c5968d3953ea59b01cc2620da0a9eabb17d4 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msima...@redhat.com>
Date: Wed, 20 Sep 2017 16:12:27 +0300
Subject: [PATCH 1/2] Load lib from system

Try to load native library from /usr/lib*/native-platform
instead of extractDir or classpath.
---
 .../platform/internal/NativeLibraryLocator.java               | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git 
a/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java 
b/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java
index d08a40d..332187a 100755
--- 
a/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java
+++ 
b/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java
@@ -32,6 +32,17 @@ public class NativeLibraryLocator {
 
     public File find(LibraryDef libraryDef) throws IOException {
         String resourceName = 
String.format("net/rubygrapefruit/platform/%s/%s", libraryDef.platform, 
libraryDef.name);
+        String bits = "";
+
+        if (System.getProperty("os.arch").contains("64")) {
+            bits = "64";
+        }
+
+        File usrLibFile = new File("/usr/lib" + bits + "/native-platform/" + 
libraryDef.name);
+        if (usrLibFile.isFile()) {
+            return usrLibFile;
+        }
+
         if (extractDir != null) {
             File libFile = new File(extractDir, String.format("%s/%s/%s", 
NativeLibraryFunctions.VERSION, libraryDef.platform, libraryDef.name));
             File lockFile = new File(libFile.getParentFile(), 
libFile.getName() + ".lock");
-- 
2.13.5

++++++ 0002-Use-library-name-without-arch.patch ++++++
>From c022c0a3318dd2d0471440ca73ff35ee75f69169 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msima...@redhat.com>
Date: Wed, 20 Sep 2017 17:51:37 +0300
Subject: [PATCH 2/2] Use library name without arch

---
 .../java/net/rubygrapefruit/platform/internal/Platform.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/main/java/net/rubygrapefruit/platform/internal/Platform.java 
b/src/main/java/net/rubygrapefruit/platform/internal/Platform.java
index 3cb3f63..7120a9f 100755
--- a/src/main/java/net/rubygrapefruit/platform/internal/Platform.java
+++ b/src/main/java/net/rubygrapefruit/platform/internal/Platform.java
@@ -40,11 +40,7 @@ public abstract class Platform {
                         platform = new Window64Bit();
                     }
                 } else if (osName.contains("linux")) {
-                    if (arch.equals("amd64") || arch.equals("x86_64")) {
-                        platform = new Linux64Bit();
-                    } else if (arch.equals("i386") || arch.equals("x86")) {
-                        platform = new Linux32Bit();
-                    }
+                    platform = new Linux();
                 } else if (osName.contains("os x") || 
osName.contains("darwin")) {
                     if (arch.equals("i386")) {
                         platform = new MacOs32Bit();
@@ -240,7 +236,7 @@ public abstract class Platform {
         }
     }
 
-    private abstract static class Linux extends Unix {
+    private static class Linux extends Unix {
         @Override
         public <T extends NativeIntegration> T get(Class<T> type, 
NativeLibraryLoader nativeLibraryLoader) {
             return super.get(type, nativeLibraryLoader);
@@ -255,6 +251,11 @@ public abstract class Platform {
         public boolean isLinux() {
             return true;
         }
+
+        @Override
+        public String getId() {
+            return "linux";
+        }
     }
 
     private static class Linux32Bit extends Linux {
-- 
2.13.5

++++++ native-platform-0.7-Makefile ++++++
#  Description: Use make as buildsystem instead of Gradle to
#  avoid a circular dependencies between gradle and native-platform.
#  This is very minimalistic Makefile so it will only work for
#  Debian use case for now.
#  Author: Damien Raude-Morvan <draz...@debian.org>
#  Adapted for Fedora by: gil cattaneo <punto...@libero.it>
CXX=g++
STRIP=strip
# which is the best solution?
JOPT_JAR=$(shell build-classpath jopt-simple)
#JOPT_JAR=$(shell locate jopt-simple.jar)
IDIR=src/shared/headers
SRCDIR=src/main/cpp
#SRCSHAREDIR=src/shared/cpp
#SRCCURSESDIR=src/curses/cpp
JSRCDIR=src/main/java
BUILD=build
IGEN=$(BUILD)/headers
JCLASSESDIR=$(BUILD)/classes
JDOCDIR=$(BUILD)/docs/javadoc
ODIR=$(BUILD)/binaries
JAR=$(BUILD)/native-platform.jar
known_os_archs := 
JAR_ARCH=$(BUILD)/native-platform-linux.jar

JTARGET=1.6
JSOURCE=1.6

INCLUDE=-I$(IDIR) -I$(IGEN) -I/usr/include -I$(JAVA_HOME)/include 
-I$(JAVA_HOME)/include/linux
LDLIBS=-lncurses

_OBJ_STD = generic.o generic_posix.o linux.o osx.o posix.o win.o unix_strings.o
_OBJ_CURSES = generic.o generic_posix.o curses.o unix_strings.o
OBJ_STD = $(patsubst %,$(ODIR)/%,$(_OBJ_STD))
OBJ_CURSES = $(patsubst %,$(ODIR)/%,$(_OBJ_CURSES))
_JAVA = $(shell find $(JSRCDIR) -name "*.java" -print)

.PHONY: clean jar javadoc

build: $(ODIR)/libnative-platform.so $(ODIR)/libnative-platform-curses.so jar 
javadoc arch-jar

$(ODIR)/libnative-platform.so: $(OBJ_STD)
        $(CXX) -shared -fPIC $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ 
$^
        $(STRIP) $@

$(ODIR)/libnative-platform-curses.so: $(OBJ_CURSES)
        $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) -shared 
-fPIC -o $@ $^ $(LDLIBS)
        $(STRIP) $@

$(JCLASSESDIR)/%.class: javafiles-list
        mkdir -p $(JCLASSESDIR)
        mkdir -p $(IGEN)
        $(JAVA_HOME)/bin/javac -source $(JTARGET) -target $(JSOURCE) -d 
$(JCLASSESDIR) -h $(IGEN) -classpath $(JOPT_JAR) @javafiles-list

javafiles-list: $(_JAVA)
        echo $^ > javafiles-list

javadoc: javafiles-list
        mkdir -p $(JDOCDIR)
        $(JAVA_HOME)/bin/javadoc -d $(JDOCDIR) -classpath $(JOPT_JAR) 
@javafiles-list

jar: $(JCLASSESDIR)/%.class
        mkdir -p $(JDOCDIR)
        (cd $(JCLASSESDIR) ; $(JAVA_HOME)/bin/jar cf ../../$(JAR) .)

arch-jar: $(ODIR)/libnative-platform.so $(ODIR)/libnative-platform-curses.so
        (cd $(ODIR) ; $(JAVA_HOME)/bin/jar cf ../../$(JAR_ARCH) *.so)

$(ODIR)/%.o: $(SRCDIR)/%.cpp $(IGEN)/native.h
        mkdir -p $(ODIR)
        $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(INCLUDE) -fPIC -c 
-o $@ $<

$(IGEN)/native.h: $(JCLASSESDIR)/%.class
        mkdir -p $(IGEN)
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_NativeLibraryFunctions.h\"" > 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_PosixFileFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_PosixFileSystemFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_PosixProcessFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_PosixTerminalFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_TerminfoFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_WindowsConsoleFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_WindowsHandleFunctions.h\"" >> 
$(IGEN)/native.h
        @echo "#include 
\"net_rubygrapefruit_platform_internal_jni_WindowsRegistryFunctions.h\"" >> 
$(IGEN)/native.h

clean:
        -rm javafiles-list
        -rm -Rf $(BUILD)

Reply via email to