]>
Commit | Line | Data |
---|---|---|
efa07327 MB |
1 | # |
2 | # Conditional build: | |
a48c2ccd JB |
3 | %bcond_without python2 # Python 2.x module |
4 | %bcond_without python3 # Python 3.x module | |
5 | %bcond_without apidocs # Sphinx-based API documentation | |
efa07327 | 6 | # |
1a760d13 | 7 | %define rname dbus-python |
8 | # | |
9 | Summary: Python library for using D-BUS | |
b52e4a1e | 10 | Summary(pl.UTF-8): Biblioteka do używania D-BUS oparta o Pythona |
1a760d13 | 11 | Name: python-dbus |
a48c2ccd JB |
12 | Version: 1.2.8 |
13 | Release: 1 | |
0f1dd055 | 14 | License: MIT |
7018692f | 15 | Group: Libraries/Python |
006e9696 | 16 | Source0: https://dbus.freedesktop.org/releases/dbus-python/%{rname}-%{version}.tar.gz |
a48c2ccd | 17 | # Source0-md5: 7379db774c10904f27e7e2743d90fb43 |
6546066a | 18 | URL: https://www.freedesktop.org/wiki/Software/DBusBindings |
fc7ea16e | 19 | BuildRequires: autoconf >= 2.59c |
006e9696 JB |
20 | BuildRequires: autoconf-archive |
21 | BuildRequires: automake >= 1:1.13 | |
1a760d13 | 22 | BuildRequires: cpp |
006e9696 | 23 | BuildRequires: dbus-devel >= 1.8 |
a48c2ccd | 24 | BuildRequires: glib2-devel >= 1:2.40 |
1a760d13 | 25 | BuildRequires: libtool |
26 | BuildRequires: pkgconfig | |
a48c2ccd JB |
27 | %if %{with python2} |
28 | BuildRequires: python-devel >= 1:2.7 | |
29 | %if %{with apidocs} | |
30 | BuildRequires: python-Sphinx | |
31 | BuildRequires: python-sphinx_rtd_theme | |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-devel >= 1:3.4 | |
36 | %if %{with apidocs} && %{without python2} | |
37 | BuildRequires: python3-Sphinx | |
38 | BuildRequires: python3-sphinx_rtd_theme | |
39 | %endif | |
40 | %endif | |
1a760d13 | 41 | BuildRequires: rpm-pythonprov |
efa07327 | 42 | BuildRequires: rpmbuild(macros) >= 1.268 |
006e9696 | 43 | Requires: dbus-libs >= 1.8 |
a48c2ccd | 44 | Requires: glib2 >= 1:2.40 |
1a760d13 | 45 | Requires: python-libxml2 >= 1:2.6.26 |
a48c2ccd | 46 | Requires: python-modules >= 1:2.7 |
1a760d13 | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
49 | %description | |
50 | D-BUS add-on library to integrate the standard D-BUS library with | |
51 | Python. | |
52 | ||
029680e0 | 53 | %description -l pl.UTF-8 |
1a760d13 | 54 | Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS |
55 | z Pythonem. | |
56 | ||
8bc76f31 JB |
57 | %package devel |
58 | Summary: C API for _dbus_bindings module | |
59 | Summary(pl.UTF-8): API C dla modułu _dbus_bindings | |
60 | License: AFL v2.1 or LGPL v2.1 | |
61 | Group: Development/Libraries | |
006e9696 | 62 | Requires: dbus-devel >= 1.8 |
a48c2ccd | 63 | Requires: glib2-devel >= 1:2.40 |
a496aff9 | 64 | #R: python-dbus = %{version}-%{release} or python3-dbus = %{version}-%{release} |
a48c2ccd | 65 | #R: python-devel >= 1:2.7 or python3-devel >= 1:3.4 |
8bc76f31 JB |
66 | |
67 | %description devel | |
68 | C API for _dbus_bindings module. | |
69 | ||
70 | %description devel -l pl.UTF-8 | |
71 | API C dla modułu _dbus_bindings. | |
72 | ||
a48c2ccd JB |
73 | %package apidocs |
74 | Summary: API documentation for Python dbus module | |
75 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona dbus | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | API documentation for Python dbus module. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja API modułu Pythona dbus. | |
83 | ||
efa07327 MB |
84 | %package -n python3-dbus |
85 | Summary: Python 3 library for using D-BUS | |
86 | Summary(pl.UTF-8): Biblioteka do używania D-BUS oparta o Pythona 3 | |
87 | Group: Libraries/Python | |
006e9696 | 88 | Requires: dbus-libs >= 1.8 |
a48c2ccd JB |
89 | Requires: glib2 >= 1:2.40 |
90 | Requires: python3-modules >= 1:3.4 | |
efa07327 MB |
91 | |
92 | %description -n python3-dbus | |
93 | D-BUS add-on library to integrate the standard D-BUS library with | |
94 | Python 3. | |
95 | ||
96 | %description -n python3-dbus -l pl.UTF-8 | |
97 | Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS | |
98 | z Pythonem 3. | |
99 | ||
1a760d13 | 100 | %prep |
101 | %setup -qn %{rname}-%{version} | |
1a760d13 | 102 | |
103 | %build | |
f22dc7fe JR |
104 | %{__aclocal} |
105 | %{__autoconf} | |
106 | %{__automake} | |
107 | ||
efa07327 MB |
108 | %if %{with python3} |
109 | mkdir py3 | |
110 | cd py3 | |
111 | ../%configure \ | |
112 | PYTHON=%{__python3} \ | |
a48c2ccd JB |
113 | PYTHON_LIBS=-lpython3 \ |
114 | --enable-documentation%{?with_python2:=no}%{!?with_python2:%{!?with_apidocs:=no}} | |
efa07327 MB |
115 | %{__make} |
116 | cd .. | |
117 | %endif | |
118 | ||
119 | %if %{with python2} | |
120 | mkdir py2 | |
121 | cd py2 | |
122 | ../%configure \ | |
123 | PYTHON=%{__python} \ | |
a48c2ccd JB |
124 | PYTHON_LIBS=-lpython \ |
125 | --enable-documentation%{!?with_apidocs:=no} | |
a797bc9b | 126 | %{__make} |
efa07327 MB |
127 | cd .. |
128 | %endif | |
129 | ||
1a760d13 | 130 | %install |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
93afb7bd | 133 | # use sitedir instead of sitescriptdir to match PyQt4 dbus/mainloop dir |
efa07327 MB |
134 | %if %{with python2} |
135 | %{__make} -C py2 install \ | |
93afb7bd | 136 | pythondir=%{py_sitedir} \ |
a797bc9b | 137 | DESTDIR=$RPM_BUILD_ROOT |
fc7ea16e | 138 | |
43c697e9 AM |
139 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
140 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
fc7ea16e | 141 | %py_postclean |
43c697e9 | 142 | |
efa07327 MB |
143 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_dbus*.la |
144 | %endif | |
145 | ||
146 | %if %{with python3} | |
147 | %{__make} -C py3 install \ | |
148 | pythondir=%{py3_sitedir} \ | |
149 | DESTDIR=$RPM_BUILD_ROOT | |
150 | ||
151 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
152 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
153 | ||
efa07327 MB |
154 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_dbus*.la |
155 | %endif | |
1a760d13 | 156 | |
a48c2ccd JB |
157 | %if %{with apidocs} |
158 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/dbus-python/{_sources,objects.inv} | |
159 | %endif | |
a6a873c3 | 160 | |
1a760d13 | 161 | %clean |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
efa07327 | 164 | %if %{with python2} |
1a760d13 | 165 | %files |
166 | %defattr(644,root,root,755) | |
a48c2ccd | 167 | %doc AUTHORS COPYING ChangeLog NEWS README doc/{API_CHANGES,tutorial}.txt |
43c697e9 | 168 | %dir %{py_sitedir}/dbus |
43c697e9 | 169 | %{py_sitedir}/dbus/*.py[co] |
44e98997 | 170 | %dir %{py_sitedir}/dbus/mainloop |
43c697e9 | 171 | %{py_sitedir}/dbus/mainloop/*.py[co] |
44e98997 JB |
172 | %attr(755,root,root) %{py_sitedir}/_dbus_bindings.so |
173 | %attr(755,root,root) %{py_sitedir}/_dbus_glib_bindings.so | |
efa07327 | 174 | %endif |
fc7ea16e | 175 | |
8bc76f31 JB |
176 | %files devel |
177 | %defattr(644,root,root,755) | |
178 | %{_includedir}/dbus-1.0/dbus/dbus-python.h | |
179 | %{_pkgconfigdir}/dbus-python.pc | |
efa07327 | 180 | |
a48c2ccd JB |
181 | %if %{with apidocs} |
182 | %files apidocs | |
183 | %defattr(644,root,root,755) | |
184 | %{_docdir}/dbus-python | |
185 | %endif | |
186 | ||
efa07327 MB |
187 | %if %{with python3} |
188 | %files -n python3-dbus | |
189 | %defattr(644,root,root,755) | |
a48c2ccd | 190 | %doc AUTHORS COPYING ChangeLog NEWS README doc/{API_CHANGES,tutorial}.txt |
efa07327 MB |
191 | %dir %{py3_sitedir}/dbus |
192 | %{py3_sitedir}/dbus/__pycache__ | |
193 | %{py3_sitedir}/dbus/*.py | |
194 | %dir %{py3_sitedir}/dbus/mainloop | |
195 | %{py3_sitedir}/dbus/mainloop/__pycache__ | |
196 | %{py3_sitedir}/dbus/mainloop/*.py | |
197 | %attr(755,root,root) %{py3_sitedir}/_dbus_bindings.so | |
198 | %attr(755,root,root) %{py3_sitedir}/_dbus_glib_bindings.so | |
199 | %endif |