From 524cc2657b6fb604385eec31263df2f2d1234664 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: May 17 2021 07:32:24 +0000 Subject: [PATCH 1/8] Implement bootstrap mode --- diff --git a/jansi.spec b/jansi.spec index cdc9647..f6f9831 100644 --- a/jansi.spec +++ b/jansi.spec @@ -1,3 +1,5 @@ +%bcond_with bootstrap + Name: jansi Version: 2.1.1 Release: 3%{?dist} @@ -11,11 +13,15 @@ Patch0: %{name}-jni.patch BuildRequires: gcc BuildRequires: maven-local +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) BuildRequires: mvn(org.apache.maven.surefire:surefire-junit-platform) BuildRequires: mvn(org.fusesource:fusesource-pom:pom:) BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine) +%endif %description Jansi is a small java library that allows you to use ANSI escape sequences From abfd11413a19a7ad05ee89ea12fc75b4cb087b2c Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: May 17 2021 13:49:50 +0000 Subject: [PATCH 2/8] Bootstrap build --- diff --git a/jansi.spec b/jansi.spec index f6f9831..80dfea3 100644 --- a/jansi.spec +++ b/jansi.spec @@ -1,8 +1,8 @@ -%bcond_with bootstrap +%bcond_without bootstrap Name: jansi Version: 2.1.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Generate and interpret ANSI escape sequences in Java License: ASL 2.0 @@ -98,6 +98,9 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %license license.txt %changelog +* Mon May 17 2021 Mikolaj Izdebski - 2.1.1-4 +- Bootstrap build + * Tue Jan 26 2021 Fedora Release Engineering - 2.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 3a3016f5823c3efa0296107616ab9be62aa7e0c7 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: May 17 2021 16:01:43 +0000 Subject: [PATCH 3/8] Non-bootstrap build --- diff --git a/jansi.spec b/jansi.spec index 80dfea3..8d1ebd8 100644 --- a/jansi.spec +++ b/jansi.spec @@ -1,4 +1,4 @@ -%bcond_without bootstrap +%bcond_with bootstrap Name: jansi Version: 2.1.1 @@ -100,6 +100,7 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %changelog * Mon May 17 2021 Mikolaj Izdebski - 2.1.1-4 - Bootstrap build +- Non-bootstrap build * Tue Jan 26 2021 Fedora Release Engineering - 2.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 3923fa75788679ded7eb8ad65e19bb1a83109470 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Jun 18 2021 15:36:01 +0000 Subject: [PATCH 4/8] Clean tarball from content with questionable licensing Resolves: rhbz#1973738 --- diff --git a/generate-tarball.sh b/generate-tarball.sh new file mode 100755 index 0000000..0d2f36c --- /dev/null +++ b/generate-tarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +name=jansi +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "https://github.com/fusesource/jansi/archive/jansi-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +pushd tarball-tmp +tar xf "../${name}-${version}.orig.tar.gz" + +# CLEAN TARBALL +rm -r */src/main/native/inc_{mac,win}/ + +tar -czf "../${name}-${version}.tar.gz" * +popd +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/jansi.spec b/jansi.spec index 8d1ebd8..199c296 100644 --- a/jansi.spec +++ b/jansi.spec @@ -2,12 +2,16 @@ Name: jansi Version: 2.1.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Generate and interpret ANSI escape sequences in Java - License: ASL 2.0 URL: http://fusesource.github.io/jansi/ -Source0: https://github.com/fusesource/jansi/archive/jansi-%{version}.tar.gz + +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +# Remove bundled binaries which cannot be easily verified for licensing +Source1: generate-tarball.sh + # Change the location of the native artifact to where Fedora wants it Patch0: %{name}-jni.patch @@ -98,6 +102,10 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %license license.txt %changelog +* Fri Jun 18 2021 Mikolaj Izdebski - 2.1.1-5 +- Clean tarball from content with questionable licensing +- Resolves: rhbz#1973738 + * Mon May 17 2021 Mikolaj Izdebski - 2.1.1-4 - Bootstrap build - Non-bootstrap build diff --git a/sources b/sources index 8f107e7..a2c0656 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (jansi-2.1.1.tar.gz) = ccdb7b13da6715398b0b1d53bb1272ac445774dea7f643882c7df0182e17350b41dd1c782161f5350028209c82ac3588c22ceaaacd4930ec78645230b335bc4a +SHA512 (jansi-2.1.1.tar.gz) = 532b6c959e38fa8a1c3563dcafd78fd6634f96b85976b5c0e32808481e5f73c2323a89ace55e13da0f77ab45678d1e844e967dd0ceac19efb0c587af3257b4da From 179e740a136c957102e2210e987b191673333de0 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jun 23 2021 16:02:07 +0000 Subject: [PATCH 5/8] Version 2.3.3 --- diff --git a/.gitignore b/.gitignore index 2aebb9a..565aadf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /jansi-project-1.17.1.tar.gz /jansi-project-1.18.tar.gz /jansi-2.1.1.tar.gz +/jansi-2.3.3.tar.gz diff --git a/jansi.spec b/jansi.spec index 199c296..123fc52 100644 --- a/jansi.spec +++ b/jansi.spec @@ -1,8 +1,8 @@ %bcond_with bootstrap Name: jansi -Version: 2.1.1 -Release: 5%{?dist} +Version: 2.3.3 +Release: 1%{?dist} Summary: Generate and interpret ANSI escape sequences in Java License: ASL 2.0 URL: http://fusesource.github.io/jansi/ @@ -55,8 +55,7 @@ This package contains the API documentation for %{name}. %pom_remove_dep :picocli-codegen # Build for JDK 1.8 at a minimum -%pom_xpath_set "//pom:plugin[pom:artifactId='maven-compiler-plugin']//pom:source" 1.8 -%pom_xpath_set "//pom:plugin[pom:artifactId='maven-compiler-plugin']//pom:target" 1.8 +%pom_xpath_set "//pom:properties/pom:jdkTarget" 1.8 # Remove prebuilt shared objects rm -fr src/main/resources/org/fusesource/jansi/internal @@ -102,6 +101,9 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %license license.txt %changelog +* Wed Jun 23 2021 Jerry James - 2.3.3-1 +- Version 2.3.3 + * Fri Jun 18 2021 Mikolaj Izdebski - 2.1.1-5 - Clean tarball from content with questionable licensing - Resolves: rhbz#1973738 diff --git a/sources b/sources index a2c0656..9b9cffa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (jansi-2.1.1.tar.gz) = 532b6c959e38fa8a1c3563dcafd78fd6634f96b85976b5c0e32808481e5f73c2323a89ace55e13da0f77ab45678d1e844e967dd0ceac19efb0c587af3257b4da +SHA512 (jansi-2.3.3.tar.gz) = 11a27519c05f762f5a6bb076f7f7eb57b6e1df9984df8039a24294cbbf341adc060cb04e66ebcf7d269842bbe599ec0d17be7b3dadeddbabbbd158895aabe8f7 From 380c21a69007e2e5524092d495d980b7febe1ebb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Jul 22 2021 08:55:21 +0000 Subject: [PATCH 6/8] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- diff --git a/jansi.spec b/jansi.spec index 123fc52..d0b55c2 100644 --- a/jansi.spec +++ b/jansi.spec @@ -2,7 +2,7 @@ Name: jansi Version: 2.3.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Generate and interpret ANSI escape sequences in Java License: ASL 2.0 URL: http://fusesource.github.io/jansi/ @@ -101,6 +101,9 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %license license.txt %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 2.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jun 23 2021 Jerry James - 2.3.3-1 - Version 2.3.3 From 0333e5e8056fb9201da86e515650da4a951f55ab Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Sep 24 2021 12:09:45 +0000 Subject: [PATCH 7/8] Install native artifact into a fixed location Related: rhbz#1994935 --- diff --git a/jansi.spec b/jansi.spec index d0b55c2..fb14925 100644 --- a/jansi.spec +++ b/jansi.spec @@ -2,7 +2,7 @@ Name: jansi Version: 2.3.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Generate and interpret ANSI escape sequences in Java License: ASL 2.0 URL: http://fusesource.github.io/jansi/ @@ -66,7 +66,7 @@ ln -s %{java_home}/include/jni.h src/main/native/inc_linux ln -s %{java_home}/include/linux/jni_md.h src/main/native/inc_linux # Set the JNI path -sed -i 's,@LIBDIR@,%{libdir},' \ +sed -i 's,@LIBDIR@,%{_prefix}/lib,' \ src/main/java/org/fusesource/jansi/internal/JansiLoader.java %build @@ -86,8 +86,8 @@ cd - %install # Install the native artifact -mkdir -p %{buildroot}%{_libdir}/%{name} -cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} +mkdir -p %{buildroot}%{_prefix}/lib/%{name} +cp -p src/main/native/libjansi.so %{buildroot}%{_prefix}/lib/%{name} # Install the Java artifacts %mvn_install @@ -95,12 +95,16 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} %files -f .mfiles %license license.txt %doc readme.md changelog.md -%{_libdir}/%{name}/ +%{_prefix}/lib/%{name}/ %files javadoc -f .mfiles-javadoc %license license.txt %changelog +* Fri Sep 24 2021 Marian Koncek - 2.3.3-3 +- Install native artifact into a fixed location +- Related: rhbz#1994935 + * Thu Jul 22 2021 Fedora Release Engineering - 2.3.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 32d52092a13b4c194c2acd2abe3a21ca19a665c2 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Nov 08 2021 11:32:13 +0000 Subject: [PATCH 8/8] Avoid possible NullPointerException Resolves: rhbz#1995022 --- diff --git a/0001-Avoid-NPE.patch b/0001-Avoid-NPE.patch new file mode 100644 index 0000000..1aaa967 --- /dev/null +++ b/0001-Avoid-NPE.patch @@ -0,0 +1,26 @@ +From d94c5832e14504d44abeba47866dfa7dac5992b5 Mon Sep 17 00:00:00 2001 +From: Guillaume Nodet +Date: Fri, 23 Jul 2021 09:22:19 +0200 +Subject: [PATCH] Avoid possible NPE, fixes #214 + +--- + src/main/java/org/fusesource/jansi/AnsiPrintStream.java | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/main/java/org/fusesource/jansi/AnsiPrintStream.java b/src/main/java/org/fusesource/jansi/AnsiPrintStream.java +index e153c43..df6e5a6 100644 +--- a/src/main/java/org/fusesource/jansi/AnsiPrintStream.java ++++ b/src/main/java/org/fusesource/jansi/AnsiPrintStream.java +@@ -76,7 +76,11 @@ public void install() throws IOException { + } + + public void uninstall() throws IOException { +- getOut().uninstall(); ++ // If the system output stream has been closed, out should be null, so avoid a NPE ++ AnsiOutputStream out = getOut(); ++ if (out != null) { ++ out.uninstall(); ++ } + } + + @Override diff --git a/jansi.spec b/jansi.spec index fb14925..e4d8a01 100644 --- a/jansi.spec +++ b/jansi.spec @@ -2,7 +2,7 @@ Name: jansi Version: 2.3.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Generate and interpret ANSI escape sequences in Java License: ASL 2.0 URL: http://fusesource.github.io/jansi/ @@ -14,6 +14,7 @@ Source1: generate-tarball.sh # Change the location of the native artifact to where Fedora wants it Patch0: %{name}-jni.patch +Patch1: 0001-Avoid-NPE.patch BuildRequires: gcc BuildRequires: maven-local @@ -101,6 +102,10 @@ cp -p src/main/native/libjansi.so %{buildroot}%{_prefix}/lib/%{name} %license license.txt %changelog +* Mon Nov 08 2021 Marian Koncek - 2.3.3-4 +- Avoid possible NullPointerException +- Resolves: rhbz#1995022 + * Fri Sep 24 2021 Marian Koncek - 2.3.3-3 - Install native artifact into a fixed location - Related: rhbz#1994935