6
0
forked from pool/jansi

Compare commits

...

13 Commits

Author SHA256 Message Date
d1387d3ce4 Accepting request 1204584 from Java:packages
Fix build after removal of the default %%{java_home} define

OBS-URL: https://build.opensuse.org/request/show/1204584
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=7
2024-09-30 13:34:45 +00:00
9d7fadf1d5 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=19 2024-09-29 20:48:28 +00:00
0a6e9386b8 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=18 2024-09-29 19:48:42 +00:00
b46256b248 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=17 2024-09-29 06:02:49 +00:00
f90c2519dd Accepting request 1083071 from Java:packages
Appease lawyers

OBS-URL: https://build.opensuse.org/request/show/1083071
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=6
2023-04-27 18:00:42 +00:00
19e1fa5ac7 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=15 2023-04-26 17:01:06 +00:00
bff5763d03 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=14 2023-04-26 15:55:49 +00:00
9e652d8399 Accepting request 977561 from Java:packages
maven 3.8.5 / jansi 2.4.0 and fixes for building with them

OBS-URL: https://build.opensuse.org/request/show/977561
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=5
2022-05-17 15:24:12 +00:00
34b94f8613 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=12 2022-05-16 11:05:23 +00:00
d694873552 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jansi?expand=0&rev=11 2022-05-16 11:03:10 +00:00
33f7287da4 Accepting request 964413 from Java:packages
Build with source and target levels 8

OBS-URL: https://build.opensuse.org/request/show/964413
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=4
2022-03-24 21:57:52 +00:00
b0c2abea2e Accepting request 712780 from Java:packages
- Remove the reference to jansi-project parent from jansi pom
- Resolve manually jansi-native-version variable so that ivy
  understands it

OBS-URL: https://build.opensuse.org/request/show/712780
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=3
2019-07-02 08:38:45 +00:00
535d70a0f8 Accepting request 693096 from Java:packages
- Remove reference to the parent pom since we are not building
  using Maven.
- Make tests conditional and switched off by default

OBS-URL: https://build.opensuse.org/request/show/693096
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jansi?expand=0&rev=2
2019-04-11 10:19:26 +00:00
7 changed files with 174 additions and 233 deletions

19
_service Normal file
View File

