[packages/python-fido2] - new

qboosh qboosh at pld-linux.org
Sun May 20 21:22:13 CEST 2018


commit 7fb26094af14eb2c01975ebc6b5b0cd29999b318
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun May 20 21:22:57 2018 +0200

    - new

 python-fido2-mock.patch |  57 ++++++++++++++++++++
 python-fido2.spec       | 137 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 194 insertions(+)
---
diff --git a/python-fido2.spec b/python-fido2.spec
new file mode 100644
index 0000000..a8ee633
--- /dev/null
+++ b/python-fido2.spec
@@ -0,0 +1,137 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
+Summary:	Python 2 based FIDO 2.0 library
+Summary(pl.UTF-8):	Biblioteka FIDO 2.0 dla Pythona 2
+Name:		python-fido2
+Version:	0.3.0
+Release:	1
+# Yubico code is BSD licensed; includes also:
+# pyudf (Apache 2.0)
+# public suffix list (MPL 2.0)
+License:	BSD, Apache v2.0, MPL v2.0
+Group:		Libraries/Python
+#Source0Download: https://github.com/Yubico/python-fido2/releases
+Source0:	https://github.com/Yubico/python-fido2/releases/download/%{version}/fido2-%{version}.tar.gz
+# Source0-md5:	405448c93d5697ad18470171991edacf
+Patch0:		%{name}-mock.patch
+URL:		https://developers.yubico.com/python-fido2/
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-cryptography >= 1.0
+BuildRequires:	python-mock >= 1.0.1
+BuildRequires:	python-pyfakefs >= 2.4
+BuildRequires:	python-six
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.4
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-cryptography >= 1.0
+BuildRequires:	python3-pyfakefs >= 2.4
+BuildRequires:	python3-six
+%endif
+%endif
+Requires:	python-cryptography >= 1.0
+Requires:	python-modules >= 1:2.7
+Requires:	python-six
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package provides library functionality for communicating with a
+FIDO device over USB as well as verifying attestation and assertion
+signatures.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera bibliotekę funkcji do komunikacji z urządzeniami
+FIDO po USB, a także weryfikowania podpisów poświadczeń i zapewnień.
+
+%package -n python3-fido2
+Summary:	Python 3 based FIDO 2.0 library
+Summary(pl.UTF-8):	Biblioteka FIDO 2.0 dla Pythona 3
+Group:		Libraries/Python
+Requires:	python3-cryptography >= 1.0
+Requires:	python3-modules >= 1:3.4
+Requires:	python3-six
+
+%description -n python3-fido2
+This package provides library functionality for communicating with a
+FIDO device over USB as well as verifying attestation and assertion
+signatures.
+
+%description -n python3-fido2 -l pl.UTF-8
+Ten pakiet zawiera bibliotekę funkcji do komunikacji z urządzeniami
+FIDO po USB, a także weryfikowania podpisów poświadczeń i zapewnień.
+
+%prep
+%setup -q -n fido2-%{version}
+%patch0 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+%{__python} -m unittest discover -s test
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m unittest discover -s test
+%endif
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%if %{with python2}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-fido2-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-fido2-%{version}
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-fido2-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-fido2-%{version}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc COPYING NEWS README.adoc
+%{py_sitescriptdir}/fido2
+%{py_sitescriptdir}/fido2-%{version}-py*.egg-info
+%{_examplesdir}/python-fido2-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-fido2
+%defattr(644,root,root,755)
+%doc COPYING NEWS README.adoc
+%{py3_sitescriptdir}/fido2
+%{py3_sitescriptdir}/fido2-%{version}-py*.egg-info
+%{_examplesdir}/python3-fido2-%{version}
+%endif
diff --git a/python-fido2-mock.patch b/python-fido2-mock.patch
new file mode 100644
index 0000000..2dd2b24
--- /dev/null
+++ b/python-fido2-mock.patch
@@ -0,0 +1,57 @@
+--- fido2-0.3.0/test/test_client.py.orig	2018-04-05 14:24:00.000000000 +0200
++++ fido2-0.3.0/test/test_client.py	2018-05-20 21:11:47.066881551 +0200
+@@ -29,8 +29,11 @@
+ 
+ from __future__ import absolute_import, unicode_literals
+ 
+-import mock
+ import unittest
++try:
++    import mock
++except:
++    from unittest import mock
+ from threading import Event
+ from binascii import a2b_hex
+ from fido2.utils import sha256, websafe_decode
+--- fido2-0.3.0/test/test_ctap1.py.orig	2018-04-05 14:24:00.000000000 +0200
++++ fido2-0.3.0/test/test_ctap1.py	2018-05-20 21:12:03.176881487 +0200
+@@ -31,7 +31,10 @@ from fido2.ctap1 import CTAP1, ApduError
+ from fido2.client import ClientData
+ from binascii import a2b_hex
+ import unittest
+-import mock
++try:
++    import mock
++except:
++    from unittest import mock
+ 
+ 
+ class TestCTAP1(unittest.TestCase):
+--- fido2-0.3.0/test/test_ctap2.py.orig	2018-04-12 17:10:24.000000000 +0200
++++ fido2-0.3.0/test/test_ctap2.py	2018-05-20 21:12:17.790214668 +0200
+@@ -37,7 +37,10 @@ from cryptography.hazmat.backends import
+ from cryptography.hazmat.primitives.asymmetric import ec
+ 
+ import unittest
+-import mock
++try:
++    import mock
++except:
++    from unittest import mock
+ 
+ _AAGUID = a2b_hex('F8A011F38C0A4D15800617111F9EDC7D')
+ _INFO = a2b_hex('a60182665532465f5632684649444f5f325f3002826375766d6b686d61632d7365637265740350f8a011f38c0a4d15800617111f9edc7d04a462726bf5627570f564706c6174f469636c69656e7450696ef4051904b0068101')  # noqa
+--- fido2-0.3.0/test/test_hid.py.orig	2018-04-05 14:24:00.000000000 +0200
++++ fido2-0.3.0/test/test_hid.py	2018-05-20 21:12:31.910214473 +0200
+@@ -30,7 +30,10 @@ from __future__ import absolute_import,
+ from fido2.ctap import CtapError
+ from fido2.hid import CtapHidDevice
+ import unittest
+-import mock
++try:
++    import mock
++except:
++    from unittest import mock
+ 
+ 
+ class HidTest(unittest.TestCase):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-fido2.git/commitdiff/7fb26094af14eb2c01975ebc6b5b0cd29999b318



More information about the pld-cvs-commit mailing list