]> git.pld-linux.org Git - packages/python-hidapi.git/blob - python-hidapi.spec
5b01dd45591db9cd166d3c65597e6047440affdd
[packages/python-hidapi.git] / python-hidapi.spec
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
10 Version:        0.7.99.post21
11 Release:        3
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
20 %if %{with python2}
21 BuildRequires:  python-Cython
22 BuildRequires:  python-devel >= 1:2.6
23 BuildRequires:  python-setuptools >= 19.0
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-Cython
27 BuildRequires:  python3-devel >= 1:3.2
28 BuildRequires:  python3-setuptools >= 19.0
29 %endif
30 Requires:       python-libs >= 1:2.6
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 Cython interface to HIDAPI library.
35
36 %description -l pl.UTF-8
37 Cythonowy interfejs do biblioteki HIDAPI.
38
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
44
45 %description -n python3-hidapi
46 Cython interface to HIDAPI library.
47
48 %description -n python3-hidapi -l pl.UTF-8
49 Cythonowy interfejs do biblioteki HIDAPI.
50
51 %prep
52 %setup -q -n hidapi-%{version}
53
54 %build
55 %if %{with python2}
56 %py_build \
57         --with-system-hidapi
58
59 %if %{with tests}
60 PYTHONPATH=$(echo build-2/lib.*) \
61 %{__python} -m unittest tests
62 %endif
63 %endif
64
65 %if %{with python3}
66 %py3_build \
67         --with-system-hidapi
68
69 %if %{with tests}
70 PYTHONPATH=$(echo build-3/lib.*) \
71 %{__python3} -m unittest tests
72 %endif
73 %endif
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77
78 %if %{with python2}
79 %py_install
80
81 %py_postclean
82 %endif
83
84 %if %{with python3}
85 %py3_install
86 %endif
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %if %{with python2}
92 %files
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
98 %endif
99
100 %if %{with python3}
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
107 %endif
This page took 0.033596 seconds and 2 git commands to generate.