From 88d805291524c3107bd4b5da8fa44c0a4b01c6a0d00621d76dc5a46dc463785d Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sun, 29 Sep 2024 06:02:49 +0000 Subject: [PATCH 1/3] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=17 --- .gitattributes | 23 +++++++++ .gitignore | 1 + _service | 19 +++++++ jansi-2.4.0.tar.xz | 3 ++ jansi-build.xml | 126 +++++++++++++++++++++++++++++++++++++++++++++ jansi-jni.patch | 14 +++++ jansi.changes | 49 ++++++++++++++++++ jansi.spec | 121 +++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 356 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 jansi-2.4.0.tar.xz create mode 100644 jansi-build.xml create mode 100644 jansi-jni.patch create mode 100644 jansi.changes create mode 100644 jansi.spec 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/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..150fabf --- /dev/null +++ b/_service @@ -0,0 +1,19 @@ + + + git + https://github.com/fusesource/jansi.git + jansi-2.4.0 + jansi-* + @PARENT_TAG@ + jansi-(.*) + src/main/native/inc_mac + src/main/native/inc_win + src/main/native/inc_linux/* + src/main/resources/org/fusesource/jansi/internal + + + *.tar + xz + + + diff --git a/jansi-2.4.0.tar.xz b/jansi-2.4.0.tar.xz new file mode 100644 index 0000000..ea814f2 --- /dev/null +++ b/jansi-2.4.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2040f5ed3bf00322d01da2c489a0e9e667c3f0e62517a61e712d9fccf391577 +size 63876 diff --git a/jansi-build.xml b/jansi-build.xml new file mode 100644 index 0000000..3d511bd --- /dev/null +++ b/jansi-build.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jansi-jni.patch b/jansi-jni.patch new file mode 100644 index 0000000..c63bba2 --- /dev/null +++ b/jansi-jni.patch @@ -0,0 +1,14 @@ +--- a/src/main/java/org/fusesource/jansi/internal/JansiLoader.java 2020-12-15 03:03:00.000000000 -0700 ++++ b/src/main/java/org/fusesource/jansi/internal/JansiLoader.java 2020-12-15 07:57:30.238720226 -0700 +@@ -295,6 +295,11 @@ public class JansiLoader { + } else { + triedPaths.add(jansiNativeLibraryPath); + } ++ } else { ++ if (loadNativeLibrary(new File("@LIBDIR@/jansi", jansiNativeLibraryName))) { ++ loaded = true; ++ return; ++ } + } + + // Load the os-dependent library from the jar file diff --git a/jansi.changes b/jansi.changes new file mode 100644 index 0000000..b834c44 --- /dev/null +++ b/jansi.changes @@ -0,0 +1,49 @@ +------------------------------------------------------------------- +Wed Apr 26 15:53:32 UTC 2023 - Fridrich Strba + +- Fetch sources using source_service and don't distribute legally + spurious files (bsc#1210877) + +------------------------------------------------------------------- +Mon May 16 11:00:15 UTC 2022 - Fridrich Strba + +- Upgrade the latest upstream release 2.4.0 + * Integrates jansi-native libraries + * Does not depend on jansi-native and hawtjni-runtime +- Make the jansi package archful since it installs a native + library and jni jar +- Added patch: + * jansi-jni.patch + + Give a possibility to load the native libjansi.so from + system + +------------------------------------------------------------------- +Wed Mar 23 23:34:23 UTC 2022 - Fridrich Strba + +- Build with java source and target levels 8 + +------------------------------------------------------------------- +Thu Jun 27 07:34:53 UTC 2019 - Fridrich Strba + +- Remove the reference to jansi-project parent from jansi pom +- Resolve manually jansi-native-version variable so that ivy + understands it + +------------------------------------------------------------------- +Tue Apr 9 15:44:56 UTC 2019 - Fridrich Strba + +- Remove reference to the parent pom since we are not building + using Maven. +- Make tests conditional and switched off by default + +------------------------------------------------------------------- +Thu Feb 7 10:39:14 UTC 2019 - Jan Engelhardt + +- Fix double-shipping of documentation +- Avoid name repetition in summary (potential rpmlint warning + +------------------------------------------------------------------- +Mon Feb 4 12:33:24 UTC 2019 - Fridrich Strba + +- Initial package of jansi 1.17.1 +- Add build.xml file for building with ant diff --git a/jansi.spec b/jansi.spec new file mode 100644 index 0000000..c4e73f6 --- /dev/null +++ b/jansi.spec @@ -0,0 +1,121 @@ +# +# spec file for package jansi +# +# Copyright (c) 2024 SUSE LLC +# +# 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: jansi +Version: 2.4.0 +Release: 0 +Summary: Java library for generating and interpreting ANSI escape sequences +License: Apache-2.0 +Group: Development/Libraries/Java +URL: https://fusesource.github.io/jansi/ +Source0: %{name}-%{version}.tar.xz +Source1: %{name}-build.xml +Patch0: %{name}-jni.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: gcc +BuildRequires: javapackages-local + +%description +Jansi is a java library that allows you to use ANSI escape sequences +in your Java console applications. It implements ANSI support on platforms +which don't support it, like Windows, and provides graceful degradation for +when output is being sent to output devices which cannot support ANSI sequences. + +%package javadoc +Summary: Javadocs for %{name} +Group: Documentation/HTML +BuildArch: noarch + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q +cp %{SOURCE1} build.xml + +%pom_remove_parent + +# We don't need the Fuse JXR skin +%pom_xpath_remove "pom:build/pom:extensions" + +# Plugins not needed for an RPM build +%pom_remove_plugin :maven-gpg-plugin +%pom_remove_plugin :maven-javadoc-plugin +%pom_remove_plugin :nexus-staging-maven-plugin + +# We don't want GraalVM support in Fedora +%pom_remove_plugin :exec-maven-plugin +%pom_remove_dep :picocli-codegen + +# Build for JDK 1.8 at a minimum +%pom_xpath_set "//pom:properties/pom:jdkTarget" 1.8 + +# Link the JNI headers +ln -s %{_jvmdir}/java/include/jni.h src/main/native/inc_linux +ln -s %{_jvmdir}/java/include/linux/jni_md.h src/main/native/inc_linux + +# Set the JNI path +sed -i 's,@LIBDIR@,%{_libdir},' \ + src/main/java/org/fusesource/jansi/internal/JansiLoader.java +# Filtering complicated with ant +sed -i 's,\${project.version},%{version},' \ + src/main/resources/org/fusesource/jansi/jansi.properties + +%build +# Build the native artifact +CFLAGS="$CFLAGS -I. -fPIC -fvisibility=hidden" +pushd src/main/native +%__cc $CFLAGS -c jansi.c +%__cc $CFLAGS -c jansi_isatty.c +%__cc $CFLAGS -c jansi_structs.c +%__cc $CFLAGS -c jansi_ttyname.c +%__cc $CFLAGS $LDFLAGS -shared -o libjansi.so *.o -lutil +popd + +# Build the Java artifacts +%{ant} jar javadoc + +%install +# Install the native artifact +install -dm 0755 %{buildroot}%{_libdir}/%{name} +install -pm 0755 src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} + +# jar +install -dm 0755 %{buildroot}%{_jnidir}/%{name} +install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom +%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar +# javadoc +%fdupes -s %{buildroot}%{_javadocdir} +# javadoc +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%license license.txt +%doc readme.md changelog.md +%{_libdir}/%{name} + +%files javadoc +%{_javadocdir}/%{name} + +%changelog From bb0eff8c29ecac09945c1be552a82521cc7d347659b9c6f0ee464c050e4b1683 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sun, 29 Sep 2024 19:48:42 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=18 --- jansi.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jansi.changes b/jansi.changes index b834c44..73537ed 100644 --- a/jansi.changes +++ b/jansi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Sep 29 19:48:37 UTC 2024 - Fridrich Strba + +- Fix build after removal of the default %%{java_home} define + ------------------------------------------------------------------- Wed Apr 26 15:53:32 UTC 2023 - Fridrich Strba From 05512717928509f890cbc68a82a7887cdec55c9ea1dfa1824d3ac1cbb101bf8c Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sun, 29 Sep 2024 20:48:28 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=19 --- jansi.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jansi.spec b/jansi.spec index c4e73f6..3c9fe37 100644 --- a/jansi.spec +++ b/jansi.spec @@ -29,7 +29,7 @@ Patch0: %{name}-jni.patch BuildRequires: ant BuildRequires: fdupes BuildRequires: gcc -BuildRequires: javapackages-local +BuildRequires: javapackages-local >= 6 %description Jansi is a java library that allows you to use ANSI escape sequences @@ -81,11 +81,11 @@ sed -i 's,\${project.version},%{version},' \ # Build the native artifact CFLAGS="$CFLAGS -I. -fPIC -fvisibility=hidden" pushd src/main/native -%__cc $CFLAGS -c jansi.c -%__cc $CFLAGS -c jansi_isatty.c -%__cc $CFLAGS -c jansi_structs.c -%__cc $CFLAGS -c jansi_ttyname.c -%__cc $CFLAGS $LDFLAGS -shared -o libjansi.so *.o -lutil +gcc $CFLAGS -c jansi.c +gcc $CFLAGS -c jansi_isatty.c +gcc $CFLAGS -c jansi_structs.c +gcc $CFLAGS -c jansi_ttyname.c +gcc $CFLAGS $LDFLAGS -shared -o libjansi.so *.o -lutil popd # Build the Java artifacts @@ -101,7 +101,7 @@ install -dm 0755 %{buildroot}%{_jnidir}/%{name} install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar # pom install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} -install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom +%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom %add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar # javadoc %fdupes -s %{buildroot}%{_javadocdir}