diff --git a/brltty.spec b/brltty.spec index ca2cad7..eb7f505 100644 --- a/brltty.spec +++ b/brltty.spec @@ -32,6 +32,12 @@ %global with_ocaml 1 +%ifarch %{java_arches} +%global JAVA 1 +%else +%global JAVA 0 +%endif + # Filter private libraries %global _privatelibs libbrltty.+\.so.* %global __provides_exclude ^(%{_privatelibs})$ @@ -39,7 +45,7 @@ Name: brltty Version: %{pkg_version} -Release: 6%{?dist} +Release: 7%{?dist} License: LGPLv2+ URL: http://brltty.app/ Source0: http://brltty.app/archive/%{name}-%{version}.tar.xz @@ -217,6 +223,7 @@ Summary: Python 3 binding for BrlAPI This package provides the Python 3 binding for BrlAPI. %endif +%if %{JAVA} %package -n brlapi-java Version: %{api_version} License: LGPLv2+ @@ -226,6 +233,7 @@ BuildRequires: java-devel Summary: Java binding for BrlAPI %description -n brlapi-java This package provides the Java binding for BrlAPI. +%endif %if 0%{?with_ocaml} %package -n ocaml-brlapi @@ -282,11 +290,13 @@ cp -a python2 minimal # If MAKEFLAGS=-jN is set it would break local builds. unset MAKEFLAGS +%if %{JAVA} # Add the openjdk include directories to CPPFLAGS for i in -I/usr/lib/jvm/java/include{,/linux}; do java_inc="$java_inc $i" done export CPPFLAGS="$java_inc" +%endif export LDFLAGS="%{?build_ldflags}" export CFLAGS="%{optflags} -fno-strict-aliasing $LDFLAGS" @@ -303,10 +313,14 @@ configure_opts=" \ %if ! %{with_espeak} --without-espeak \ %endif +%if %{JAVA} --with-install-root=%{buildroot} \ JAVA_JAR_DIR=%{_jnidir} \ JAVA_JNI_DIR=%{_libdir}/brltty \ JAVA_JNI=yes" +%else + --with-install-root=%{buildroot}" +%endif configure_opts_minimal=" \ --disable-stripping \ @@ -522,6 +536,12 @@ popd rm -f doc/Initramfs/Dracut/README* rmdir doc/Initramfs/Dracut doc/Initramfs + +%if %{!JAVA} +find . -type d -name 'Java' | xargs rm -rf +find %{buildroot}%{_datadir} -type d -name 'Java' | xargs rm -rf +%endif + %post %systemd_post brltty.service @@ -554,6 +574,7 @@ fi %{_bindir}/brltty-* %exclude %{_bindir}/brltty-minimal %{_libdir}/brltty/ +%if %{!JAVA} %exclude %{_libdir}/brltty/libbrlttybba.so %exclude %{_libdir}/brltty/libbrlttybxw.so %exclude %{_libdir}/brltty/libbrlttyxa2.so @@ -563,6 +584,7 @@ fi %if %{with_speech_dispatcher} %exclude %{_libdir}/brltty/libbrlttyssd.so %endif +%endif %license LICENSE-LGPL %doc %{_mandir}/man[15]/brltty.* %{_sysconfdir}/X11/Xsession.d/90xbrlapi @@ -587,7 +609,7 @@ fi %files docs %doc Documents/ChangeLog Documents/TODO %doc Documents/Manual-BRLTTY/ -%doc doc/* +#%doc doc/* %files xw %doc Drivers/Braille/XWindow/README @@ -640,9 +662,11 @@ fi %{python3_sitearch}/Brlapi-%{api_version}-*.egg-info %endif +%if %{JAVA} %files -n brlapi-java %{_libdir}/brltty/libbrlapi_java.so %{_jnidir}/brlapi.jar +%endif %if 0%{?with_ocaml} %files -n ocaml-brlapi @@ -657,6 +681,9 @@ fi %config(noreplace) %verify(not size md5 mtime) %{_sysconfdir}/brltty/Initramfs/cmdline %changelog +* Mon Aug 01 2022 Gwyn Ciesla - 6.5-7 +- Build Java only on supported platforms. + * Mon Aug 01 2022 Frantisek Zatloukal - 6.5-6 - Rebuilt for ICU 71.1