]> git.pld-linux.org Git - packages/python-pyudev.git/blob - python-pyudev.spec
- updated to 0.21.0
[packages/python-pyudev.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.21.0
13 Release:        1
14 License:        LGPL v2.1+
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.python.org/simple/pyudev/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pyudev/%{module}-%{version}.tar.gz
18 # Source0-md5:  cf4d9db7d772622144ca1be6b5d9353b
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
27 # Source3-md5:  8cc5c1ff0bb5ef9f4e9968c9b4a01984
28 Patch0:         %{name}-offline.patch
29 Patch1:         %{name}-mock.patch
30 URL:            http://pyudev.readthedocs.org/
31 %if %{with python2}
32 BuildRequires:  python-devel >= 1:2.6
33 BuildRequires:  python-setuptools
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
39 BuildRequires:  python-six
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-devel >= 1:3.2
44 BuildRequires:  python3-setuptools
45 %if %{with tests}
46 BuildRequires:  python3-docutils >= 0.9
47 BuildRequires:  python3-hypothesis
48 BuildRequires:  python3-pytest >= 2.8
49 BuildRequires:  python3-six
50 %endif
51 %endif
52 BuildRequires:  rpm-pythonprov
53 BuildRequires:  rpmbuild(macros) >= 1.714
54 %if %{with doc}
55 # for tests 1.0b1 is required, but for docs generation 0.8 is sufficient
56 BuildRequires:  python-mock >= 0.8
57 BuildRequires:  python-sphinxcontrib-issuetracker >= 0.9
58 BuildRequires:  python-pytest >= 2.2
59 BuildRequires:  sphinx-pdg-2 >= 1.0.7
60 %endif
61 Requires:       python-modules >= 1:2.6
62 Requires:       udev-libs >= 1:151
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,
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.
81
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
86 Requires:       python3-modules >= 1:3.2
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
104 %prep
105 %setup -q -n %{module}-%{version}
106 %patch0 -p1
107 %patch1 -p1
108
109 cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} doc
110
111 %build
112 %if %{with python2}
113 %py_build
114
115 %{?with_tests:PYTHONPATH=$(pwd):$(pwd)/build-2/lib %{__python} -m pytest tests}
116 %endif
117
118 %if %{with python3}
119 %py3_build
120
121 %{?with_tests:PYTHONPATH=$(pwd):$(pwd)/build-3/lib %{__python3} -m pytest tests}
122 %endif
123
124 %if %{with doc}
125 PYTHONPATH=build-2/lib \
126 sphinx-build-2 -b html -d doc/_doctrees doc doc/html
127 %endif
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131
132 %if %{with python2}
133 %py_install
134
135 %py_postclean
136 %endif
137
138 %if %{with python3}
139 %py3_install
140 %endif
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %files
147 %defattr(644,root,root,755)
148 %doc CHANGES.rst README.rst %{?with_doc:doc/html}
149 %{py_sitescriptdir}/pyudev
150 %{py_sitescriptdir}/pyudev-%{version}-py*.egg-info
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}
157 %{py3_sitescriptdir}/pyudev
158 %{py3_sitescriptdir}/pyudev-%{version}-py*.egg-info
159 %endif
This page took 0.036627 seconds and 4 git commands to generate.