%global modname sortedcontainers %global git_user grantjenks %global git_reponame sorted_containers #global git_commit 28f1e86 #global git_date 20170421 Name: python-sortedcontainers Version: 1.5.7 Release: 1%{?git_commit:.%{git_date}git%{git_commit}}%{?dist} Summary: A pure Python sorted collections library License: ASL 2.0 URL: http://www.grantjenks.com/docs/sortedcontainers/ BuildArch: noarch %if %{defined git_commit} Source0: https://github.com/%{git_user}/%{git_reponame}/tarball/%{git_commit}/%{git_reponame}-%{git_commit}.tar.gz %else Source0: https://github.com/%{git_user}/%{git_reponame}/archive/v%{version}/%{git_reponame}-%{version}.tar.gz %endif %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-devel python-setuptools %else BuildRequires: python2-devel python2-setuptools %endif BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %description SortedContainers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. %package -n python2-%{modname} Summary: %{summary} %{?python_provide:%python_provide python2-%{modname}} %description -n python2-%{modname} SortedContainers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. %package -n python%{python3_pkgversion}-%{modname} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}} %description -n python%{python3_pkgversion}-%{modname} SortedContainers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. %prep %if %{defined git_commit} %setup -q -n %{git_user}-%{git_reponame}-%{git_commit} %else %setup -q -n %{git_reponame}-%{version} %endif %build %py2_build %py3_build %install # Doesn't install anything to /usr/bin, so I don't think the order of # installing python2 and python3 actually matters. %py3_install %py2_install # NOTE: There is no check section because I haven't figured out how to # run tox tests without tox running pip to install stuff from network into # virtualenv. %files -n python2-%{modname} %license LICENSE %doc README.rst %{python2_sitelib}/* %files -n python%{python3_pkgversion}-%{modname} %license LICENSE %doc README.rst %{python3_sitelib}/* %changelog * Sat Apr 22 2017 Eric Smith 1.5.7-1 - Initial version.