#13 Enable python3 subpackage
Merged 4 years ago by ignatenkobrain. Opened 4 years ago by ignatenkobrain.
rpms/ ignatenkobrain/ansible epel7-py3  into  epel7

file modified
+17 -191
@@ -3,39 +3,14 @@ 

  # Please modify it alone and do not merge master or 

  # any other branches into it. 

  #

- # RHEL 6 didn't have a __python2 macro.

- # Amazon Linux 2015.9 is based on RHEL6, with /usr/bin/python2 -> python2.6, while

- # /usr/bin/python -> python2.7.  Explicitly use python2.6.

- %if 0%{?rhel} == 6 || 0%{?rhel} == 5

- %global __python2 /usr/bin/python2.6

- %endif

- 

- # RHEL 6 and 7 do not have BuildRequires to build docs

- # Fedora 27 and older have too old a jinja2 to build docs

- %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8

- %global with_docs 1

- %else

  %global with_docs 0

- %endif

- 

- # Build Fedora and RHEL larger than 7 with python3

- %if 0%{?fedora} || 0%{?rhel} >= 8

  %global with_python3 1

- %else

- %global with_python3 0

- %endif

- 

- # Fedora 29+ and RHEL larger than 7 no python2, python3 default

- %if 0%{?fedora} >= 29 || 0%{?rhel} >= 8

- %global with_python2 0

- %else

  %global with_python2 1

- %endif

  

  Name: ansible

  Summary: SSH-based configuration management, deployment, and task execution system

  Version: 2.9.6

- Release: 1%{?dist}

+ Release: 2%{?dist}

  

  License: GPLv3+

  Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz
@@ -66,98 +41,20 @@ 

  Obsoletes: ansible-fireball < 1.2.4

  

  %if 0%{?with_python2}

- %if 0%{?rhel} && 0%{?rhel} <= 5

- # On RHEL6 use the python26 stack

- BuildRequires: python26-devel

- Requires: python26-PyYAML

- Requires: python26-paramiko

- Requires: python26-jinja2

- %endif

  

  BuildRequires: python2-devel

- BuildRequires: python-setuptools

- 

- # For building docs/tests

- BuildRequires: git-core

- 

- # For tests

- # We don't run tests on epel6, so don't bother pulling these in there.

- %if (0%{?fedora} ||  0%{?rhel} > 6)

- BuildRequires: PyYAML

- BuildRequires: python2-cryptography

- BuildRequires: python2-crypto

- BuildRequires: python-paramiko

- BuildRequires: python-six

- BuildRequires: python-nose

- BuildRequires: python-coverage

- BuildRequires: python-requests

- BuildRequires: python-mock

- BuildRequires: python-boto3

- BuildRequires: python-botocore

- BuildRequires: python-passlib

- %if 0%{?fedora}

- # Fedora only docs building

- BuildRequires: python3-sphinx-theme-alabaster

- %endif

- # rhel7 does not have python-pytest but has pytest

- %if 0%{?rhel} == 7

- BuildRequires: pytest

- BuildRequires: python2-sphinx-theme-alabaster

- BuildRequires: python-straight-plugin

- %else

- BuildRequires: python-pytest

- BuildRequires: python-pytest-xdist

- BuildRequires: python-pytest-mock

- BuildRequires: python-packaging

- BuildRequires: python2-pexpect

- BuildRequires: python2-winrm

- %endif

- %endif

- 

- %if (0%{?rhel} && 0%{?rhel} <= 6)

- # Ansible will work with the jinja2 shipped with RHEL6 but users can gain

- # additional jinja features by using the newer version

- Requires: python-jinja2-26

- BuildRequires: python-jinja2-26

- 

- # Distros with python < 2.7.0

- BuildRequires: python-unittest2

- 

- %else

- Requires: python-jinja2

- BuildRequires: python-jinja2

- %endif

- 

+ BuildRequires: python2-setuptools

  Requires: PyYAML

  Requires: python2-cryptography

  Requires: python-paramiko

  Requires: python-httplib2

  Requires: python-setuptools

  Requires: python-six

+ Requires: python-jinja2

  Requires: sshpass

  

- %if (0%{?fedora} ||  0%{?rhel} > 6)

  # needed for json_query filter

- # but avoid on rhel6 due to amazon linux conflicts

  Requires: python2-jmespath

- %endif

- 

- %if 0%{?rhel} == 6

- # RHEL 6 needs a newer version of the pycrypto library for the ansible-vault

- # command.  Note: If other pieces of ansible also grow to need pycrypto you may

- # need to add: Requires: python-crypto or patch the other pieces of ansible to

- # make use of this forward compat package (see the patch for ansible-vault

- # above to see what needs to be done.)

- Requires: python-crypto2.6

- # The python-2.6 stdlib json module has a bug that affects the ansible

- # to_nice_json filter

- Requires: python-simplejson

- 

- # For testing

- BuildRequires: python-crypto2.6

- BuildRequires: python-simplejson

- %endif

- 

  

  %description

  Ansible is a radically simple model-driven configuration management,
@@ -188,58 +85,20 @@ 

  Obsoletes:     ansible-python3 < %{version}-%{release}

  %endif

  

- BuildRequires: python3-devel

- BuildRequires: python3-setuptools

- 

- # For tests

- BuildRequires: python3-PyYAML

- BuildRequires: python3-paramiko

- BuildRequires: python3-cryptography

- BuildRequires: python3-crypto

