Blob Blame History Raw
%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:        9%{?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

%global _description\
Integer to Roman numerals converter

%description %_description

%package -n python2-%{pypi_name}
Summary: %summary
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name} %_description

%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 -n python2-%{pypi_name}
%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-*
%endif

%changelog
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.0.0-9
- Python 2 binary package renamed to python2-roman
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-6
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Oct 24 2014 Matthias Runge <mrunge@redhat.com> - 2.0.0-1
- Initial package (rhbz#1156409).