]> git.pld-linux.org Git - packages/python-u2flib-host.git/blame - python-u2flib-host.spec
- tests require hidapi too
[packages/python-u2flib-host.git] / python-u2flib-host.spec
CommitLineData
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
7Summary: Python 2 based U2F host library
8Summary(pl.UTF-8): Biblioteka hosta U2F dla Pythona 2
9Name: python-u2flib-host
10Version: 3.0.2
11Release: 1
12License: BSD
13Group: Libraries/Python
14Source0: https://developers.yubico.com/python-u2flib-host/Releases/%{name}-%{version}.tar.gz
15# Source0-md5: f22297ce5aa5f14527b5c4b416b7f85b
16URL: https://developers.yubico.com/python-u2flib-host/
17BuildRequires: asciidoc
18BuildRequires: rpm-pythonprov
19BuildRequires: rpmbuild(macros) >= 1.714
20%if %{with python2}
21BuildRequires: python-modules >= 1:2.7
22BuildRequires: python-setuptools
d511b569
JB
23%if %{with tests}
24BuildRequires: python-cryptography >= 1.0
25BuildRequires: python-hidapi >= 0.7.99
26%endif
9b44e951
JB
27%endif
28%if %{with python3}
29BuildRequires: python3-modules >= 1:3.3
30BuildRequires: python3-setuptools
d511b569
JB
31%if %{with tests}
32BuildRequires: python3-cryptography >= 1.0
33BuildRequires: python3-hidapi >= 0.7.99
34%endif
9b44e951
JB
35%endif
36Requires: python-hidapi >= 0.7.99
37Requires: python-modules >= 1:2.7
38Requires: python-requests
39BuildArch: noarch
40BuildRoot: %{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
46Provides library functionality for communicating with a U2F device
47over USB.
48
49Two executables are provided, u2f-register and u2f-authenticate, which
50support the register and authenticate commands of U2F as defined in
51the FIDO specifications
52(<http://fidoalliance.org/specifications/download>).
53
54%description -l pl.UTF-8
55Pakiet zawiera bibliotekę funkcji do komunikowania się z urządzeniami
56U2F po USB.
57
58Dołączone są dwa programy: u2f-register oraz u2f-authenticate,
59obsługujące polecenia U2F register i authenticate, zdefiniowane w
60specyfikacji FIDO
61(<http://fidoalliance.org/specifications/download>).
62
63%package -n python3-u2flib-host
64Summary: Python 3 based U2F host library
65Summary(pl.UTF-8): Biblioteka hosta U2F dla Pythona 3
66Group: Libraries/Python
67Requires: python3-hidapi >= 0.7.99
68Requires: python3-modules >= 1:3.3
69Requires: python3-requests
70
71%description -n python3-u2flib-host
72Provides library functionality for communicating with a U2F device
73over USB.
74
75Two executables are provided, u2f-register and u2f-authenticate, which
76support the register and authenticate commands of U2F as defined in
77the FIDO specifications
78(<http://fidoalliance.org/specifications/download>).
79
80%description -n python3-u2flib-host -l pl.UTF-8
81Pakiet zawiera bibliotekę funkcji do komunikowania się z urządzeniami
82U2F po USB.
83
84Dołączone są dwa programy: u2f-register oraz u2f-authenticate,
85obsługujące polecenia U2F register i authenticate, zdefiniowane w
86specyfikacji 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
109cd man
110for f in *.adoc ; do
111 a2x -f manpage $f
112done
113
114%install
115rm -rf $RPM_BUILD_ROOT
116
117%if %{with python2}
118%py_install
119
120for f in u2f-authenticate u2f-register ; do
121 %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-2
122done
123
124%py_postclean
125%endif
126
127%if %{with python3}
128%py3_install
129
130for f in u2f-authenticate u2f-register ; do
131 %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-3
132done
133%endif
134
135install -d $RPM_BUILD_ROOT%{_mandir}/man1
136cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
137
138%clean
139rm -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
This page took 0.085954 seconds and 4 git commands to generate.