- BuildRequires: python3-pbkdf2

- BuildRequires: python3-packaging

- BuildRequires: python3-pexpect

- BuildRequires: python3-winrm

- BuildRequires: python3-httmock

- BuildRequires: python3-gitlab

- 

- # For Docs/tests

- BuildRequires: git-core

- %if %with_docs

- BuildRequires: python3-sphinx

- BuildRequires: python3-sphinx-theme-alabaster

- BuildRequires: python3-sphinx-notfound-page

- BuildRequires: asciidoc

- %endif

+ BuildRequires: python%{python3_pkgversion}-devel

+ BuildRequires: python%{python3_pkgversion}-setuptools

+ Requires: python%{python3_pkgversion}-PyYAML

+ Requires: python%{python3_pkgversion}-paramiko

+ Requires: python%{python3_pkgversion}-cryptography

  # accelerate is the only thing that makes keyczar mandatory.  Since accelerate

  # is deprecated, just ignore it

- #BuildRequires: python-keyczar

- BuildRequires: python3-six

- BuildRequires: python3-nose

- BuildRequires: python3-pytest

- BuildRequires: python3-pytest-xdist

- BuildRequires: python3-pytest-mock

- BuildRequires: python3-requests

- BuildRequires: python3-coverage

- BuildRequires: python3-mock

- BuildRequires: python3-boto3

- BuildRequires: python3-botocore

- BuildRequires: python3-passlib

- BuildRequires: python3-jinja2

- 

- Requires: python3-PyYAML

- Requires: python3-paramiko

- Requires: python3-cryptography

- # accelerate is the only thing that makes keyczar mandatory.  Since accelerate

- # is deprecated, just ignore it

- #Requires: python3-keyczar

- Requires: python3-setuptools

- Requires: python3-six

- Requires: python3-jinja2

+ #Requires: python%{python3_pkgversion}-keyczar

+ Requires: python%{python3_pkgversion}-setuptools

+ Requires: python%{python3_pkgversion}-six

+ Requires: python%{python3_pkgversion}-jinja2

  Requires: sshpass

  # needed for json_query filter

- Requires: python3-jmespath

- 

+ Requires: python%{python3_pkgversion}-jmespath

  

  %if 0%{?with_python2}

  %description -n ansible-python3
@@ -276,9 +135,6 @@ 

  %patch0 -p1

  %patch1 -p1

  %patch2 -p1

- %if 0%{?rhel} == 6

- %patch100 -p1

- %endif

  

  %if 0%{?with_python3}

  rm -rf %{py3dir}
@@ -297,19 +153,15 @@ 

  

  %if %with_docs

   # Fedora 26 does not have pathfix, so build docs with python2

-  %if (0%{?fedora} == 26)

-   make PYTHON=/usr/bin/python2 webdocs

-  %else

    pathfix.py -i %{__python3} -p docs/bin test/runner

    make PYTHON=/usr/bin/python3 SPHINXBUILD=sphinx-build-3 webdocs

-  %endif

  %endif

  

  popd

  %endif

  # with_python3

  

- %if ! %with_docs && ( 0%{?fedora} || 0%{?rhel} >= 7)

+ %if ! %with_docs

   # Generate the rst docs from the source if they weren't generated earlier as

   # part of the html docs build. 

   # This is broken right now because it needs python3 and python3-straight-plugin
@@ -402,35 +254,6 @@ 

  %endif

  

  

- %check

- # RHEL <= 6 doesn't have a new enough python-mock to run the tests

- # Currently RHEL <= 7 doesn't have pytest-xdist or a new enough pytest

- # Fedora 25 doesn't have a new enough pytest

- %if 0%{?with_python2} && 0%{?fedora} >= 26

- ln -s /usr/bin/pytest bin/pytest

- make PYTHON=/usr/bin/python2 tests

- %endif

- # New enough Fedora with python2

- 

- %if 0%{?with_python3}

- pushd %{py3dir}

- ln -s /usr/bin/pytest-3 bin/pytest

- pathfix.py -i %{__python3} -p test/runner

- pathfix.py -i %{__python3} -p bin/ansible-test

- # This test needs a module not packaged in Fedora so disable it.

- rm -f test/units/modules/cloud/cloudstack/test_cs_traffic_type.py

- %if 0%{?fedora} < 30 

- # In fedora 29 and eariler, python-gitlab is too old to run these tests

- rm -f test/units/modules/source_control/test_gitlab_user.py

- rm -f test/units/modules/source_control/test_gitlab_runner.py

- %endif

- make PYTHON=/usr/bin/python3 tests-py3

- 

- popd

- %endif

- # python3

- 

- 

  %files

  %if 0%{?with_python2}

  %{python2_sitelib}/ansible*
@@ -465,6 +288,9 @@ 

  %endif

  

  %changelog

+ * Sun Apr 05 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 2.9.6-2

+ - Enable python3 subpackage

+ 

  * Fri Mar 06 2020 Kevin Fenzi <kevin@scrye.com> - 2.9.6-1

  - Update to 2.9.6. Fixes bug #1810373

  - fixes for CVE-2020-1737, CVE-2020-1739

rebased onto d131f65

4 years ago

Seems fine to me. Once python-jmespath is sorted this should be good to land as far as I am concerened.

Thanks for working on it.

Thanks for review! I already built jmespath, so I'll build this and send in one update.

Pull-Request has been merged by ignatenkobrain

4 years ago