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