]> git.pld-linux.org Git - packages/python-dbus.git/blob - python-dbus.spec
7774921cb929cf0e26e568d3182922932e3bba4c
[packages/python-dbus.git] / python-dbus.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # Python 2.x module
4 %bcond_without  python3         # Python 3.x module
5 #
6 %define         rname           dbus-python
7 #
8 Summary:        Python library for using D-BUS
9 Summary(pl.UTF-8):      Biblioteka do używania D-BUS oparta o Pythona
10 Name:           python-dbus
11 Version:        1.2.4
12 Release:        2
13 License:        MIT
14 Group:          Libraries/Python
15 Source0:        https://dbus.freedesktop.org/releases/dbus-python/%{rname}-%{version}.tar.gz
16 # Source0-md5:  7372a588c83a7232b4e08159bfd48fe5
17 Patch0:         epydoc.patch
18 URL:            https://www.freedesktop.org/wiki/Software/DBusBindings
19 BuildRequires:  autoconf >= 2.59c
20 BuildRequires:  autoconf-archive
21 BuildRequires:  automake >= 1:1.13
22 BuildRequires:  cpp
23 BuildRequires:  dbus-devel >= 1.8
24 BuildRequires:  dbus-glib-devel >= 0.73
25 BuildRequires:  epydoc >= 3
26 BuildRequires:  libtool
27 BuildRequires:  pkgconfig
28 %{?with_python2:BuildRequires:  python-devel >= 1:2.6}
29 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.268
32 %pyrequires_eq  python-modules
33 Requires:       dbus-glib >= 0.73
34 Requires:       dbus-libs >= 1.8
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
42 %description -l pl.UTF-8
43 Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS
44 z Pythonem.
45
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
51 Requires:       dbus-devel >= 1.8
52 #R: python-dbus = %{version}-%{release}  or  python3-dbus = %{version}-%{release}
53 #R: python-devel >= 1:2.5  or  python3-devel
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
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
66 Requires:       dbus-libs >= 1.8
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
76 %prep
77 %setup -qn %{rname}-%{version}
78 %patch0 -p1
79
80 %build
81 %{__aclocal}
82 %{__autoconf}
83 %{__automake}
84
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
101 %{__make}
102 cd ..
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107
108 # use sitedir instead of sitescriptdir to match PyQt4 dbus/mainloop dir
109 %if %{with python2}
110 %{__make} -C py2 install \
111         pythondir=%{py_sitedir} \
112         DESTDIR=$RPM_BUILD_ROOT
113
114 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
115 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
116 %py_postclean
117
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
129 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_dbus*.la
130 %endif
131
132 # packaged as %doc
133 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/dbus-python
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %if %{with python2}
139 %files
140 %defattr(644,root,root,755)
141 %doc AUTHORS COPYING ChangeLog NEWS README doc/*.txt
142 %dir %{py_sitedir}/dbus
143 %{py_sitedir}/dbus/*.py[co]
144 %dir %{py_sitedir}/dbus/mainloop
145 %{py_sitedir}/dbus/mainloop/*.py[co]
146 %attr(755,root,root) %{py_sitedir}/_dbus_bindings.so
147 %attr(755,root,root) %{py_sitedir}/_dbus_glib_bindings.so
148 %endif
149
150 %files devel
151 %defattr(644,root,root,755)
152 %{_includedir}/dbus-1.0/dbus/dbus-python.h
153 %{_pkgconfigdir}/dbus-python.pc
154
155 %if %{with python3}
156 %files -n python3-dbus
157 %defattr(644,root,root,755)
158 %doc AUTHORS COPYING ChangeLog NEWS README doc/*.txt
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
This page took 0.051015 seconds and 2 git commands to generate.