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