Fix FTBFS (Debian Bug #804430)

epel9
Paul Howarth 9 years ago
parent 3bb3429db2
commit 569b43b026

@ -8,37 +8,44 @@
Name: python-rsa
Version: 3.1.4
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Pure-Python RSA implementation
License: ASL 2.0
URL: http://stuvel.eu/rsa
Source0: https://pypi.python.org/packages/source/r/rsa/%{pkgname}-%{version}.tar.gz
Patch0: rsa-3.1.4-debian-804430.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-pyasn1 >= 0.1.3
BuildRequires: python-unittest2
Requires: python-pyasn1 >= 0.1.3
%if %with python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1 >= 0.1.3
%endif
%description
Pure-Python RSA implementation.
%if %with python3
%package -n python3-rsa
Summary: Pure-Python RSA implementation
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1 >= 0.1.3
BuildRequires: python3-unittest2
Requires: python3-pyasn1 >= 0.1.3
%description -n python3-rsa
Pure-Python RSA implementation for Python 3.
%endif
%prep
%setup -q -n %{pkgname}-%{version}
# Fix FTBFS (Debian Bug #804430)
%patch0
# Get rid of upstream's egg-info, we'll use our own
rm -rf %{pkgname}-*.egg-info
%if %with python3
@ -73,7 +80,7 @@ pushd %{py3dir}
popd
%endif
%{__python2} setup.py test
%{__python2} run_tests.py
%files
%if 0%{?_licensedir:1}
@ -100,6 +107,10 @@ popd
%endif
%changelog
* Tue Dec 8 2015 Paul Howarth <paul@city-fan.org> - 3.1.4-3
- Fix FTBFS (Debian Bug #804430)
- Run the tests for both python2 and python3
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

@ -0,0 +1,38 @@
--- rsa/_version133.py
+++ rsa/_version133.py
@@ -18,7 +18,12 @@ __version__ = '1.3.3'
# NOTE: Python's modulo can return negative numbers. We compensate for
# this behaviour using the abs() function
-from cPickle import dumps, loads
+try:
+ import cPickle as pickle
+except:
+ import pickle
+from pickle import dumps, loads
+
import base64
import math
import os
--- tests/constants.py
+++ tests/constants.py
@@ -3,7 +3,7 @@
from rsa._compat import have_python3
if have_python3:
- from py3kconstants import *
+ from tests.py3kconstants import *
else:
from py2kconstants import *
--- tests/test_strings.py
+++ tests/test_strings.py
@@ -6,7 +6,7 @@ import unittest2
import rsa
-from constants import unicode_string
+from tests.constants import unicode_string
class StringTest(unittest2.TestCase):
Loading…
Cancel
Save