]>
Commit | Line | Data |
---|---|---|
0d5816eb 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: Cython interface to HIDAPI library | |
8 | Summary(pl.UTF-8): Cythonowy interfejs do biblioteki HIDAPI | |
9 | Name: python-hidapi | |
c1520900 JB |
10 | # 0.9.0.post3 requires hidapi > 0.9.0 |
11 | Version: 0.9.0.post2 | |
9552d78e | 12 | Release: 3 |
0d5816eb JB |
13 | License: GPL v3 or BSD or HIDAPI |
14 | Group: Libraries/Python | |
c1520900 | 15 | #Source0Download: https://pypi.org/simple/hidapi/ |
0d5816eb | 16 | Source0: https://files.pythonhosted.org/packages/source/h/hidapi/hidapi-%{version}.tar.gz |
c1520900 | 17 | # Source0-md5: 73797981acc762bd39f6ceb5a0b0b0b7 |
0d5816eb | 18 | URL: https://pypi.org/project/hidapi/ |
c1520900 | 19 | BuildRequires: hidapi-devel >= 0.9.0 |
0d5816eb JB |
20 | BuildRequires: rpm-pythonprov |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-Cython | |
24 | BuildRequires: python-devel >= 1:2.6 | |
04fa15ae | 25 | BuildRequires: python-setuptools >= 1:19.0 |
0d5816eb JB |
26 | %endif |
27 | %if %{with python3} | |
28 | BuildRequires: python3-Cython | |
29 | BuildRequires: python3-devel >= 1:3.2 | |
04fa15ae | 30 | BuildRequires: python3-setuptools >= 1:19.0 |
0d5816eb | 31 | %endif |
c1520900 | 32 | Requires: hidapi >= 0.9.0 |
0d5816eb JB |
33 | Requires: python-libs >= 1:2.6 |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Cython interface to HIDAPI library. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Cythonowy interfejs do biblioteki HIDAPI. | |
41 | ||
42 | %package -n python3-hidapi | |
43 | Summary: Cython interface to HIDAPI library | |
44 | Summary(pl.UTF-8): Cythonowy interfejs do biblioteki HIDAPI | |
45 | Group: Libraries/Python | |
c1520900 | 46 | Requires: hidapi >= 0.9.0 |
0d5816eb JB |
47 | Requires: python3-libs >= 1:3.2 |
48 | ||
49 | %description -n python3-hidapi | |
50 | Cython interface to HIDAPI library. | |
51 | ||
52 | %description -n python3-hidapi -l pl.UTF-8 | |
53 | Cythonowy interfejs do biblioteki HIDAPI. | |
54 | ||
55 | %prep | |
56 | %setup -q -n hidapi-%{version} | |
57 | ||
58 | %build | |
59 | %if %{with python2} | |
60 | %py_build \ | |
61 | --with-system-hidapi | |
62 | ||
63 | %if %{with tests} | |
64 | PYTHONPATH=$(echo build-2/lib.*) \ | |
65 | %{__python} -m unittest tests | |
66 | %endif | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
70 | %py3_build \ | |
71 | --with-system-hidapi | |
72 | ||
73 | %if %{with tests} | |
74 | PYTHONPATH=$(echo build-3/lib.*) \ | |
75 | %{__python3} -m unittest tests | |
76 | %endif | |
77 | %endif | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %if %{with python2} | |
83 | %py_install | |
84 | ||
85 | %py_postclean | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | %py3_install | |
90 | %endif | |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
96 | %files | |
97 | %defattr(644,root,root,755) | |
98 | %doc LICENSE.txt LICENSE-bsd.txt LICENSE-orig.txt README.rst | |
99 | %attr(755,root,root) %{py_sitedir}/hid.so | |
100 | %attr(755,root,root) %{py_sitedir}/hidraw.so | |
101 | %{py_sitedir}/hidapi-%{version}-py*.egg-info | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %files -n python3-hidapi | |
106 | %defattr(644,root,root,755) | |
107 | %doc LICENSE.txt LICENSE-bsd.txt LICENSE-orig.txt README.rst | |
108 | %attr(755,root,root) %{py3_sitedir}/hid.cpython-*.so | |
109 | %attr(755,root,root) %{py3_sitedir}/hidraw.cpython-*.so | |
110 | %{py3_sitedir}/hidapi-%{version}-py*.egg-info | |
111 | %endif |