Python 3 support

Build a parallel installable python3-pyatspi package. The Fedora
packaging guidelines require that both python2 and python3 modules are
built from the same source rpm, so this is a bit hacky.

With this change the "pyatspi" source package builds two binary rpms:
"pyatspi"         - python2 support
"python3-pyatspi" - python3 support

It might make sense to rename the python2 package to "python-pyatspi" in
the future to have a consistent naming with the python2 and python3
subpackages.
This commit is contained in:
Kalev Lember 2013-02-23 19:36:57 +01:00
parent cb38cefbd1
commit a7768ca94b

View File

@ -2,7 +2,7 @@
Name: pyatspi
Version: 2.7.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Python bindings for at-spi
Group: Development/Languages
@ -11,7 +11,8 @@ URL: http://www.linuxfoundation.org/en/AT-SPI_on_D-Bus
#VCS: git:git://git.gnome.org/pyatspi
Source0: http://download.gnome.org/sources/pyatspi/2.7/%{name}-%{version}.tar.xz
BuildRequires: python
BuildRequires: python2-devel
BuildRequires: python3-devel
BuildRequires: pygobject3-devel >= 2.90.1
Requires: at-spi2-core
@ -24,20 +25,49 @@ applications. Essentially it exposes the internals of applications for
automation, so tools such as screen readers, magnifiers, or even
scripting interfaces can query and interact with GUI controls.
This package includes a python client library for at-spi.
This package includes a python2 client library for at-spi.
%package -n python3-pyatspi
Summary: Python3 bindings for at-spi
Requires: at-spi2-core
%description -n python3-pyatspi
at-spi allows assistive technologies to access GTK-based
applications. Essentially it exposes the internals of applications for
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.
%prep
%setup -q
# Make a copy of the source tree for building the python3 module
rm -rf %{py3dir}
cp -a . %{py3dir}
%build
%configure
# Build the python2 module
%configure --with-python=python2
make
# Build the python3 module
pushd %{py3dir}
%configure --with-python=python3
make
popd
%install
make install DESTDIR=$RPM_BUILD_ROOT
pushd %{py3dir}
make install DESTDIR=$RPM_BUILD_ROOT
popd
# Install the example into docdir instead
rm $RPM_BUILD_ROOT%{_bindir}/magFocusTracker.py
@ -45,10 +75,18 @@ rm $RPM_BUILD_ROOT%{_bindir}/magFocusTracker.py
%files
%doc COPYING COPYING.GPL AUTHORS README
%doc examples/magFocusTracker.py
%{python_sitelib}/pyatspi
%{python_sitelib}/pyatspi/
%files -n python3-pyatspi
%doc COPYING COPYING.GPL AUTHORS README
%doc examples/magFocusTracker.py
%{python3_sitelib}/pyatspi/
%changelog
* Sat Feb 23 2013 Kalev Lember <kalevlember@gmail.com> - 2.7.5-2
- Build python3-pyatspi with Python 3 support
* Wed Feb 06 2013 Kalev Lember <kalevlember@gmail.com> - 2.7.5-1
- Update to 2.7.5