]>
Commit | Line | Data |
---|---|---|
efa07327 MB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
5 | # | |
1a760d13 | 6 | %define rname dbus-python |
7 | # | |
8 | Summary: Python library for using D-BUS | |
b52e4a1e | 9 | Summary(pl.UTF-8): Biblioteka do używania D-BUS oparta o Pythona |
1a760d13 | 10 | Name: python-dbus |
a6a873c3 | 11 | Version: 1.2.0 |
efa07327 | 12 | Release: 2 |
0f1dd055 | 13 | License: MIT |
7018692f | 14 | Group: Libraries/Python |
9c8b3a6a | 15 | Source0: http://dbus.freedesktop.org/releases/dbus-python/%{rname}-%{version}.tar.gz |
a6a873c3 | 16 | # Source0-md5: b09cd2d1a057cc432ce944de3fc06bf7 |
99333d3a | 17 | URL: http://www.freedesktop.org/Software/DBusBindings |
fc7ea16e | 18 | BuildRequires: autoconf >= 2.59c |
8be2681a | 19 | BuildRequires: automake >= 1:1.9 |
1a760d13 | 20 | BuildRequires: cpp |
258f47ec | 21 | BuildRequires: dbus-devel >= 1.6 |
a797bc9b | 22 | BuildRequires: dbus-glib-devel >= 0.73 |
1a760d13 | 23 | BuildRequires: libtool |
24 | BuildRequires: pkgconfig | |
efa07327 MB |
25 | %{?with_python2:BuildRequires: python-devel >= 1:2.6} |
26 | %{?with_python3:BuildRequires: python3-devel} | |
1a760d13 | 27 | BuildRequires: rpm-pythonprov |
efa07327 | 28 | BuildRequires: rpmbuild(macros) >= 1.268 |
1a760d13 | 29 | %pyrequires_eq python-modules |
a797bc9b | 30 | Requires: dbus-glib >= 0.73 |
258f47ec | 31 | Requires: dbus-libs >= 1.6 |
1a760d13 | 32 | Requires: python-libxml2 >= 1:2.6.26 |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | D-BUS add-on library to integrate the standard D-BUS library with | |
37 | Python. | |
38 | ||
029680e0 | 39 | %description -l pl.UTF-8 |
1a760d13 | 40 | Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS |
41 | z Pythonem. | |
42 | ||
8bc76f31 JB |
43 | %package devel |
44 | Summary: C API for _dbus_bindings module | |
45 | Summary(pl.UTF-8): API C dla modułu _dbus_bindings | |
46 | License: AFL v2.1 or LGPL v2.1 | |
47 | Group: Development/Libraries | |
48 | Requires: %{name} = %{version}-%{release} | |
258f47ec | 49 | Requires: dbus-devel >= 1.6 |
8bc76f31 JB |
50 | Requires: python-devel >= 1:2.5 |
51 | ||
52 | %description devel | |
53 | C API for _dbus_bindings module. | |
54 | ||
55 | %description devel -l pl.UTF-8 | |
56 | API C dla modułu _dbus_bindings. | |
57 | ||
efa07327 MB |
58 | %package -n python3-dbus |
59 | Summary: Python 3 library for using D-BUS | |
60 | Summary(pl.UTF-8): Biblioteka do używania D-BUS oparta o Pythona 3 | |
61 | Group: Libraries/Python | |
62 | Requires: dbus-glib >= 0.73 | |
63 | Requires: dbus-libs >= 1.6 | |
64 | ||
65 | %description -n python3-dbus | |
66 | D-BUS add-on library to integrate the standard D-BUS library with | |
67 | Python 3. | |
68 | ||
69 | %description -n python3-dbus -l pl.UTF-8 | |
70 | Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS | |
71 | z Pythonem 3. | |
72 | ||
73 | ||
1a760d13 | 74 | %prep |
75 | %setup -qn %{rname}-%{version} | |
1a760d13 | 76 | |
77 | %build | |
efa07327 MB |
78 | %if %{with python3} |
79 | mkdir py3 | |
80 | cd py3 | |
81 | ../%configure \ | |
82 | PYTHON=%{__python3} \ | |
83 | PYTHON_LIBS=-lpython3 | |
84 | %{__make} | |
85 | cd .. | |
86 | %endif | |
87 | ||
88 | %if %{with python2} | |
89 | mkdir py2 | |
90 | cd py2 | |
91 | ../%configure \ | |
92 | PYTHON=%{__python} \ | |
93 | PYTHON_LIBS=-lpython | |
a797bc9b | 94 | %{__make} |
efa07327 MB |
95 | cd .. |
96 | %endif | |
97 | ||
1a760d13 | 98 | %install |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
93afb7bd | 101 | # use sitedir instead of sitescriptdir to match PyQt4 dbus/mainloop dir |
efa07327 MB |
102 | %if %{with python2} |
103 | %{__make} -C py2 install \ | |
93afb7bd | 104 | pythondir=%{py_sitedir} \ |
a797bc9b | 105 | DESTDIR=$RPM_BUILD_ROOT |
fc7ea16e | 106 | |
43c697e9 AM |
107 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
108 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
fc7ea16e | 109 | %py_postclean |
43c697e9 | 110 | |
efa07327 MB |
111 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_dbus*.la |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %{__make} -C py3 install \ | |
116 | pythondir=%{py3_sitedir} \ | |
117 | DESTDIR=$RPM_BUILD_ROOT | |
118 | ||
119 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
120 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
121 | ||
122 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/dbus/*.py[co] | |
123 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/dbus/mainloop/*.py[co] | |
124 | ||
125 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_dbus*.la | |
126 | %endif | |
1a760d13 | 127 | |
a6a873c3 JB |
128 | # packaged as %doc |
129 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/dbus-python | |
130 | ||
1a760d13 | 131 | %clean |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
efa07327 | 134 | %if %{with python2} |
1a760d13 | 135 | %files |
136 | %defattr(644,root,root,755) | |
a6a873c3 | 137 | %doc AUTHORS COPYING ChangeLog NEWS README doc/*.txt |
43c697e9 | 138 | %dir %{py_sitedir}/dbus |
43c697e9 | 139 | %{py_sitedir}/dbus/*.py[co] |
44e98997 | 140 | %dir %{py_sitedir}/dbus/mainloop |
43c697e9 | 141 | %{py_sitedir}/dbus/mainloop/*.py[co] |
44e98997 JB |
142 | %attr(755,root,root) %{py_sitedir}/_dbus_bindings.so |
143 | %attr(755,root,root) %{py_sitedir}/_dbus_glib_bindings.so | |
efa07327 | 144 | %endif |
fc7ea16e | 145 | |
8bc76f31 JB |
146 | %files devel |
147 | %defattr(644,root,root,755) | |
148 | %{_includedir}/dbus-1.0/dbus/dbus-python.h | |
149 | %{_pkgconfigdir}/dbus-python.pc | |
efa07327 MB |
150 | |
151 | %if %{with python3} | |
152 | %files -n python3-dbus | |
153 | %defattr(644,root,root,755) | |
154 | %dir %{py3_sitedir}/dbus | |
155 | %{py3_sitedir}/dbus/__pycache__ | |
156 | %{py3_sitedir}/dbus/*.py | |
157 | %dir %{py3_sitedir}/dbus/mainloop | |
158 | %{py3_sitedir}/dbus/mainloop/__pycache__ | |
159 | %{py3_sitedir}/dbus/mainloop/*.py | |
160 | %attr(755,root,root) %{py3_sitedir}/_dbus_bindings.so | |
161 | %attr(755,root,root) %{py3_sitedir}/_dbus_glib_bindings.so | |
162 | %endif |