File jline3.spec of Package jline3

#
# spec file for package jline3
#
# 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/
#


%global desc JLine is a Java library for handling console input. It is similar in\
functionality to BSD editline and GNU readline but with additional features\
that bring it in par with ZSH line editor. People familiar with the\
readline/editline capabilities for modern shells (such as bash and tcsh) will\
find most of the command editing features of JLine to be familiar.\
\
JLine 3.x is an evolution of JLine 2.x.
Name:           jline3
Version:        3.26.3
Release:        0
Summary:        Java library for handling console input
License:        BSD-3-Clause
Group:          Development/Libraries/Java
URL:            https://github.com/jline/jline3
Source0:        %{url}/archive/refs/tags/jline-parent-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  maven-local
BuildRequires:  mvn(com.google.code.findbugs:jsr305)
BuildRequires:  mvn(com.googlecode.juniversalchardet:juniversalchardet)
BuildRequires:  mvn(info.picocli:picocli-codegen)
BuildRequires:  mvn(net.java.dev.jna:jna)
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-source-plugin)
BuildRequires:  mvn(org.apache.sshd:sshd-core)
BuildRequires:  mvn(org.apache.sshd:sshd-scp)
BuildRequires:  mvn(org.apache.sshd:sshd-sftp)
BuildRequires:  mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires:  mvn(org.codehaus.mojo:exec-maven-plugin)
BuildRequires:  mvn(org.fusesource.jansi:jansi)
BuildRequires:  mvn(org.sonatype.oss:oss-parent:pom:)

%description
JLine is a Java library for handling console input. It is similar in
functionality to BSD editline and GNU readline but with additional features
that bring it in par with ZSH line editor. People familiar with the
readline/editline capabilities for modern shells (such as bash and tcsh) will
find most of the command editing features of JLine to be familiar.

JLine 3.x is an evolution of JLine 2.x.

%package parent
Summary:        JLine Parent
BuildArch:      noarch

%description parent
%{desc}

%package builtins
Summary:        JLine Builtins
BuildArch:      noarch

%description builtins
%{desc}

This package contains several high level tools: less pager, nano editor, screen
multiplexer, etc…

%package console
Summary:        JLine Console
BuildArch:      noarch

%description console
%{desc}

This package contains the command registry, object printer and widget
implementations.

%package console-ui
Summary:        JLine Console UI
BuildArch:      noarch

%description console-ui
%{desc}

This package provides simple UI elements on ANSI terminals.

%package native
Summary:        JLine Native Library

%description native
%{desc}

This package contains the native library.

%package reader
Summary:        JLine Reader
BuildArch:      noarch

%description reader
%{desc}

This package contains the line reader (including completion, history, etc…).

%package remote-telnet
Summary:        JLine Remote Telnet
BuildArch:      noarch

%description remote-telnet
%{desc}

This package contains the helpers for using jline over telnet (including
a telnet server implementation).

%package remote-ssh
Summary:        JLine Remote SSH
Recommends:     mvn(org.apache.sshd:scp-core)
Recommends:     mvn(org.apache.sshd:sftp-core)
Recommends:     mvn(org.apache.sshd:sshd-core)
BuildArch:      noarch

%description remote-ssh
%{desc}

This package contains the helpers for using jline with Mina SSHD.

%package style
Summary:        JLine Style
BuildArch:      noarch

%description style
%{desc}

This package contains the styling api.

%package terminal-jna
Summary:        JLine JNA Terminal
BuildArch:      noarch

%description terminal-jna
%{desc}

This package contains terminal implementations leveraging the JNA library.

%package terminal-jni
Summary:        JLine JNI Terminal
BuildArch:      noarch

%description terminal-jni
%{desc}

This package contains terminal implementations leveraging the JNI native
library.

%package terminal
Summary:        JLine Terminal
BuildArch:      noarch

%description terminal
%{desc}

This package contains the Terminal api and implementations.

%package terminal-jansi
Summary:        JLine JANSI Terminal
BuildArch:      noarch

%description terminal-jansi
%{desc}

This package contains terminal implementations leveraging the Jansi library.

%package javadoc
Summary:        API documentation for %{name}
BuildArch:      noarch

%description javadoc
API documentation for %{name}.

%prep
%autosetup -n %{name}-jline-parent-%{version}

%pom_disable_module demo
%pom_disable_module groovy
%pom_disable_module graal
%pom_disable_module terminal-ffm

%pom_remove_plugin org.graalvm.nativeimage:native-image-maven-plugin
%pom_remove_plugin :maven-release-plugin
%pom_remove_plugin :maven-enforcer-plugin
%pom_remove_plugin com.diffplug.spotless:spotless-maven-plugin

%pom_xpath_remove -r 'pom:arg[.="-Werror"]' . jline
%pom_xpath_remove -r 'pom:profile[pom:id="javadoc"]'
%pom_xpath_remove 'pom:artifactItem[pom:artifactId="jline-terminal-ffm"]' jline
%pom_xpath_remove 'pom:classpathScope[.="test"]' native
%pom_xpath_remove 'pom:dependency[pom:artifactId="picocli-codegen"]/pom:scope' native

find native/src/main/resources/org/jline/nativ \
	\( -name jlinenative.dll -or -name libjlinenative.so -or -name libjlinenative.jnilib \) \
	-delete

%{mvn_package} ":jline-{*}" @1

%build
%make_build -Cnative native \
	OS_NAME=Linux \
%ifarch i586
	OS_ARCH=x86 \
%endif
%ifarch armv6l
	OS_ARCH=armv6 \
%endif
%ifarch armv7l
	OS_ARCH=armv7 \
%endif
%ifarch ppc64le
	OS_ARCH=ppc64 \
%endif
%ifarch x86_64 riscv64 s390x aarch64
	OS_ARCH=%{_arch} \
%endif
	CCFLAGS='-fPIC -I%{_jvmdir}/java/include -I%{_jvmdir}/java/include/linux'

%{mvn_build} -f -- \
	-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)

%install
%mvn_install
%fdupes %{buildroot}%{_javadocdir}/%{name}

%files -f .mfiles
%doc README.md
%license LICENSE.txt

%files builtins -f .mfiles-builtins
%doc README.md
%license LICENSE.txt

%files console -f .mfiles-console
%doc README.md
%license LICENSE.txt

%files console-ui -f .mfiles-console-ui
%doc README.md
%license LICENSE.txt

%files native -f .mfiles-native
%doc README.md
%license LICENSE.txt

%files reader -f .mfiles-reader
%doc README.md
%license LICENSE.txt

%files remote-telnet -f .mfiles-remote-telnet
%doc README.md
%license LICENSE.txt

%files style -f .mfiles-style
%doc README.md
%license LICENSE.txt

%files terminal -f .mfiles-terminal
%doc README.md
%license LICENSE.txt

%files terminal-jna -f .mfiles-terminal-jna
%doc README.md
%license LICENSE.txt

%files terminal-jni -f .mfiles-terminal-jni
%doc README.md
%license LICENSE.txt

%files terminal-jansi -f .mfiles-terminal-jansi
%doc README.md
%license LICENSE.txt

%files remote-ssh -f .mfiles-remote-ssh
%doc README.md
%license LICENSE.txt

%files parent -f .mfiles-parent
%doc README.md
%license LICENSE.txt

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

%changelog
openSUSE Build Service is sponsored by