%global srcname setuptools_scm_git_archive Name: python-%{srcname} Version: 1.0 Release: 2%{?dist} Summary: A setuptools_scm plugin that adds support for git archives License: MIT URL: https://pypi.python.org/pypi/%{srcname} Source0: https://github.com/Changaco/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch %description This is a setuptools_scm plugin that adds support for git archives (for example the ones GitHub automatically generates). %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-setuptools_scm BuildRequires: python2-pytest Requires: python2-setuptools_scm %description -n python2-%{srcname} This is a setuptools_scm plugin that adds support for git archives (for example the ones GitHub automatically generates). %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-setuptools_scm BuildRequires: python3-pytest Requires: python3-setuptools_scm %description -n python3-%{srcname} This is a setuptools_scm plugin that adds support for git archives (for example the ones GitHub automatically generates). %prep %autosetup -n %{srcname}-%{version} %build # Here we set upstream version based on setuptools_scm documentation # this is done to avoid the following error: # LookupError: setuptools-scm was unable to detect version # since we are not importing a .git repository in the tarball export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %py2_build %py3_build %install # Here we set upstream version based on setuptools_scm documentation # this is done to avoid the following error: # LookupError: setuptools-scm was unable to detect version # since we are not importing a .git repository in the tarball export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %py2_install %py3_install # Removing egg-info duplicated files rm -rf %{buildroot}/%{python2_sitelib}/%{srcname}-0-*.egg-info rm -rf %{buildroot}/%{python3_sitelib}/%{srcname}-0-*.egg-info %check pytest-2 tests.py pytest-3 tests.py %files -n python2-%{srcname} %license LICENSE %doc README.rst %{python2_sitelib}/%{srcname}-*.egg-info %{python2_sitelib}/%{srcname} %files -n python3-%{srcname} %license LICENSE %doc README.rst %{python3_sitelib}/%{srcname}-*.egg-info %{python3_sitelib}/%{srcname} %changelog * Wed Sep 06 2017 Athos Ribeiro - 1.0-2 - Add missing Requires on pythonX-setuptools_scm * Mon Apr 10 2017 Athos Ribeiro - 1.0-1 - Initial package