From 08b64a7db4e6a5afe26168e474bde99e10292daf Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 10 Aug 2022 07:35:08 +0200 Subject: [PATCH] Initial import from Fedora Resolves: rhbz#2083112 --- .fmf/version | 1 + .gitignore | 13 +++ ci.fmf | 1 + gating.yaml | 8 ++ generate-tarball.sh | 20 ++++ jansi-jni.patch | 14 +++ jansi.spec | 253 +++++++++++++++++++++++++++++++++++++++++ plans/javapackages.fmf | 7 ++ sources | 1 + 9 files changed, 318 insertions(+) create mode 100644 .fmf/version create mode 100644 ci.fmf create mode 100644 gating.yaml create mode 100755 generate-tarball.sh create mode 100644 jansi-jni.patch create mode 100644 jansi.spec create mode 100644 plans/javapackages.fmf create mode 100644 sources diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index e69de29..a7bbade 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,13 @@ +/results_* +/*.src.rpm + +/jansi-1.6.tar.xz +/jansi-1.9.tar.xz +/jansi-1.11.tar.xz +/jansi-project-1.16.tar.gz +/jansi-project-1.17.tar.gz +/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 +/jansi-2.4.0.tar.gz diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..c5aa0e0 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..0d484d7 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,8 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: + - bodhi_update_push_testing + - bodhi_update_push_stable +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages.functional} 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-jni.patch b/jansi-jni.patch new file mode 100644 index 0000000..ddd9332 --- /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.spec b/jansi.spec new file mode 100644 index 0000000..d0dc4f8 --- /dev/null +++ b/jansi.spec @@ -0,0 +1,253 @@ +%bcond_with bootstrap + +Name: jansi +Version: 2.4.0 +Release: 6%{?dist} +Summary: Generate and interpret ANSI escape sequences in Java +License: ASL 2.0 +URL: http://fusesource.github.io/jansi/ +ExclusiveArch: %{java_arches} + +# ./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 + +BuildRequires: gcc +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else +BuildRequires: maven-local +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 +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 +BuildArch: noarch +Summary: Javadocs for %{name} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%autosetup -n jansi-jansi-%{version} -p1 + +# 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 + +# Remove prebuilt shared objects +rm -fr src/main/resources/org/fusesource/jansi/internal + +# Unbundle the JNI headers +rm src/main/native/inc_linux/*.h +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@,%{_prefix}/lib,' \ + src/main/java/org/fusesource/jansi/internal/JansiLoader.java + +%build +%set_build_flags +CC="${CC:-gcc}" +# Build the native artifact +CFLAGS="$CFLAGS -I. -I%{java_home}/include -I%{java_home}/include/linux -fPIC -fvisibility=hidden" +cd 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 +cd - + +# Build the Java artifacts +%mvn_build -- -Dlibrary.jansi.path=$PWD/src/main/native + +%install +# Install the native artifact +mkdir -p %{buildroot}%{_prefix}/lib/%{name} +cp -p src/main/native/libjansi.so %{buildroot}%{_prefix}/lib/%{name} + +# Install the Java artifacts +%mvn_install + +%files -f .mfiles +%license license.txt +%doc readme.md changelog.md +%{_prefix}/lib/%{name}/ + +%files javadoc -f .mfiles-javadoc +%license license.txt + +%changelog +* Thu Jul 21 2022 Fedora Release Engineering - 2.4.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jul 18 2022 Mikolaj Izdebski - 2.4.0-5 +- Ensure CC env variable is set during build + +* Thu Jul 14 2022 Marian Koncek - 2.4.0-4 +- Make javadoc subpackage noarch + +* Sat Feb 05 2022 Jiri Vanek - 2.4.0-3 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 20 2022 Fedora Release Engineering - 2.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Nov 01 2021 Marian Koncek - 2.4.0-1 +- Update to upstream version 2.4.0 + +* 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 + +* 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 + +* 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 + +* Thu Jan 14 2021 Timm Bäder - 2.1.1-2 +- Use standard variables when compiling native artifact + +* Tue Dec 15 2020 Jerry James - 2.1.1-1 +- Version 2.1.1 +- Remove package name from Summary +- Add patch to change the location of the JNI shared object + +* Tue Jul 28 2020 Fedora Release Engineering - 1.18-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Jiri Vanek - 1.18-4 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Wed Jan 29 2020 Fedora Release Engineering - 1.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 1.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Jun 08 2019 Fabio Valentini - 1.18-1 +- Update to version 1.18. + +* Fri Feb 01 2019 Fedora Release Engineering - 1.17.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.17.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 05 2018 Michael Simacek - 1.17.1-1 +- Update to upstream version 1.17.1 + +* Mon Feb 26 2018 Michael Simacek - 1.17-1 +- Update to upstream version 1.17 + +* Wed Feb 07 2018 Fedora Release Engineering - 1.16-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.16-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jun 14 2017 Michael Simacek - 1.16-1 +- Update to upstream version 1.16 + +* Fri Feb 10 2017 Fedora Release Engineering - 1.11-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 01 2017 Michael Simacek - 1.11-11 +- Remove BR on maven-site-plugin + +* Thu Feb 04 2016 Fedora Release Engineering - 1.11-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.11-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu May 14 2015 Mikolaj Izdebski - 1.11-8 +- Remove maven-javadoc-plugin execution + +* Tue Jan 27 2015 Mat Booth - 1.11-7 +- Add/remove BRs to fix FTBFS bug + +* Sat Jun 07 2014 Fedora Release Engineering - 1.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 26 2014 Mikolaj Izdebski - 1.11-5 +- Migrate BuildRequires from junit4 to junit + +* Mon May 26 2014 Mikolaj Izdebski - 1.11-4 +- Remove BuildRequires on maven-surefire-provider-junit4 + +* Wed Sep 11 2013 Marek Goldmann - 1.11-3 +- Using xmvn +- Remove the jboss-native deps with classifiers + +* Sat Aug 03 2013 Fedora Release Engineering - 1.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue May 21 2013 Marek Goldmann - 1.11-1 +- Upstream release 1.11 RHBZ#962761 +- CVE-2013-2035 HawtJNI: predictable temporary file name leading to local arbitrary code execution RHBZ#962614 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Feb 06 2013 Java SIG - 1.9-2 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Tue Oct 09 2012 Marek Goldmann - 1.9-1 +- Upstream release 1.9, RHBZ#864490 + +* Thu Jul 19 2012 Fedora Release Engineering - 1.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri May 04 2012 Tomas Radej - 1.6-3 +- Removed maven-license-plugin BR + +* Fri Jan 13 2012 Fedora Release Engineering - 1.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Aug 25 2011 Marek Goldmann 1.6-1 +- Upstream release 1.6 +- Spec file cleanup + +* Fri May 27 2011 Marek Goldmann 1.5-1 +- Initial packaging + diff --git a/plans/javapackages.fmf b/plans/javapackages.fmf new file mode 100644 index 0000000..def0914 --- /dev/null +++ b/plans/javapackages.fmf @@ -0,0 +1,7 @@ +summary: + Run javapackages-specific tests +discover: + how: fmf + url: https://pagure.io/javapackages-validator-tests +execute: + how: tmt diff --git a/sources b/sources new file mode 100644 index 0000000..dc3c8ed --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (jansi-2.4.0.tar.gz) = b52fbd371acbf98398c3720225f32c826b545cd598fdf0c327c477b416af11af3c78833998823e1e7aa92b91a31e2918d63f4a598618bbe2278c812b94217a12