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