%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: 1%{?dist}%{?extra_release} Source0: %{name}-%{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 python3 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 %build %if %{with_python2} CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %endif %if %{with_python3} echo ${_python3} CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build %endif %install %if %{with_python2} %{__python} setup.py install --skip-build --root=%{buildroot} rm -rf %{buildroot}%{python_sitelib}/*egg-info %endif %if %{with_python3} %{__python3} setup.py install --skip-build --root=%{buildroot} rm -rf %{buildroot}%{python3_sitelib}/*egg-info %endif %check %if %{with_python2} %{__python} 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 %defattr(-,root,root) %doc README LICENSE %{python_sitelib}/gerrymander/*.py* %endif %if %{with_python3} %files -n python3-gerrymander %defattr(-,root,root) %doc README LICENSE %{python3_sitelib}/gerrymander/*.py* %{python3_sitelib}/gerrymander/__pycache__/*.cpython-*.py* %endif %changelog * Tue Aug 05 2014 Kashyap Chamarthy - 1.3-1 - Initial package