Accepting request 731222 from devel:languages:python

- Add patch to fix the pyasn version conflict:
  * 0001-Fixes-output-value-changes-between-older-and-newer-p.patch

OBS-URL: https://build.opensuse.org/request/show/731222
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-keyczar?expand=0&rev=8
This commit is contained in:
2019-09-17 11:37:46 +00:00
committed by Git OBS Bridge
3 changed files with 50 additions and 16 deletions

View File

@@ -0,0 +1,30 @@
From: =?utf-8?q?Pierre-Elliott_B=C3=A9cue?= <becue@crans.org>
Date: Tue, 20 Feb 2018 11:58:06 +0100
Subject: Fixes output value changes between older and newer pyasn versions
---
src/keyczar/util.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/keyczar/util.py b/src/keyczar/util.py
index 9e6f217..006eadb 100644
--- a/src/keyczar/util.py
+++ b/src/keyczar/util.py
@@ -172,8 +172,7 @@ def ParseX509(x509):
if len(seq) != 2: # need two fields in SubjectPublicKeyInfo
raise errors.KeyczarError("Illegal X.509 String.")
[oid, alg_params] = ParseASN1Sequence(seq[0])
- pubkey = decoder.decode(univ.OctetString(BinToBytes(seq[1].
- prettyPrint()[2:-3])))[0]
+ pubkey = decoder.decode(univ.OctetString(BinToBytes(seq[1])))[0]
# Component 1 should be a BIT STRING, get raw bits by discarding extra chars,
# then convert to OCTET STRING which can be ASN.1 decoded
params = {}
@@ -251,6 +250,7 @@ def MakeEmsaMessage(msg, modulus_size):
def BinToBytes(bits):
"""Convert bit string to byte string."""
+ bits = str(bits)
bits = _PadByte(bits)
octets = [bits[8 * i:8 * (i + 1)] for i in range(len(bits) / 8)]
return "".join([chr(int(x, 2)) for x in octets])

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 16 09:40:33 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix the pyasn version conflict:
* 0001-Fixes-output-value-changes-between-older-and-newer-p.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 4 12:49:47 UTC 2018 - Matej Cepl <mcepl@suse.com> Tue Dec 4 12:49:47 UTC 2018 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-keyczar # spec file for package python-keyczar
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -19,28 +19,26 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{!?license: %global license %doc} %{!?license: %global license %doc}
%define pkgname keyczar %define pkgname keyczar
%bcond_without test
Name: python-keyczar Name: python-keyczar
Version: 0.716 Version: 0.716
Release: 0 Release: 0
Summary: Python toolkit for cryptography Summary: Python toolkit for cryptography
License: Apache-2.0 License: Apache-2.0
Group: Development/Languages/Python Group: Development/Languages/Python
Url: http://www.keyczar.org URL: http://www.keyczar.org
Source0: https://github.com/google/%pkgname/archive/Python_release_%{version}.tar.gz Source0: https://github.com/google/%{pkgname}/archive/Python_release_%{version}.tar.gz
Source1: keyczart.1 Source1: keyczart.1
BuildRequires: %{python_module setuptools} Patch0: 0001-Fixes-output-value-changes-between-older-and-newer-p.patch
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module pyasn1} BuildRequires: %{python_module pyasn1}
BuildRequires: %{python_module pycrypto >= 2.0} BuildRequires: %{python_module pycrypto >= 2.0}
%endif BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pyasn1 Requires: python-pyasn1
Requires: python-pycrypto >= 2.0 Requires: python-pycrypto >= 2.0
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
%description %description
@@ -54,12 +52,14 @@ asymmetric keys. Some features of Keyczar include:
%prep %prep
%setup -q -n %{pkgname}-Python_release_%{version}/python %setup -q -n %{pkgname}-Python_release_%{version}/python
%patch0 -p1
%build %build
%{python_build} %python_build
%install %install
%{python_install} %python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
install -Dm644 %{SOURCE1} %{buildroot}%{_mandir}/man1/keyczart.1 install -Dm644 %{SOURCE1} %{buildroot}%{_mandir}/man1/keyczart.1
%python_clone -a %{buildroot}%{_bindir}/keyczart %python_clone -a %{buildroot}%{_bindir}/keyczart
%python_clone -a %{buildroot}%{_mandir}/man1/keyczart.1 %python_clone -a %{buildroot}%{_mandir}/man1/keyczart.1
@@ -74,13 +74,11 @@ install -Dm644 %{SOURCE1} %{buildroot}%{_mandir}/man1/keyczart.1
%check %check
export PYTHONPATH=$(pwd)/build/lib export PYTHONPATH=$(pwd)/build/lib
pushd tests/keyczar_tests pushd tests/keyczar_tests
# Upstream bugreport on the failing test case: https://github.com/google/keyczar/issues/209 %python_exec alltests.py
%{python_exec alltests.py || :}
popd popd
%endif %endif
%files %{python_files} %files %{python_files}
%defattr(-,root,root)
%doc README PKG-INFO doc/ %doc README PKG-INFO doc/
%license LICENSE %license LICENSE
%python_alternative %{_mandir}/man1/keyczart.1%{ext_man} %python_alternative %{_mandir}/man1/keyczart.1%{ext_man}