| |
@@ -1,20 +1,21 @@
|
| |
Name: jansi
|
| |
- Version: 1.18
|
| |
- Release: 5%{?dist}
|
| |
- Summary: Jansi is a java library for generating and interpreting ANSI escape sequences
|
| |
+ Version: 2.1.1
|
| |
+ Release: 1%{?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
|
| |
+ # Change the location of the native artifact to where Fedora wants it
|
| |
+ Patch0: %{name}-jni.patch
|
| |
|
| |
- Source0: https://github.com/fusesource/jansi/archive/jansi-project-%{version}.tar.gz
|
| |
-
|
| |
- BuildArch: noarch
|
| |
-
|
| |
+ BuildRequires: gcc
|
| |
BuildRequires: maven-local
|
| |
- BuildRequires: mvn(junit:junit)
|
| |
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.fusesource.hawtjni:hawtjni-runtime)
|
| |
- BuildRequires: mvn(org.fusesource.jansi:jansi-native)
|
| |
+ BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine)
|
| |
|
| |
%description
|
| |
Jansi is a small java library that allows you to use ANSI escape sequences
|
| |
@@ -29,45 +30,72 @@
|
| |
This package contains the API documentation for %{name}.
|
| |
|
| |
%prep
|
| |
- %setup -q -n jansi-jansi-project-%{version}
|
| |
+ %autosetup -n jansi-jansi-%{version} -p1
|
| |
|
| |
- %pom_disable_module example
|
| |
+ # 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
|
| |
+
|
| |
+ # We don't want GraalVM support in Fedora
|
| |
+ %pom_remove_plugin :exec-maven-plugin
|
| |
+ %pom_remove_dep :picocli-codegen
|
| |
|
| |
- # No maven-uberize-plugin
|
| |
- %pom_remove_plugin -r :maven-uberize-plugin
|
| |
+ # 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
|
| |
|
| |
- # 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
|
| |
+ # Remove prebuilt shared objects
|
| |
+ rm -fr src/main/resources/org/fusesource/jansi/internal
|
| |
|
| |
- # javadoc generation fails due to strict doclint in JDK 8
|
| |
- %pom_remove_plugin -r :maven-javadoc-plugin
|
| |
+ # 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@,%{libdir},' \
|
| |
+ src/main/java/org/fusesource/jansi/internal/JansiLoader.java
|
| |
|
| |
%build
|
| |
- %mvn_build
|
| |
+ # Build the native artifact
|
| |
+ CFLAGS="%{build_cflags} -I. -I%{java_home}/include -I%{java_home}/include/linux -fPIC -fvisibility=hidden"
|
| |
+ cd 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 %{build_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}%{_libdir}/%{name}
|
| |
+ cp -p src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name}
|
| |
+
|
| |
+ # Install the Java artifacts
|
| |
%mvn_install
|
| |
|
| |
%files -f .mfiles
|
| |
%license license.txt
|
| |
%doc readme.md changelog.md
|
| |
+ %{_libdir}/%{name}/
|
| |
|
| |
%files javadoc -f .mfiles-javadoc
|
| |
%license license.txt
|
| |
|
| |
%changelog
|
| |
+ * Tue Dec 15 2020 Jerry James <loganjerry@gmail.com> - 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 <releng@fedoraproject.org> - 1.18-5
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
| |
|
| |
Version 1.x will be kept in package jansi1: https://bugzilla.redhat.com/show_bug.cgi?id=1908037