| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Name: jansi |
| 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: https://fusesource.github.io/jansi/ |
| Source0: %{name}-%{version}.tar.xz |
| Source1: %{name}-build.xml |
| Patch0: %{name}-jni.patch |
| BuildRequires: ant |
| BuildRequires: fdupes |
| BuildRequires: gcc |
| BuildRequires: javapackages-local |
| |
| %description |
| Jansi is a 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 |
| Summary: Javadocs for %{name} |
| Group: Documentation/HTML |
| BuildArch: noarch |
| |
| %description javadoc |
| This package contains the API documentation for %{name}. |
| |
| %prep |
| %setup -q |
| cp %{SOURCE1} build.xml |
| |
| %pom_remove_parent |
| |
| |
| %pom_xpath_remove "pom:build/pom:extensions" |
| |
| |
| %pom_remove_plugin :maven-gpg-plugin |
| %pom_remove_plugin :maven-javadoc-plugin |
| %pom_remove_plugin :nexus-staging-maven-plugin |
| |
| |
| %pom_remove_plugin :exec-maven-plugin |
| %pom_remove_dep :picocli-codegen |
| |
| |
| %pom_xpath_set "//pom:properties/pom:jdkTarget" 1.8 |
| |
| |
| 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 |
| |
| |
| sed -i 's,@LIBDIR@,%{_libdir},' \ |
| src/main/java/org/fusesource/jansi/internal/JansiLoader.java |
| |
| sed -i 's,\${project.version},%{version},' \ |
| src/main/resources/org/fusesource/jansi/jansi.properties |
| |
| %build |
| |
| CFLAGS="$CFLAGS -I. -I%{java_home}/include -I%{java_home}/include/linux -fPIC -fvisibility=hidden" |
| pushd 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 |
| popd |
| |
| |
| %{ant} jar javadoc |
| |
| %install |
| |
| install -dm 0755 %{buildroot}%{_libdir}/%{name} |
| install -pm 0755 src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} |
| |
| |
| install -dm 0755 %{buildroot}%{_jnidir}/%{name} |
| install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar |
| |
| install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} |
| install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom |
| %add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar |
| |
| %fdupes -s %{buildroot}%{_javadocdir} |
| |
| install -dm 0755 %{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} |
| |
| %changelog |