From 3aece1cd19f6f5c07b303b803b6cc5e0d6ee81b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 9 May 2013 13:13:33 +0200 Subject: [PATCH] Conditionally build python3 --- brltty.spec | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/brltty.spec b/brltty.spec index 49945df..1019e73 100644 --- a/brltty.spec +++ b/brltty.spec @@ -1,6 +1,12 @@ %define pkg_version 4.5 %define api_version 0.6.0 +%global with_python3 1 + +%if 0%{?rhel} +%global with_python3 0 +%endif + %{!?tcl_version: %define tcl_version %(echo 'puts $tcl_version' | tclsh)} %{!?tcl_sitearch: %define tcl_sitearch %{_prefix}/%{_lib}/tcl%{tcl_version}} @@ -13,7 +19,7 @@ Name: brltty Version: %{pkg_version} -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Daemons URL: http://mielke.cc/brltty/ @@ -116,6 +122,7 @@ Summary: Python binding for BrlAPI %description -n python-brlapi This package provides the Python binding for BrlAPI. +%if %{with_python3} %package -n python3-brlapi Version: %{api_version} Group: Development/System @@ -126,6 +133,7 @@ BuildRequires: python3-devel Summary: Python 3 binding for BrlAPI %description -n python3-brlapi This package provides the Python 3 binding for BrlAPI. +%endif %package -n brlapi-java Version: %{api_version} @@ -157,9 +165,11 @@ This package provides the OCaml binding for BrlAPI. %setup -q %patch4 -p1 -b .loadLibrary +%if %{with_python3} # Make a copy of the source tree for building the Python 3 module rm -rf %{py3dir} cp -a . %{py3dir} +%endif %build # Add the openjdk include directories to CPPFLAGS @@ -188,11 +198,13 @@ configure_opts=" \ %configure $configure_opts PYTHON=%{__python2} make %{?_smp_mflags} +%if %{with_python3} # ... and then do it again for the Python 3 module pushd %{py3dir} %configure $configure_opts PYTHON=%{__python3} make %{?_smp_mflags} popd +%endif find . \( -path ./doc -o -path ./Documents \) -prune -o \ \( -name 'README*' -o -name '*.txt' -o -name '*.html' -o \ @@ -221,12 +233,14 @@ make install JAVA_JAR_DIR=%{_jnidir} \ JAVA_JNI_DIR=%{_libdir}/brltty \ JAVA_JNI=yes +%if %{with_python3} # Python 3 pushd %{py3dir} make install JAVA_JAR_DIR=%{_jnidir} \ JAVA_JNI_DIR=%{_libdir}/brltty \ JAVA_JNI=yes popd +%endif install -d -m 755 "${RPM_BUILD_ROOT}%{_sysconfdir}" "$RPM_BUILD_ROOT%{_mandir}/man5" install -m 644 Documents/brltty.conf "${RPM_BUILD_ROOT}%{_sysconfdir}" @@ -319,9 +333,11 @@ exit 0 %{python_sitearch}/brlapi.so %{python_sitearch}/Brlapi-%{api_version}-*.egg-info +%if %{with_python3} %files -n python3-brlapi %{python3_sitearch}/brlapi.cpython-*.so %{python3_sitearch}/Brlapi-%{api_version}-*.egg-info +%endif %files -n brlapi-java %{_libdir}/brltty/libbrlapi_java.so @@ -334,6 +350,9 @@ exit 0 %endif %changelog +* Thu May 9 2013 Jaroslav Škarvada - 4.5-4 +- Conditionally build python3 + * Tue Apr 30 2013 Jon Ciesla - 4.5-3 - Add bluetooth support, BZ 916628.