%global srcname speg %global commit 877acddfd5ac5ae8b4a4592d045e74e108477643 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: python-%{srcname} Version: 0.3 Release: 1.git%{shortcommit}%{?dist} Summary: A PEG-based parser interpreter with memoization (in time) License: MIT URL: https://github.com/avakar/speg Source0: https://github.com/avakar/speg/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildArch: noarch %description A PEG-based parser interpreter with memoization. %package -n python2-%{srcname} Summary: %{summary} BuildRequires: python2-devel, python2-six Requires: python2-six %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} A PEG-based parser interpreter with memoization. %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel, python3-six Requires: python3-six %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} A PEG-based parser interpreter with memoization. %prep %autosetup -n %{srcname}-%{commit} %build %py2_build %py3_build %install %py2_install %py3_install # Note that there is no %%files section for the unversioned python module %files -n python2-%{srcname} %license LICENSE %doc README.md %{python2_sitelib}/%{srcname}-*.egg-info/ %{python2_sitelib}/%{srcname}/ %files -n python3-%{srcname} %license LICENSE %doc README.md %{python3_sitelib}/%{srcname}-*.egg-info/ %{python3_sitelib}/%{srcname}/ %changelog * Wed Jan 2 2019 Tom Callaway - 0.3-1.git877acdd - new package