%bcond_without tests %global pypi_name glymur %global desc %{expand: \ Glymur is a Python interface for JPEG 2000 contains a Python interface to the OpenJPEG library which allows one to read and write JPEG 2000 files.} Name: python-%{pypi_name} Version: 0.8.18 Release: 1%{?dist} Summary: Tools for accessing JPEG2000 files License: MIT URL: https://github.com/quintusdias/glymur Source0: https://files.pythonhosted.org/packages/source/g/%{pypi_name}/Glymur-%{version}.tar.gz BuildArch: noarch %{?python_enable_dependency_generator} %description %{desc} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3dist(numpy) >= 1.7.1 BuildRequires: python3dist(numpydoc) BuildRequires: python3dist(scikit-image) Requires: python3dist(setuptools) Requires: python3dist(sphinx_rtd_theme) %description -n python3-%{pypi_name} %{desc} %package -n python-%{pypi_name}-doc Summary: glymur documentation %description -n python-%{pypi_name}-doc Documentation for glymur %prep %autosetup -n Glymur-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py3_build # generate html docs PYTHONPATH=${PWD} sphinx-build-3 docs/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %py3_install %check %if %{with tests} touch tests/data/__init__.py %{__python3} -m unittest discover %endif %files -n python3-%{pypi_name} %license LICENSE.txt %doc README.md %{_bindir}/jp2dump %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/Glymur-%{version}-py?.?.egg-info %files -n python-%{pypi_name}-doc %doc html %license LICENSE.txt %changelog * Tue Jul 09 2019 Luis M. Segundo - 0.8.18-1 - Initial package.