]>
Commit | Line | Data |
---|---|---|
2a09529a JK |
1 | |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
a0ff4b52 | 5 | %bcond_without python3 # CPython 3.x module |
2a09529a JK |
6 | |
7 | %define module tdbus | |
8 | Summary: Simple ("trivial") Python bindings for D-BUS | |
9 | Name: python-%{module} | |
a0ff4b52 JK |
10 | Version: 0.10 |
11 | Release: 1 | |
2a09529a JK |
12 | License: MIT |
13 | Group: Libraries/Python | |
a0ff4b52 JK |
14 | Source0: https://github.com/hmvp/python-tdbus/archive/v0.10/%{name}-%{version}.tar.gz |
15 | # Source0-md5: 6033776d458aae287d2f9d92a801a42d | |
30215a09 | 16 | Patch0: use_after_free.patch |
2a09529a JK |
17 | URL: https://github.com/hmvp/python-tdbus |
18 | BuildRequires: rpm-pythonprov | |
d78fde49 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
2a09529a JK |
20 | %if %{with python2} |
21 | BuildRequires: python-devel | |
41b46a01 | 22 | BuildRequires: python-gevent |
a0ff4b52 | 23 | BuildRequires: python-setuptools |
2a09529a JK |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python3-devel | |
41b46a01 | 27 | BuildRequires: python3-gevent |
a0ff4b52 | 28 | BuildRequires: python3-setuptools |
2a09529a | 29 | %endif |
2a09529a JK |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | Python-tdbus is a simple ("trivial") python interface for D-BUS. It | |
34 | builds directly on top of libdbus and has no other dependencies. Some | |
35 | benefits of python-tdbus with respect to the standard dbus-python [1]_ | |
36 | Python bindings: | |
37 | ||
38 | - The code is extremely simple. Python-tdbus is < 2.000 lines of code | |
39 | (C and Python), while dbus-python contains > 15.000 lines of code. | |
40 | - Event loop integration is not required for sending and receiving | |
41 | signals (if you can afford to block). | |
42 | - Includes `gevent' [2]_ event loop integration. | |
43 | - Event loop integration can be achieved in Python code rather than in | |
44 | C. | |
45 | - Uses native Python types for method and signal arguments, driven by | |
46 | a simple format string. | |
47 | - Provides a more "correct" object model (IMHO) where there's separate | |
48 | Dispatcher and Connection objects, instead of putting dispatching | |
49 | functionality into the connection object. | |
50 | ||
51 | %package -n python3-%{module} | |
52 | Summary: Simple ("trivial") Python bindings for D-BUS | |
53 | Group: Libraries/Python | |
54 | ||
55 | %description -n python3-%{module} | |
56 | Python-tdbus is a simple ("trivial") python interface for D-BUS. It | |
57 | builds directly on top of libdbus and has no other dependencies. Some | |
58 | benefits of python-tdbus with respect to the standard dbus-python [1]_ | |
59 | Python bindings: | |
60 | ||
61 | - The code is extremely simple. Python-tdbus is < 2.000 lines of code | |
62 | (C and Python), while dbus-python contains > 15.000 lines of code. | |
63 | - Event loop integration is not required for sending and receiving | |
64 | signals (if you can afford to block). | |
65 | - Includes `gevent' [2]_ event loop integration. | |
66 | - Event loop integration can be achieved in Python code rather than in | |
67 | C. | |
68 | - Uses native Python types for method and signal arguments, driven by | |
69 | a simple format string. | |
70 | - Provides a more "correct" object model (IMHO) where there's separate | |
71 | Dispatcher and Connection objects, instead of putting dispatching | |
72 | functionality into the connection object. | |
73 | ||
74 | %package apidocs | |
75 | Summary: %{module} API documentation | |
76 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
77 | Group: Documentation | |
78 | ||
79 | %description apidocs | |
80 | API documentation for %{module}. | |
81 | ||
82 | %description apidocs -l pl.UTF-8 | |
83 | Dokumentacja API %{module}. | |
84 | ||
85 | %prep | |
86 | %setup -q | |
30215a09 | 87 | %patch0 -p1 |
2a09529a JK |
88 | |
89 | %build | |
90 | %if %{with python2} | |
a6570077 | 91 | %py_build %{?with_tests:test} |
2a09529a JK |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
a6570077 | 95 | %py3_build %{?with_tests:test} |
2a09529a JK |
96 | %endif |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
a6570077 | 102 | %py_install |
2a09529a JK |
103 | |
104 | %py_postclean | |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
a6570077 | 108 | %py3_install |
2a09529a JK |
109 | %endif |
110 | ||
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %if %{with python2} | |
115 | %files | |
116 | %defattr(644,root,root,755) | |
a0ff4b52 | 117 | %doc AUTHORS CHANGES HACKING README.rst |
2a09529a JK |
118 | %dir %{py_sitedir}/%{module} |
119 | %{py_sitedir}/%{module}/*.py[co] | |
120 | %attr(755,root,root) %{py_sitedir}/%{module}/_tdbus.so | |
2a09529a JK |
121 | %{py_sitedir}/*.egg-info |
122 | %endif | |
2a09529a JK |
123 | |
124 | %if %{with python3} | |
125 | %files -n python3-%{module} | |
126 | %defattr(644,root,root,755) | |
a0ff4b52 JK |
127 | %doc AUTHORS CHANGES HACKING README.rst |
128 | %dir %{py3_sitedir}/%{module} | |
129 | %{py3_sitedir}/%{module}/__pycache__ | |
130 | %{py3_sitedir}/%{module}/*.py | |
131 | %attr(755,root,root) %{py3_sitedir}/%{module}/_tdbus*.so | |
2a09529a JK |
132 | %{py3_sitedir}/*.egg-info |
133 | %endif |