packages: python-pygobject/python-pygobject.spec - python2/3 bconds
wiget
wiget at pld-linux.org
Mon Nov 1 18:41:27 CET 2010
Author: wiget Date: Mon Nov 1 17:41:27 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- python2/3 bconds
---- Files affected:
packages/python-pygobject:
python-pygobject.spec (1.54 -> 1.55)
---- Diffs:
================================================================
Index: packages/python-pygobject/python-pygobject.spec
diff -u packages/python-pygobject/python-pygobject.spec:1.54 packages/python-pygobject/python-pygobject.spec:1.55
--- packages/python-pygobject/python-pygobject.spec:1.54 Mon Nov 1 17:57:32 2010
+++ packages/python-pygobject/python-pygobject.spec Mon Nov 1 18:41:22 2010
@@ -1,5 +1,8 @@
# $Revision$, $Date$
#
+%bcond_without python2
+%bcond_without python3
+#
%define module pygobject
#
Summary: Python bindings for GObject library
@@ -24,10 +27,17 @@
BuildRequires: libtool
BuildRequires: libxslt-progs >= 1.1.22
BuildRequires: pkgconfig
+BuildRequires: rpm-pythonprov
+%if %{with python2}
BuildRequires: python-devel >= 1:2.5.2
BuildRequires: python-pycairo-devel >= 1.0.2
-BuildRequires: rpm-pythonprov
%pyrequires_eq python-modules
+%endif
+%if %{with python3}
+BuildRequires: python3
+BuildRequires: python3-devel
+BuildRequires: python3-modules
+%endif
Requires: glib2 >= 1:2.22.4
Requires: gobject-introspection >= 0.9.5
Provides: python-pygtk-gobject
@@ -111,43 +121,56 @@
%{__autoconf}
%{__autoheader}
%{__automake}
+%if %{with python3}
mkdir py3
cd py3
../%configure \
PYTHON=/usr/bin/python3 \
--disable-silent-rules
-%{__make} -j1
+%{__make}
cd ..
+%endif
+%if %{with python2}
mkdir py2
cd py2
../%configure \
PYTHON=%{__python} \
--disable-silent-rules
-%{__make} -j1
+%{__make}
cd ..
+%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%if %{with python3}
cd py3
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
TARGET_DIR=%{_gtkdocdir}/%{module}
-cd ../py2
+cd ..
+%endif
+%if %{with python2}
+cd py2
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
TARGET_DIR=%{_gtkdocdir}/%{module}
cd ..
+%endif
cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-%{__rm} $RPM_BUILD_ROOT{%{py_sitedir},%{py3_sitedir}}/gtk-2.0/*/*.la
+%{__rm} -f $RPM_BUILD_ROOT{%{py_sitedir},%{py3_sitedir}}/gtk-2.0/*/*.la
+%if %{with python2}
%py_comp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
%py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
%py_postclean %{_datadir}/%{module}/2.0/codegen
+%endif
+%if %{with python3}
%py3_postclean
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -155,6 +178,7 @@
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
+%if %{with python2}
%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README
@@ -200,7 +224,9 @@
%{_datadir}/%{module}/2.0/defs/*.override
%{_datadir}/%{module}/xsl/*.py
%{_datadir}/%{module}/xsl/*.xsl
+%endif
+%if %{with python3}
%files -n python3-pygobject
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README
@@ -226,6 +252,7 @@
%{py3_sitedir}/gtk-2.0/*.py[co]
%{py3_sitedir}/pygtk.py[co]
%{py3_sitedir}/pygtk.pth
+%endif
%files examples
%defattr(644,root,root,755)
@@ -241,6 +268,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.55 2010/11/01 17:41:22 wiget
+- python2/3 bconds
+
Revision 1.54 2010/11/01 16:57:32 wiget
- added python 3.x version
- rel 4
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-pygobject/python-pygobject.spec?r1=1.54&r2=1.55&f=u
More information about the pld-cvs-commit
mailing list