]> git.pld-linux.org Git - SPECS.git/blob - python-pyudev.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-pyudev.spec
1 #
2 # Conditional build:
3 %bcond_without  doc             # HTML documentation build
4 %bcond_with     tests           # py.test tests [requires functional udev with device db]
5 %bcond_without  python2         # Python 2.x module
6 %bcond_without  python3         # Python 3.x module
7 #
8 %define         module  pyudev
9 Summary:        Pure Python binding for libudev
10 Summary(pl.UTF-8):      Czysto pythonowe wiązanie do libudev
11 Name:           python-%{module}
12 Version:        0.22.0
13 Release:        2
14 License:        LGPL v2.1+
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/pyudev/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pyudev/%{module}-%{version}.tar.gz
18 # Source0-md5:  377eda61186c91e9440f01d76dbb4206
19 Patch0:         %{name}-mock.patch
20 URL:            http://pyudev.readthedocs.org/
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.6
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-docutils >= 0.9
26 BuildRequires:  python-hypothesis
27 BuildRequires:  python-mock >= 1.0
28 BuildRequires:  python-pytest >= 2.8
29 BuildRequires:  python-six
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-devel >= 1:3.2
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-docutils >= 0.9
37 BuildRequires:  python3-hypothesis
38 BuildRequires:  python3-pytest >= 2.8
39 BuildRequires:  python3-six
40 %endif
41 %endif
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.714
44 %if %{with doc}
45 # for tests 1.0b1 is required, but for docs generation 0.8 is sufficient
46 BuildRequires:  python-mock >= 0.8
47 BuildRequires:  python-sphinxcontrib-issuetracker >= 0.9
48 BuildRequires:  python-pytest >= 2.2
49 BuildRequires:  sphinx-pdg-2 >= 1.0.7
50 %endif
51 Requires:       python-modules >= 1:2.6
52 Requires:       udev-libs >= 1:151
53 BuildArch:      noarch
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %description
57 pyudev is a LGPL licensed, pure Python binding for libudev, the device
58 and hardware management and information library for Linux. It supports
59 almost all libudev functionality, you can enumerate devices, query
60 device properties and attributes or monitor devices, including
61 asynchronous monitoring with threads, or within the event loops of Qt,
62 GLib or wxPython.
63
64 %description -l pl.UTF-8
65 pyudev to wydane na licencji LGPL czysto pythonowe wiązanie do libudev
66 - biblioteki zarządzania urządzeniami i sprzętem dla Linuksa.
67 Obsługuje prawie całą funkcjonalność libudev, potrafi wyliczać
68 urządzenia, odpytywać o właściwości i atrybuty urządzeń oraz
69 monitorować urządzenia, włącznie z asynchronicznym monitorowaniem z
70 użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
71
72 %package -n python3-%{module}
73 Summary:        Pure Python binding for libudev
74 Summary(pl.UTF-8):      Czysto pythonowe wiązanie do libudev
75 Group:          Development/Languages/Python
76 Requires:       python3-modules >= 1:3.2
77
78 %description -n python3-%{module}
79 pyudev is a LGPL licensed, pure Python binding for libudev, the device
80 and hardware management and information library for Linux. It supports
81 almost all libudev functionality, you can enumerate devices, query
82 device properties and attributes or monitor devices, including
83 asynchronous monitoring with threads, or within the event loops of Qt,
84 GLib or wxPython.
85
86 %description -n python3-%{module} -l pl.UTF-8
87 pyudev to wydane na licencji LGPL czysto pythonowe wiązanie do libudev
88 - biblioteki zarządzania urządzeniami i sprzętem dla Linuksa.
89 Obsługuje prawie całą funkcjonalność libudev, potrafi wyliczać
90 urządzenia, odpytywać o właściwości i atrybuty urządzeń oraz
91 monitorować urządzenia, włącznie z asynchronicznym monitorowaniem z
92 użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
93
94 %package apidocs
95 Summary:        API documentation for Python pyudev module
96 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona pyudev
97 Group:          Documentation
98
99 %description apidocs
100 API documentation for Python pyudev module.
101
102 %description apidocs -l pl.UTF-8
103 Dokumentacja API modułu Pythona pyudev.
104
105 %prep
106 %setup -q -n %{module}-%{version}
107 %patch0 -p1
108
109 %build
110 %if %{with python2}
111 %py_build
112
113 %if %{with tests}
114 PYTHONPATH=$(pwd):$(pwd)/build-2/lib \
115 %{__python} -m pytest tests
116 %endif
117 %endif
118
119 %if %{with python3}
120 %py3_build
121
122 %if %{with tests}
123 PYTHONPATH=$(pwd):$(pwd)/build-3/lib \
124 %{__python3} -m pytest tests
125 %endif
126 %endif
127
128 %if %{with doc}
129 PYTHONPATH=build-2/lib \
130 sphinx-build-2 -b html -d doc/_doctrees doc doc/html
131 %endif
132
133 %install
134 rm -rf $RPM_BUILD_ROOT
135
136 %if %{with python2}
137 %py_install
138
139 %py_postclean
140 %endif
141
142 %if %{with python3}
143 %py3_install
144 %endif
145
146 %clean
147 rm -rf $RPM_BUILD_ROOT
148
149 %if %{with python2}
150 %files
151 %defattr(644,root,root,755)
152 %doc CHANGES.rst README.rst
153 %{py_sitescriptdir}/pyudev
154 %{py_sitescriptdir}/pyudev-%{version}-py*.egg-info
155 %endif
156
157 %if %{with python3}
158 %files -n python3-%{module}
159 %defattr(644,root,root,755)
160 %doc CHANGES.rst README.rst
161 %{py3_sitescriptdir}/pyudev
162 %{py3_sitescriptdir}/pyudev-%{version}-py*.egg-info
163 %endif
164
165 %if %{with doc}
166 %files apidocs
167 %defattr(644,root,root,755)
168 %doc doc/html/{_static,api,tests,*.html,*.js}
169 %endif
This page took 0.218579 seconds and 3 git commands to generate.