%define with_python2 1 %define with_python3 0 %if 0%{?fedora} > 18 %define with_python3 1 %endif Summary: The gerrymander gerrit client tools Name: gerrymander Version: 1.3 Release: 2%{?dist} Source0: https://github.com/berrange/%{name}/archive/v%{version}.tar.gz Url: http://github.com/berrange/gerrymander License: ASL 2.0 Group: Development/Libraries Requires: python3-gerrymander BuildArch: noarch %if %{with_python2} BuildRequires: python BuildRequires: python-nose %endif %if %{with_python3} BuildRequires: python3 BuildRequires: python3-nose BuildRequires: python3-devel %endif %if %{with_python2} %package -n python-gerrymander Summary: The gerrymander python2 gerrit client Url: http://github.com/berrange/gerrymander License: GPLv2+ Group: Development/Libraries %endif %if %{with_python3} %package -n python3-gerrymander Summary: The gerrymander python3 gerrit client Url: http://github.com/berrange/gerrymander License: GPLv2+ Group: Development/Libraries %endif %description The gerrymander package provides a set of command line tools for interacting with Gerrit %if %{with_python2} %description -n python-gerrymander The python2-gerrymander package provides a set of python2 modules for interacting with Gerrit. %endif %if %{with_python3} %description -n python3-gerrymander The python3-gerrymander package provides a set of python3 modules for interacting with Gerrit. %endif %prep %setup -q # Remove any egg info (as of writing this, there's no bundled egg info) rm -rf *.egg-info %build %if %{with_python2} %{__python2} setup.py build %endif %if %{with_python3} echo ${_python3} %{__python3} setup.py build %endif %install %if %{with_python2} %{__python2} setup.py install --skip-build --root=%{buildroot} %endif %if %{with_python3} %{__python3} setup.py install --skip-build --root=%{buildroot} %endif %check %if %{with_python2} %{__python2} setup.py test %endif %if %{with_python3} %{__python3} setup.py test %endif %files %defattr(-,root,root) %doc conf/gerrymander.conf-example %{_bindir}/gerrymander %if %{with_python2} %files -n python-gerrymander %doc README LICENSE %{python_sitelib}/gerrymander/*.py* %endif %if %{with_python3} %files -n python3-gerrymander %doc README LICENSE %{python3_sitelib}/gerrymander/*.py* %{python3_sitelib}/gerrymander/__pycache__/*.cpython-*.py* %endif %changelog * Mon Aug 18 2014 Kashyap Chamarthy - 1.3.2 - Address review comments from rhbz# 1128253 * Tue Aug 05 2014 Kashyap Chamarthy - 1.3-1 - Initial package