[packages/python-dbus] Build python 3 module. Release 2

megabajt megabajt at pld-linux.org
Wed Oct 16 21:33:40 CEST 2013


commit efa073277745cee80806dd9bd7be22b217078765
Author: Marcin Banasiak <marcin.banasiak at gmail.com>
Date:   Wed Oct 16 21:30:19 2013 +0200

    Build python 3 module. Release 2

 python-dbus.spec | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 77 insertions(+), 8 deletions(-)
---
diff --git a/python-dbus.spec b/python-dbus.spec
index b26b47a..db43358 100644
--- a/python-dbus.spec
+++ b/python-dbus.spec
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-dbus.git/commitdiff/efa073277745cee80806dd9bd7be22b217078765



More information about the pld-cvs-commit mailing list