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