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