]>
Commit | Line | Data |
---|---|---|
7fb26094 JB |
1 | # |
2 | # Conditional build: | |
20594f9d | 3 | %bcond_with tests # unit tests |
7fb26094 JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Python 2 based FIDO 2.0 library | |
8 | Summary(pl.UTF-8): Biblioteka FIDO 2.0 dla Pythona 2 | |
9 | Name: python-fido2 | |
591dbe06 | 10 | Version: 0.9.1 |
5a96f4b9 | 11 | Release: 4 |
7fb26094 JB |
12 | # Yubico code is BSD licensed; includes also: |
13 | # pyudf (Apache 2.0) | |
14 | # public suffix list (MPL 2.0) | |
15 | License: BSD, Apache v2.0, MPL v2.0 | |
16 | Group: Libraries/Python | |
17 | #Source0Download: https://github.com/Yubico/python-fido2/releases | |
18 | Source0: https://github.com/Yubico/python-fido2/releases/download/%{version}/fido2-%{version}.tar.gz | |
591dbe06 | 19 | # Source0-md5: bf661f7949a057440e52aad6595a24fa |
7fb26094 JB |
20 | Patch0: %{name}-mock.patch |
21 | URL: https://developers.yubico.com/python-fido2/ | |
22 | BuildRequires: rpm-pythonprov | |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
24 | %if %{with python2} | |
25 | BuildRequires: python-modules >= 1:2.7 | |
26 | BuildRequires: python-setuptools | |
27 | %if %{with tests} | |
28 | BuildRequires: python-cryptography >= 1.0 | |
29 | BuildRequires: python-mock >= 1.0.1 | |
30 | BuildRequires: python-pyfakefs >= 2.4 | |
31 | BuildRequires: python-six | |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-modules >= 1:3.4 | |
36 | BuildRequires: python3-setuptools | |
37 | %if %{with tests} | |
38 | BuildRequires: python3-cryptography >= 1.0 | |
39 | BuildRequires: python3-pyfakefs >= 2.4 | |
40 | BuildRequires: python3-six | |
41 | %endif | |
42 | %endif | |
43 | Requires: python-cryptography >= 1.0 | |
44 | Requires: python-modules >= 1:2.7 | |
45 | Requires: python-six | |
46 | BuildArch: noarch | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | This package provides library functionality for communicating with a | |
51 | FIDO device over USB as well as verifying attestation and assertion | |
52 | signatures. | |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | Ten pakiet zawiera bibliotekę funkcji do komunikacji z urządzeniami | |
56 | FIDO po USB, a także weryfikowania podpisów poświadczeń i zapewnień. | |
57 | ||
58 | %package -n python3-fido2 | |
59 | Summary: Python 3 based FIDO 2.0 library | |
60 | Summary(pl.UTF-8): Biblioteka FIDO 2.0 dla Pythona 3 | |
61 | Group: Libraries/Python | |
62 | Requires: python3-cryptography >= 1.0 | |
63 | Requires: python3-modules >= 1:3.4 | |
64 | Requires: python3-six | |
65 | ||
66 | %description -n python3-fido2 | |
67 | This package provides library functionality for communicating with a | |
68 | FIDO device over USB as well as verifying attestation and assertion | |
69 | signatures. | |
70 | ||
71 | %description -n python3-fido2 -l pl.UTF-8 | |
72 | Ten pakiet zawiera bibliotekę funkcji do komunikacji z urządzeniami | |
73 | FIDO po USB, a także weryfikowania podpisów poświadczeń i zapewnień. | |
74 | ||
75 | %prep | |
76 | %setup -q -n fido2-%{version} | |
77 | %patch0 -p1 | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build | |
82 | ||
83 | %if %{with tests} | |
84 | %{__python} -m unittest discover -s test | |
85 | %endif | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | %py3_build | |
90 | ||
91 | %if %{with tests} | |
92 | %{__python3} -m unittest discover -s test | |
93 | %endif | |
94 | %endif | |
95 | ||
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %if %{with python2} | |
100 | %py_install | |
101 | ||
102 | %py_postclean | |
103 | %endif | |
104 | ||
105 | %if %{with python3} | |
106 | %py3_install | |
107 | %endif | |
108 | ||
109 | %if %{with python2} | |
110 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-fido2-%{version} | |
111 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-fido2-%{version} | |
112 | %endif | |
113 | %if %{with python3} | |
114 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-fido2-%{version} | |
115 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-fido2-%{version} | |
116 | %endif | |
117 | ||
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc COPYING NEWS README.adoc | |
125 | %{py_sitescriptdir}/fido2 | |
126 | %{py_sitescriptdir}/fido2-%{version}-py*.egg-info | |
127 | %{_examplesdir}/python-fido2-%{version} | |
128 | %endif | |
129 | ||
130 | %if %{with python3} | |
131 | %files -n python3-fido2 | |
132 | %defattr(644,root,root,755) | |
133 | %doc COPYING NEWS README.adoc | |
134 | %{py3_sitescriptdir}/fido2 | |
135 | %{py3_sitescriptdir}/fido2-%{version}-py*.egg-info | |
136 | %{_examplesdir}/python3-fido2-%{version} | |
137 | %endif |