]> git.pld-linux.org Git - packages/python-dbus.git/commitdiff
Build python 3 module. Release 2 auto/th/python-dbus-1.2.0-2
authorMarcin Banasiak <marcin.banasiak@gmail.com>
Wed, 16 Oct 2013 19:30:19 +0000 (21:30 +0200)
committerMarcin Banasiak <marcin.banasiak@gmail.com>
Wed, 16 Oct 2013 19:32:35 +0000 (21:32 +0200)
python-dbus.spec

index b26b47a58e5e35ccc9fbdfebaedf306dd769c3a5..db433587facb25e48d15291918b26e0bc295cf30 100644 (file)
@@ -1,10 +1,15 @@
+#
+# Conditional build:
+%bcond_without  python2         # Python 2.x module
+%bcond_without  python3         # Python 3.x module
+#
 %define                rname           dbus-python
 #
 Summary:       Python library for using D-BUS
 Summary(pl.UTF-8):     Biblioteka do używania D-BUS oparta o Pythona
 Name:          python-dbus
 Version:       1.2.0
-Release:       1
+Release:       2
 License:       MIT
 Group:         Libraries/Python
 Source0:       http://dbus.freedesktop.org/releases/dbus-python/%{rname}-%{version}.tar.gz
@@ -17,9 +22,10 @@ BuildRequires:       dbus-devel >= 1.6
 BuildRequires: dbus-glib-devel >= 0.73
 BuildRequires: libtool
 BuildRequires: pkgconfig
-BuildRequires: python-devel >= 1:2.6
-BuildRequires: rpmbuild(macros) >= 1.268
+%{?with_python2:BuildRequires: python-devel >= 1:2.6}
+%{?with_python3:BuildRequires: python3-devel}
 BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.268
 %pyrequires_eq python-modules
 Requires:      dbus-glib >= 0.73
 Requires:      dbus-libs >= 1.6
@@ -49,19 +55,52 @@ C API for _dbus_bindings module.
 %description devel -l pl.UTF-8
 API C dla modułu _dbus_bindings.
 
+%package -n python3-dbus
+Summary:       Python 3 library for using D-BUS
+Summary(pl.UTF-8):     Biblioteka do używania D-BUS oparta o Pythona 3
+Group:         Libraries/Python
+Requires:      dbus-glib >= 0.73
+Requires:      dbus-libs >= 1.6
+
+%description -n python3-dbus
+D-BUS add-on library to integrate the standard D-BUS library with
+Python 3.
+
+%description -n python3-dbus -l pl.UTF-8
+Dodatkowa biblioteka D-BUS do integracji standardowej biblioteki D-BUS
+z Pythonem 3.
+
+
 %prep
 %setup -qn %{rname}-%{version}
 
 %build
-%configure
+%if %{with python3}
+mkdir py3
+cd py3
+../%configure \
+       PYTHON=%{__python3} \
+       PYTHON_LIBS=-lpython3
+%{__make}
+cd ..
+%endif
+
+%if %{with python2}
+mkdir py2
+cd py2
+../%configure \
+       PYTHON=%{__python} \
+       PYTHON_LIBS=-lpython
 %{__make}
-       
+cd ..
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
 # use sitedir instead of sitescriptdir to match PyQt4 dbus/mainloop dir
-
-%{__make} install \
+%if %{with python2}
+%{__make} -C py2 install \
        pythondir=%{py_sitedir} \
        DESTDIR=$RPM_BUILD_ROOT
 
@@ -69,7 +108,22 @@ rm -rf $RPM_BUILD_ROOT
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 
-%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_dbus*.la 
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_dbus*.la
+%endif
+
+%if %{with python3}
+%{__make} -C py3 install \
+       pythondir=%{py3_sitedir} \
+       DESTDIR=$RPM_BUILD_ROOT
+
+%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/dbus/*.py[co]
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/dbus/mainloop/*.py[co]
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_dbus*.la
+%endif
 
 # packaged as %doc
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/dbus-python
@@ -77,6 +131,7 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS COPYING ChangeLog NEWS README doc/*.txt
@@ -86,8 +141,22 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitedir}/dbus/mainloop/*.py[co]
 %attr(755,root,root) %{py_sitedir}/_dbus_bindings.so
 %attr(755,root,root) %{py_sitedir}/_dbus_glib_bindings.so
+%endif
 
 %files devel
 %defattr(644,root,root,755)
 %{_includedir}/dbus-1.0/dbus/dbus-python.h
 %{_pkgconfigdir}/dbus-python.pc
+
+%if %{with python3}
+%files -n python3-dbus
+%defattr(644,root,root,755)
+%dir %{py3_sitedir}/dbus
+%{py3_sitedir}/dbus/__pycache__
+%{py3_sitedir}/dbus/*.py
+%dir %{py3_sitedir}/dbus/mainloop
+%{py3_sitedir}/dbus/mainloop/__pycache__
+%{py3_sitedir}/dbus/mainloop/*.py
+%attr(755,root,root) %{py3_sitedir}/_dbus_bindings.so
+%attr(755,root,root) %{py3_sitedir}/_dbus_glib_bindings.so
+%endif
This page took 0.18906 seconds and 4 git commands to generate.