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