3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Cython interface to HIDAPI library
8 Summary(pl.UTF-8): Cythonowy interfejs do biblioteki HIDAPI
10 Version: 0.7.99.post21
12 License: GPL v3 or BSD or HIDAPI
13 Group: Libraries/Python
14 Source0: https://files.pythonhosted.org/packages/source/h/hidapi/hidapi-%{version}.tar.gz
15 # Source0-md5: c343ac9bf1a204f89e6f94e9c569faa0
16 URL: https://pypi.org/project/hidapi/
17 BuildRequires: hidapi-devel
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: python-Cython
22 BuildRequires: python-devel >= 1:2.6
23 BuildRequires: python-setuptools >= 19.0
26 BuildRequires: python3-Cython
27 BuildRequires: python3-devel >= 1:3.2
28 BuildRequires: python3-setuptools >= 19.0
30 Requires: python-libs >= 1:2.6
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Cython interface to HIDAPI library.
36 %description -l pl.UTF-8
37 Cythonowy interfejs do biblioteki HIDAPI.
39 %package -n python3-hidapi
40 Summary: Cython interface to HIDAPI library
41 Summary(pl.UTF-8): Cythonowy interfejs do biblioteki HIDAPI
42 Group: Libraries/Python
43 Requires: python3-libs >= 1:3.2
45 %description -n python3-hidapi
46 Cython interface to HIDAPI library.
48 %description -n python3-hidapi -l pl.UTF-8
49 Cythonowy interfejs do biblioteki HIDAPI.
52 %setup -q -n hidapi-%{version}
60 PYTHONPATH=$(echo build-2/lib.*) \
61 %{__python} -m unittest tests
70 PYTHONPATH=$(echo build-3/lib.*) \
71 %{__python3} -m unittest tests
76 rm -rf $RPM_BUILD_ROOT
89 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc LICENSE.txt LICENSE-bsd.txt LICENSE-orig.txt README.rst
95 %attr(755,root,root) %{py_sitedir}/hid.so
96 %attr(755,root,root) %{py_sitedir}/hidraw.so
97 %{py_sitedir}/hidapi-%{version}-py*.egg-info
101 %files -n python3-hidapi
102 %defattr(644,root,root,755)
103 %doc LICENSE.txt LICENSE-bsd.txt LICENSE-orig.txt README.rst
104 %attr(755,root,root) %{py3_sitedir}/hid.cpython-*.so
105 %attr(755,root,root) %{py3_sitedir}/hidraw.cpython-*.so
106 %{py3_sitedir}/hidapi-%{version}-py*.egg-info