diff --git a/python-docopt.spec b/python-docopt.spec index db76713..ef28017 100644 --- a/python-docopt.spec +++ b/python-docopt.spec @@ -1,33 +1,22 @@ -%global pypi_name docopt -%global sum Pythonic argument parser, that will make you smile -# Python 3 only for Fedora for now. -%if 0%{?fedora} > 12 -%global with_python3 1 +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 +%else +%bcond_without python3 %endif +%global pypi_name docopt + Name: python-docopt Version: 0.6.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Pythonic argument parser, that will make you smile License: MIT URL: https://github.com/docopt/docopt -Source0: http://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-setuptools -BuildRequires: python2-nose -BuildRequires: pytest - -%if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-nose -BuildRequires: python3-pytest -%endif # if with_python3 - %description Isn't it awesome how optparse and argparse generate help messages based on your code?! @@ -37,14 +26,12 @@ generated based on the beautiful help message that you write yourself! This way you don't need to write thisstupid repeatable parser-code, and instead can write only the help message--*the way you want it*. - %package -n python2-%{pypi_name} -Summary: %{sum} +Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} -Requires: python2-devel -Requires: python2-setuptools -Requires: python2-nose -Requires: pytest +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-pytest %description -n python2-%{pypi_name} Isn't it awesome how optparse and argparse generate help messages @@ -55,15 +42,15 @@ generated based on the beautiful help message that you write yourself! This way you don't need to write thisstupid repeatable parser-code, and instead can write only the help message--*the way you want it*. +Python 2 version. -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{pypi_name} -Summary: %{sum} +Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} -Requires: python3-devel -Requires: python3-setuptools -Requires: python3-nose -Requires: python3-pytest +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest %description -n python3-%{pypi_name} Isn't it awesome how optparse and argparse generate help messages @@ -73,44 +60,53 @@ Hell no! You know what's awesome? It's when the option parser is generated based on the beautiful help message that you write yourself! This way you don't need to write thisstupid repeatable parser-code, and instead can write only the help message--*the way you want it*. -%endif # if with_python3 +Python 3 version. +%endif %prep -%setup -q -n %{pypi_name}-%{version} +%autosetup -n %{pypi_name}-%{version} %build %py2_build -%if 0%{?with_python3} +%if %{with python3} %py3_build -%endif # if with_python3 +%endif %install %py2_install -%if 0%{?with_python3} +%if %{with python3} %py3_install -%endif # if with_python3 +%endif %check -%{__python2} setup.py test -%if 0%{?with_python3} -%{__python3} setup.py test -%endif # if with_python3 +py.test-%{python2_version} -v +%if %{with python3} +py.test-%{python3_version} -v +%endif %files -n python2-%{pypi_name} %license LICENSE-MIT %doc README.rst -%{python2_sitelib}/* +%{python2_sitelib}/%{pypi_name}-*.egg-info/ +%{python2_sitelib}/%{pypi_name}.py* -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{pypi_name} %license LICENSE-MIT %doc README.rst -%{python3_sitelib}/* -%endif # if with_python3 - +%{python3_sitelib}/%{pypi_name}-*.egg-info/ +%{python3_sitelib}/%{pypi_name}.py +%{python3_sitelib}/__pycache__/%{pypi_name}.* +%endif %changelog +* Fri Dec 16 2016 Igor Gnatenko - 0.6.2-3 +- Don't own __pycache__ directory in python3 subpackage +- Really run tests (setup.py test doesn't do anything) +- Drop copy-pasted Requires (RHBZ #1405639) +- Trivial cleanups + * Tue Jul 19 2016 Fedora Release Engineering - 0.6.2-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index 06126b8..7c4a6a3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4bc74561b37fad5d3e7d037f82a4c3b1 docopt-0.6.2.tar.gz +SHA512 (docopt-0.6.2.tar.gz) = 228661924329682786b143f414c9df911016963cdc91ae6eba833285144e71744df507321a476b51f779e3ea270af6dc4e50edb8b0ee99674c19acccaab57a03