Spec cleanup and reduce buildrequires

This commit is contained in:
Fabio Alessandro Locati 2016-09-01 14:29:46 +02:00
parent e0411a4362
commit 726486d087

View File

@ -1,26 +1,27 @@
%if 0%{?fedora}
%global with_python3 1
%global pypi_name decorator
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif
Name: python-decorator
Name: python-%{pypi_name}
Version: 4.0.10
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Module to simplify usage of decorators
License: BSD
URL: http://pypi.python.org/pypi/decorator/
Source0: http://pypi.python.org/packages/source/d/decorator/decorator-%{version}.tar.gz
URL: https://github.com/micheles/decorator
Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python-setuptools
BuildRequires: python2-devel
%if %{with python3}
BuildRequires: python3-setuptools
BuildRequires: python3-nose
%endif
BuildRequires: python3-devel
%endif # with python3
%description
The aim of the decorator module is to simplify the usage of decorators for
@ -38,7 +39,7 @@ the average programmer, and to popularize decorators usage giving examples
of useful decorators, such as memoize, tracing, redirecting_stdout, locked,
etc. The core of this module is a decorator factory called decorator.
%if 0%{?with_python3}
%if %{with python3}
%package -n python3-decorator
Summary: Module to simplify usage of decorators in python3
%{?python_provide:%python_provide python3-decorator}
@ -48,54 +49,48 @@ The aim of the decorator module is to simplify the usage of decorators for
the average programmer, and to popularize decorators usage giving examples
of useful decorators, such as memoize, tracing, redirecting_stdout, locked,
etc. The core of this module is a decorator factory called decorator.
%endif # if with_python3
%endif # with python3
%prep
%setup -q -n decorator-%{version}
chmod a-x *.py
%{__sed} -i 's/\r//' docs/README.rst
%autosetup -n %{pypi_name}-%{version}
%build
%{py2_build}
%if 0%{?with_python3}
%{py3_build}
%endif # with_python3
%py2_build
%if %{with python3}
%py3_build
%endif # with python3
%install
%{py2_install}
%if 0%{?with_python3}
%{py3_install}
%endif # with_python3
%py2_install
%if %{with python3}
%py3_install
%endif # with python3
%check
nosetests-%{python2_version} --with-doctest
%{__python2} setup.py test
%if %{with python3}
%{__python3} setup.py test
%endif # with python3
%if 0%{?with_python3}
nosetests-%{python3_version} --with-doctest
%endif # with_python3
%files -n python2-decorator
%doc docs/README.rst CHANGES.md documentation.pdf
%files -n python2-%{pypi_name}
%doc docs/README.rst
%license LICENSE.txt
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-decorator
%doc docs/README.rst CHANGES.md documentation.pdf
%if %{with python3}
%files -n python3-%{pypi_name}
%doc docs/README.rst
%license LICENSE.txt
%{python3_sitelib}/decorator.py
%{python3_sitelib}/decorator-*.egg-info/
%{python3_sitelib}/__pycache__/*
%endif # with_python3
%endif # with python3
%changelog
* Mon Aug 29 2016 Fabio Alessandro Locati <fale@redhat.com> - 4.0.10-3
- SPEC Cleanup
- Remove unused build requires
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.10-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages