%global with_python3 1 %global pypi_name imagesize %global sum Python module for analyzing image file headers and returning image sizes Name: python-%{pypi_name} Version: 0.7.1 Release: 5%{?dist}.1 Summary: %{sum} License: MIT URL: https://github.com/shibukawa/imagesize_py #Source0: https://files.pythonhosted.org/packages/source/i/%%{pypi_name}/%%{pypi_name}-%%{version}.tar.gz # PyPi source does not include test image files, pull from github until next release Source0: https://github.com/shibukawa/imagesize_py/archive/%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-setuptools BuildRequires: python2-devel BuildRequires: python2-pytest %description The imagesize package parses image file headers and returns the image sizes. * PNG * JPEG * JPEG2000 * GIF This is a pure Python library. %package -n python2-%{pypi_name} Summary: %{sum} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} The imagesize package parses image file headers and returns the image sizes. * PNG * JPEG * JPEG2000 * GIF This is a pure Python library. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: %{sum} BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: python%{python3_pkgversion}-pytest %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} The imagesize package parses image file headers and returns the image sizes. * PNG * JPEG * JPEG2000 * GIF This is a pure Python library. %endif %prep %autosetup -n %{pypi_name}_py-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif %install %if 0%{?with_python3} %py3_install %endif %py2_install %check py.test-2 %if 0%{?with_python3} py.test-3 %endif %files -n python2-%{pypi_name} %doc README.rst %license LICENSE.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE.rst %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %changelog * Sat May 09 2020 Jean-Marc Liger - 0.7.1-5.1 - Enable python3 for COPR EL7 * Sat Feb 11 2017 Fedora Release Engineering - 0.7.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Dec 13 2016 Stratakis Charalampos - 0.7.1-4 - Enable tests * Fri Dec 09 2016 Charalampos Stratakis - 0.7.1-3 - Rebuild for Python 3.6 - Disable python3 tests * Tue Jul 19 2016 Fedora Release Engineering - 0.7.1-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu May 26 2016 Avram Lubkin - 0.7.1-1 - Initial package.