]>
Commit | Line | Data |
---|---|---|
9b44e951 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Python 2 based U2F host library | |
8 | Summary(pl.UTF-8): Biblioteka hosta U2F dla Pythona 2 | |
9 | Name: python-u2flib-host | |
10 | Version: 3.0.2 | |
11 | Release: 1 | |
12 | License: BSD | |
13 | Group: Libraries/Python | |
14 | Source0: https://developers.yubico.com/python-u2flib-host/Releases/%{name}-%{version}.tar.gz | |
15 | # Source0-md5: f22297ce5aa5f14527b5c4b416b7f85b | |
16 | URL: https://developers.yubico.com/python-u2flib-host/ | |
17 | BuildRequires: asciidoc | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
d511b569 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-cryptography >= 1.0 | |
25 | BuildRequires: python-hidapi >= 0.7.99 | |
26 | %endif | |
9b44e951 JB |
27 | %endif |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.3 | |
30 | BuildRequires: python3-setuptools | |
d511b569 JB |
31 | %if %{with tests} |
32 | BuildRequires: python3-cryptography >= 1.0 | |
33 | BuildRequires: python3-hidapi >= 0.7.99 | |
34 | %endif | |
9b44e951 JB |
35 | %endif |
36 | Requires: python-hidapi >= 0.7.99 | |
37 | Requires: python-modules >= 1:2.7 | |
38 | Requires: python-requests | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | # man pages common for both python versions | |
43 | %define _duplicate_files_terminate_build 0 | |
44 | ||
45 | %description | |
46 | Provides library functionality for communicating with a U2F device | |
47 | over USB. | |
48 | ||
49 | Two executables are provided, u2f-register and u2f-authenticate, which | |
50 | support the register and authenticate commands of U2F as defined in | |
51 | the FIDO specifications | |
52 | (<http://fidoalliance.org/specifications/download>). | |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | Pakiet zawiera bibliotekę funkcji do komunikowania się z urządzeniami | |
56 | U2F po USB. | |
57 | ||
58 | Dołączone są dwa programy: u2f-register oraz u2f-authenticate, | |
59 | obsługujące polecenia U2F register i authenticate, zdefiniowane w | |
60 | specyfikacji FIDO | |
61 | (<http://fidoalliance.org/specifications/download>). | |
62 | ||
63 | %package -n python3-u2flib-host | |
64 | Summary: Python 3 based U2F host library | |
65 | Summary(pl.UTF-8): Biblioteka hosta U2F dla Pythona 3 | |
66 | Group: Libraries/Python | |
67 | Requires: python3-hidapi >= 0.7.99 | |
68 | Requires: python3-modules >= 1:3.3 | |
69 | Requires: python3-requests | |
70 | ||
71 | %description -n python3-u2flib-host | |
72 | Provides library functionality for communicating with a U2F device | |
73 | over USB. | |
74 | ||
75 | Two executables are provided, u2f-register and u2f-authenticate, which | |
76 | support the register and authenticate commands of U2F as defined in | |
77 | the FIDO specifications | |
78 | (<http://fidoalliance.org/specifications/download>). | |
79 | ||
80 | %description -n python3-u2flib-host -l pl.UTF-8 | |
81 | Pakiet zawiera bibliotekę funkcji do komunikowania się z urządzeniami | |
82 | U2F po USB. | |
83 | ||
84 | Dołączone są dwa programy: u2f-register oraz u2f-authenticate, | |
85 | obsługujące polecenia U2F register i authenticate, zdefiniowane w | |
86 | specyfikacji FIDO | |
87 | (<http://fidoalliance.org/specifications/download>). | |
88 | ||
89 | %prep | |
90 | %setup -q | |
91 | ||
92 | %build | |
93 | %if %{with python2} | |
94 | %py_build | |
95 | ||
96 | %if %{with tests} | |
97 | %{__python} -m unittest discover -s test | |
98 | %endif | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %py3_build | |
103 | ||
104 | %if %{with tests} | |
105 | %{__python3} -m unittest discover -s test | |
106 | %endif | |
107 | %endif | |
108 | ||
109 | cd man | |
110 | for f in *.adoc ; do | |
111 | a2x -f manpage $f | |
112 | done | |
113 | ||
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | %if %{with python2} | |
118 | %py_install | |
119 | ||
120 | for f in u2f-authenticate u2f-register ; do | |
121 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-2 | |
122 | done | |
123 | ||
124 | %py_postclean | |
125 | %endif | |
126 | ||
127 | %if %{with python3} | |
128 | %py3_install | |
129 | ||
130 | for f in u2f-authenticate u2f-register ; do | |
131 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-3 | |
132 | done | |
133 | %endif | |
134 | ||
135 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
136 | cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %if %{with python2} | |
142 | %files | |
143 | %defattr(644,root,root,755) | |
144 | %doc COPYING ChangeLog NEWS README | |
145 | %attr(755,root,root) %{_bindir}/u2f-authenticate-2 | |
146 | %attr(755,root,root) %{_bindir}/u2f-register-2 | |
147 | %{py_sitescriptdir}/u2flib_host | |
148 | %{py_sitescriptdir}/python_u2flib_host-%{version}-py*.egg-info | |
149 | %{_mandir}/man1/u2f-authenticate.1* | |
150 | %{_mandir}/man1/u2f-register.1* | |
151 | %endif | |
152 | ||
153 | %if %{with python3} | |
154 | %files -n python3-u2flib-host | |
155 | %defattr(644,root,root,755) | |
156 | %doc COPYING ChangeLog NEWS README | |
157 | %attr(755,root,root) %{_bindir}/u2f-authenticate-3 | |
158 | %attr(755,root,root) %{_bindir}/u2f-register-3 | |
159 | %{py3_sitescriptdir}/u2flib_host | |
160 | %{py3_sitescriptdir}/python_u2flib_host-%{version}-py*.egg-info | |
161 | %{_mandir}/man1/u2f-authenticate.1* | |
162 | %{_mandir}/man1/u2f-register.1* | |
163 | %endif |