Don't depend on python3 in RHEL

This commit is contained in:
Rui Matos 2013-04-15 15:26:22 +02:00
parent 695fe42a7d
commit d4df3aaf73

View File

@ -2,7 +2,7 @@
Name: pyatspi
Version: 2.8.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Python bindings for at-spi
Group: Development/Languages
@ -12,7 +12,9 @@ URL: http://www.linuxfoundation.org/en/AT-SPI_on_D-Bus
Source0: http://download.gnome.org/sources/pyatspi/2.8/%{name}-%{version}.tar.xz
BuildRequires: python2-devel
%if !0%{?rhel}
BuildRequires: python3-devel
%endif
BuildRequires: pygobject3-devel >= 2.90.1
Requires: at-spi2-core
@ -29,6 +31,7 @@ scripting interfaces can query and interact with GUI controls.
This package includes a python2 client library for at-spi.
%if !0%{?rhel}
%package -n python3-pyatspi
Summary: Python3 bindings for at-spi
Requires: at-spi2-core
@ -41,14 +44,17 @@ automation, so tools such as screen readers, magnifiers, or even
scripting interfaces can query and interact with GUI controls.
This package includes a python3 client library for at-spi.
%endif
%prep
%setup -q
%if !0%{?rhel}
# Make a copy of the source tree for building the python3 module
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
@ -56,16 +62,19 @@ cp -a . %{py3dir}
%configure --with-python=python2
make
%if !0%{?rhel}
# Build the python3 module
pushd %{py3dir}
%configure --with-python=python3
make
popd
%endif
%install
make install DESTDIR=$RPM_BUILD_ROOT
%if !0%{?rhel}
pushd %{py3dir}
make install DESTDIR=$RPM_BUILD_ROOT
popd
@ -73,6 +82,7 @@ popd
# Fix up the shebang for python3 example
cp -a examples python3-examples
sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' python3-examples/magFocusTracker.py
%endif
%files
@ -80,13 +90,18 @@ sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' python3-examples/magFocusTracker.
%doc examples/magFocusTracker.py
%{python_sitelib}/pyatspi/
%if !0%{?rhel}
%files -n python3-pyatspi
%doc COPYING COPYING.GPL AUTHORS README
%doc python3-examples/magFocusTracker.py
%{python3_sitelib}/pyatspi/
%endif
%changelog
* Mon Apr 15 2013 Rui Matos <rmatos@redhat.com> - 2.8.0-2
- Don't depend on python3 in RHEL
* Mon Mar 25 2013 Kalev Lember <kalevlember@gmail.com> - 2.8.0-1
- Update to 2.8.0