From 885957c7b3112794ea31304d6a2790ceb44671a9 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Jun 03 2020 05:52:27 +0000 Subject: Fix FTBFS Signed-off-by: Igor Raits --- diff --git a/0001-base64.decodestring-was-finally-removed-in-Python-3..patch b/0001-base64.decodestring-was-finally-removed-in-Python-3..patch new file mode 100644 index 0000000..bee4ee8 --- /dev/null +++ b/0001-base64.decodestring-was-finally-removed-in-Python-3..patch @@ -0,0 +1,49 @@ +From 7f98fca157b50708dd2c4848886e18a198e258c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= +Date: Mon, 9 Mar 2020 13:16:53 +0100 +Subject: [PATCH] base64.decodestring() was finally removed in Python 3.8. + +--- + tests/test_x509.py | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/tests/test_x509.py b/tests/test_x509.py +index 057d7da..138af27 100644 +--- a/tests/test_x509.py ++++ b/tests/test_x509.py +@@ -15,7 +15,7 @@ import os + import time + import warnings + +-from M2Crypto import ASN1, BIO, EVP, RSA, Rand, X509, m2 # noqa ++from M2Crypto import ASN1, BIO, EVP, RSA, Rand, X509, m2, six # noqa + from tests import unittest + + log = logging.getLogger(__name__) +@@ -592,7 +592,10 @@ class X509StackTestCase(unittest.TestCase): + + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) +- seq = base64.decodestring(b64) ++ if six.PY3: ++ seq = base64.decodebytes(b64) ++ else: ++ seq = base64.decodestring(b64) + + stack = X509.new_stack_from_der(seq) + cert = stack.pop() +@@ -612,7 +615,10 @@ class X509StackTestCase(unittest.TestCase): + + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) +- seq = base64.decodestring(b64) ++ if six.PY3: ++ seq = base64.decodebytes(b64) ++ else: ++ seq = base64.decodestring(b64) + + stack = X509.new_stack_from_der(seq) + num = len(stack) +-- +2.26.2 + diff --git a/m2crypto.spec b/m2crypto.spec index 9d16f38..896bc1e 100644 --- a/m2crypto.spec +++ b/m2crypto.spec @@ -13,6 +13,8 @@ Source0: %{pypi_source M2Crypto} # Backport from upstream ## From: https://gitlab.com/m2crypto/m2crypto/-/commit/d3a43ffe1bfe4c128d6ab7c390419dee68f4ca5a Patch0001: 0001-wrap-SocketIO-in-io.Buffered-for-makefile.patch +## From: https://gitlab.com/m2crypto/m2crypto/-/commit/7f98fca157b50708dd2c4848886e18a198e258c3 +Patch0002: 0001-base64.decodestring-was-finally-removed-in-Python-3..patch BuildRequires: gcc BuildRequires: openssl