From 69fb893b13dcb80d08792f4d759ff8712d5fca71 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Aug 01 2018 10:07:38 +0000 Subject: Disable python2 for RHEL8 --- diff --git a/marisa.spec b/marisa.spec index 7acc669..be5abe6 100644 --- a/marisa.spec +++ b/marisa.spec @@ -1,6 +1,14 @@ +# python2 is not available on RHEL > 7 and not needed on Fedora > 28 +%if 0%{?rhel} > 7 || 0%{?fedora} > 28 +# disable python2 by default +%bcond_with python2 +%else +%bcond_without python2 +%endif + Name: marisa Version: 0.2.4 -Release: 35%{?dist} +Release: 36%{?dist} Summary: Static and spece-efficient trie data structure library License: BSD or LGPLv2+ @@ -14,7 +22,9 @@ BuildRequires: gcc-c++ BuildRequires: swig BuildRequires: perl-devel BuildRequires: perl-generators +%if %{with python2} BuildRequires: python2-devel +%endif BuildRequires: python3-devel BuildRequires: ruby-devel @@ -55,6 +65,7 @@ Requires: %{name} = %{version}-%{release} Perl language binding for marisa +%if %{with python2} %package -n python2-%{name} Summary: Python language binding for marisa Requires: %{name} = %{version}-%{release} @@ -66,6 +77,7 @@ Obsoletes: %{name}-python < %{version}-%{release} %description -n python2-%{name} Python 2 language binding for marisa +%endif %package -n python3-%{name} @@ -111,8 +123,10 @@ popd make --directory=bindings swig-python pushd bindings/python +%if %{with python2} %{__python2} setup.py build_ext --include-dirs="%{_builddir}/%{name}-%{version}/lib" --library-dirs="%{_builddir}/%{name}-%{version}/lib/.libs" %py2_build +%endif %{__python3} setup.py build_ext --include-dirs="%{_builddir}/%{name}-%{version}/lib" --library-dirs="%{_builddir}/%{name}-%{version}/lib/.libs" %py3_build @@ -142,7 +156,9 @@ popd # install Python bindings pushd bindings/python +%if %{with python2} %py2_install +%endif %py3_install popd @@ -189,10 +205,12 @@ rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/sample.pl %{perl_vendorarch}/marisa.pm %{perl_vendorarch}/auto/marisa +%if %{with python2} %files -n python2-%{name} %{python2_sitearch}/_marisa.so %{python2_sitearch}/marisa.py* %{python2_sitearch}/marisa-0.0.0-py2.?.egg-info +%endif %files -n python3-%{name} %{python3_sitearch}/__pycache__/marisa* @@ -204,6 +222,9 @@ rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/sample.pl %{ruby_vendorarchdir}/marisa.so %changelog +* Wed Aug 01 2018 Takao Fujiwara - 0.2.4-36 +- disable python2 for RHEL8 + * Fri Jul 13 2018 Fedora Release Engineering - 0.2.4-35 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild