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