From 87aad2f50b808075e67359b4ab7c65608f08d5e480de399cc0eb59718e661640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 10 Nov 2017 19:14:45 +0000 Subject: [PATCH] Accepting request 540637 from home:mimi_vx:branches:devel:languages:python - fix build on systems without python2 OBS-URL: https://build.opensuse.org/request/show/540637 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cryptography?expand=0&rev=77 --- python-cryptography.changes | 5 +++++ python-cryptography.spec | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/python-cryptography.changes b/python-cryptography.changes index 9cf9b37..f3f2d05 100644 --- a/python-cryptography.changes +++ b/python-cryptography.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Nov 10 09:21:12 UTC 2017 - mimi.vx@gmail.com + +- fix build on systems without python2 + ------------------------------------------------------------------- Thu Nov 9 06:06:39 UTC 2017 - arun@gmx.de diff --git a/python-cryptography.spec b/python-cryptography.spec index b41ff2a..79388d4 100644 --- a/python-cryptography.spec +++ b/python-cryptography.spec @@ -16,6 +16,13 @@ # +# trick needed for build on systems without python2 +%if 0%{?have_python2} +%bcond_with py2 +%else +%bcond_without py2 +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-cryptography Version: 2.1.3 @@ -52,10 +59,6 @@ Requires: python-pyasn1 >= 0.1.8 Requires: python-setuptools >= 11.3 Requires: python-six >= 1.4.1 %requires_eq python-cffi -%ifpython2 -BuildRequires: python2-enum34 -BuildRequires: python2-ipaddress -%endif # SECTION Test requirements BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module iso8601} @@ -65,10 +68,14 @@ BuildRequires: %{python_module pyasn1 >= 0.1.8} BuildRequires: %{python_module pytest} BuildRequires: %{python_module virtualenv} # /SECTION -%ifpython2 +%if %{with py2} +%if "%python_flavor" == "python2" +BuildRequires: python2-enum34 +BuildRequires: python2-ipaddress Requires: python-enum34 Requires: python-ipaddress %endif +%endif %python_subpackages %description