@@ -0,0 +1,19 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/fusesource/jansi.git</param>
<param name="revision">jansi-2.4.0</param>
<param name="match-tag">jansi-*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">jansi-(.*)</param>
<param name="exclude">src/main/native/inc_mac</param>
<param name="exclude">src/main/native/inc_win</param>
<param name="exclude">src/main/native/inc_linux/*</param>
<param name="exclude">src/main/resources/org/fusesource/jansi/internal</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

BIN
jansi-2.4.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,44 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jansi" default="package" basedir="jansi">
<project name="jansi" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.version" value="2.4.0"/>
<property name="project.groupId" value="org.fusesource.jansi"/>
<property name="project.artifactId" value="jansi"/>
<property name="project.version" value="1.17.1"/>
<property name="project.name" value="${project.artifactId}"/>
<property name="project.description" value="Jansi is a java library for generating and interpreting ANSI escape sequences."/>
<property name="spec.version" value="2.4"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir.0" value="src/main/java"/>
<property name="build.resourceDir.0" value="src/main/resources"/>
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
<property name="build.testDir.0" value="src/test/java"/>
<property name="build.testResourceDir.0" value="src/test/resources"/>
<property name="test.reports" value="${build.dir}/test-reports"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<property name="spec.version" value="1.17"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
@@ -54,186 +37,82 @@
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
encoding="UTF-8"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
<javac destdir="${build.outputDir}"
encoding="UTF-8"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir.0}"/>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.outputDir}">
<fileset dir="${build.resourceDir.0}"/>
<fileset dir="${build.resourceDir}"/>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Test-compilation target -->
<!-- ====================================================================== -->
<target name="compile-tests"
depends="compile"
description="Compile the test code"
unless="test.skip">
<mkdir dir="${build.testOutputDir}"/>
<javac destdir="${build.testOutputDir}"
encoding="UTF-8"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.testDir.0}"/>
</src>
<classpath>
<path refid="build.classpath"/>
<pathelement location="${build.outputDir}"/>
</classpath>
</javac>
<copy todir="${build.testOutputDir}">
<fileset dir="${build.testResourceDir.0}"/>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Run all tests -->
<!-- ====================================================================== -->
<target name="test"
depends="compile-tests, junit-missing"
unless="junit.skipped"
description="Run the test cases">
<mkdir dir="${test.reports}"/>
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
<sysproperty key="basedir" value="."/>
<formatter type="xml"/>
<formatter type="plain" usefile="false"/>
<classpath>
<path refid="build.classpath"/>
<pathelement location="${build.outputDir}"/>
<pathelement location="${build.testOutputDir}"/>
</classpath>
<batchtest todir="${test.reports}" unless="test">
<fileset dir="${build.testDir.0}">
<include name="**/*Test.java"/>
<exclude name="**/Abstract*.java"/>
<exclude name="**/Test*.java"/>
</fileset>
</batchtest>
<batchtest todir="${test.reports}" if="test">
<fileset dir="${build.testDir.0}">
<include name="**/${test}.java"/>
<exclude name="**/Abstract*.java"/>
<exclude name="**/Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test-junit-present">
<available classname="junit.framework.Test" property="junit.present" classpathref="build.classpath"/>
</target>
<target name="test-junit-status"
depends="test-junit-present">
<condition property="junit.missing">
<and>
<isfalse value="${junit.present}"/>
<isfalse value="${test.skip}"/>
</and>
</condition>
<condition property="junit.skipped">
<or>
<isfalse value="${junit.present}"/>
<istrue value="${test.skip}"/>
</or>
</condition>
</target>
<target name="junit-missing"
depends="test-junit-status"
if="junit.missing">
<echo>=================================== WARNING ===================================</echo>
<echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo>
<echo>===============================================================================</echo>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir.0}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
locale="en_US"
version="false"
use="true"
author="true"
splitindex="false"
windowtitle="jansi API Reference (${project.version})"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
encoding="UTF-8"
docencoding="UTF-8"
linksource="true"
breakiterator="false">
<doctitle>&lt;![CDATA[jansi API Reference (${project.version})]]&gt;</doctitle>
<classpath refid="build.classpath"/>
</javadoc>
linksource="false"
breakiterator="false"/>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile,test" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Bundle-Description" value="${project.description}"/>
<attribute name="Bundle-DocURL" value="http://fusesource.com/"/>
<attribute name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="${project.name}"/>
<attribute name="Bundle-SymbolicName" value="org.fusesource.jansi"/>
<attribute name="Bundle-Vendor" value="FuseSource, Corp."/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.fusesource.jansi;version=&quot;${project.version}&quot;,org.fusesource.jansi.internal;version=&quot;${project.version}&quot;"/>
<attribute name="Implementation-Title" value="${project.name}"/>
<attribute name="Implementation-URL" value="http://fusesource.github.io/jansi/jansi"/>
<attribute name="Implementation-Vendor" value="FuseSource, Corp."/>
<attribute name="Implementation-Vendor-Id" value="${project.groupId}"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/>
<attribute name="JavaPackages-GroupId" value="${project.groupId}"/>
<attribute name="JavaPackages-Version" value="${project.version}"/>
<attribute name="Main-Class" value="org.fusesource.jansi.AnsiMain"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
<attribute name="Specification-Title" value="${project.name}"/>
<attribute name="Specification-Vendor" value="FuseSource, Corp."/>
<attribute name="Specification-Version" value="${spec.version}"/>
<attribute name="Automatic-Module-Name" value="${project.groupId}"/>
<attribute name="Bundle-Description" value="Jansi is a java library for generating and interpreting ANSI escape sequences."/>
<attribute name="Bundle-DocURL" value="http://fusesource.com/"/>
<attribute name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="${project.artifactId}"/>
<attribute name="Bundle-SymbolicName" value="${project.groupId}"/>
<attribute name="Bundle-Vendor" value="FuseSource, Corp."/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.fusesource.jansi.internal;version=&quot;${project.version}&quot;,org.fusesource.jansi.io;version=&quot;${project.version}&quot;;uses:=&quot;org.fusesource.jansi&quot;,org.fusesource.jansi;version=&quot;${project.version}&quot;;uses:=&quot;org.fusesource.jansi.io&quot;"/>
<attribute name="Implementation-Title" value="${project.artifactId}"/>
<attribute name="Implementation-Vendor" value="FuseSource, Corp."/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Main-Class" value="org.fusesource.jansi.AnsiMain"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
<attribute name="Specification-Title" value="${project.artifactId}"/>
<attribute name="Specification-Vendor" value="FuseSource, Corp."/>
<attribute name="Specification-Version" value="${spec.version}"/>
</manifest>
</jar>
</target>

