# what it's called on pypi %global srcname pyroaring # what it's imported as %global modname pyroaring # name of egg info directory %global eggname pyroaring # package name fragment %global pkgname pyroaring %if %{defined rhel} || (%{defined fedora} && 0%{?fedora} < 30) %bcond_without python2 %endif %bcond_without python3 Name: python-pyroaring Version: 0.2.9 Release: 1%{?dist} Summary: An efficient and light-weight ordered set of 32 bits integers License: MIT URL: https://github.com/Ezibenroc/PyRoaringBitMap Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz BuildRequires: gcc-c++ %global _description \ An efficient and light-weight ordered set of 32 bits integers. \ This is a Python wrapper for the C library CRoaring. %description %{_description} %if %{with python2} %package -n python2-%{srcname} Summary: An efficient and light-weight ordered set of 32 bits integers BuildRequires: python2-devel %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %{_description} %endif %if %{with python3} %package -n python3-%{srcname} Summary: An efficient and light-weight ordered set of 32 bits integers BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %{_description} %endif %prep %setup -q -n %{srcname}-%{version} %build %if %{with python2} %py2_build %endif %if %{with python3} %py3_build %endif %install %if %{with python2} %py2_install %endif %if %{with python3} %py3_install %endif %if %{with check} # test.py missing from PyPi tarball %check %if %{with python2} env PYTHONPATH=%{buildroot}%{python2_sitearch} \ %{__python2} test.py %endif %if %{with python3} env PYTHONPATH=%{buildroot}%{python3_sitearch} \ %{__python3} test.py %endif %endif %if %{with python2} %files -n python2-%{srcname} %license LICENSE %doc README.rst %{python2_sitearch}/%{modname}.*.so %{python2_sitearch}/%{eggname}-%{version}-py%{python2_version}.egg-info %endif %if %{with python3} %files -n python3-%{srcname} %license LICENSE %doc README.rst %{python3_sitearch}/%{modname}.*.so %{python3_sitearch}/%{eggname}-%{version}-py%{python3_version}.egg-info %endif %changelog * Sun Mar 1 2020 gasinvein - Initial package