%if 0%{?fedora} > 12
%bcond_without python3
%else
%bcond_with python3
%endif
%global pypi_name roman
Name: python-%{pypi_name}
Version: 2.0.0
Release: 1%{?dist}
Summary: Integer to Roman numerals converter
License: Python
URL: http://pypi.python.org/pypi/roman
Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.zip
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%description
Integer to Roman numerals converter
%if %{with python3}
%package -n python3-%{pypi_name}
Summary: Integer to Roman numerals converter
%description -n python3-%{pypi_name}
Integer to Roman numerals converter
%endif
%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
%check
%if %{with python3}
%{__python3} setup.py test
%endif
%{__python2} setup.py test
%files
%doc
%{python2_sitelib}/%{pypi_name}.py*
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python_version}.egg-info
%if %{with python3}
%files -n python3-%{pypi_name}
%{python3_sitelib}/%{pypi_name}.py*
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/__pycache__/%{pypi_name}.cpython-??.py?
%endif
%changelog
* Fri Oct 24 2014 Matthias Runge <mrunge@redhat.com> - 2.0.0-1
- Initial package (rhbz#1156409).