14
jansi-jni.patch Normal file
View File

@@ -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

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d7280eb14edc82e480d66b225470ed6a1da5c5afa4faeab7804a1f15e53b2cd
size 270221

View File

@@ -1,3 +1,27 @@
-------------------------------------------------------------------
Sun Sep 29 19:48:37 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Fix build after removal of the default %%{java_home} define
-------------------------------------------------------------------
Wed Apr 26 15:53:32 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Fetch sources using source_service and don't distribute legally
spurious files (bsc#1210877)
-------------------------------------------------------------------
Mon May 16 11:00:15 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package jansi
#
# Copyright (c) 2022 SUSE LLC
# 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
@@ -16,27 +16,20 @@
#
%bcond_with tests
Name: jansi
Version: 1.17.1
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: http://fusesource.github.io/jansi/
Source0: https://github.com/fusesource/jansi/archive/jansi-project-%{version}.tar.gz
URL: https://fusesource.github.io/jansi/
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-build.xml
Patch0: %{name}-jni.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: hawtjni-runtime
BuildRequires: jansi-native
BuildRequires: javapackages-local
%if %{with tests}
BuildRequires: ant-junit
%endif
Requires: mvn(org.fusesource.hawtjni:hawtjni-runtime)
Requires: mvn(org.fusesource.jansi:jansi-native)
BuildArch: noarch
BuildRequires: gcc
BuildRequires: javapackages-local >= 6
%description
Jansi is a java library that allows you to use ANSI escape sequences
@@ -47,68 +40,80 @@ 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 -n jansi-jansi-project-%{version}
cp %{SOURCE1} .
%setup -q
cp %{SOURCE1} build.xml
%pom_disable_module example
%pom_remove_parent
# We don't need the Fuse JXR skin
%pom_xpath_remove "pom:build/pom:extensions"
%pom_remove_plugin -r :maven-site-plugin
# 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
# No maven-uberize-plugin
%pom_remove_plugin -r :maven-uberize-plugin
# We don't want GraalVM support in Fedora
%pom_remove_plugin :exec-maven-plugin
%pom_remove_dep :picocli-codegen
# Remove unnecessary deps for jansi-native builds
pushd jansi
%pom_remove_dep :jansi-windows32
%pom_remove_dep :jansi-windows64
%pom_remove_dep :jansi-osx
%pom_remove_dep :jansi-freebsd32
%pom_remove_dep :jansi-freebsd64
# it's there only to be bundled in uberjar and we disable uberjar generation
%pom_remove_dep :jansi-linux32
%pom_remove_dep :jansi-linux64
popd
# Build for JDK 1.8 at a minimum
%pom_xpath_set "//pom:properties/pom:jdkTarget" 1.8
%pom_remove_parent jansi
%pom_xpath_inject pom:project "
<groupId>org.fusesource.jansi</groupId>
<version>%{version}</version>" jansi
%pom_change_dep ::\${jansi-native-version} ::1.8 jansi
# 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
mkdir -p jansi/lib
build-jar-repository -s jansi/lib \
hawtjni/hawtjni-runtime jansi-native/jansi-native
%{ant} -f %{name}-build.xml \
%if %{without tests}
-Dtest.skip=true \
%endif
jar javadoc
# Build the native artifact
CFLAGS="$CFLAGS -I. -fPIC -fvisibility=hidden"
pushd src/main/native
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
%{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}%{_javadir}/%{name}
install -pm 0644 jansi/target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{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 jansi/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}
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr jansi/target/site/apidocs/* %{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}