%if 0%{?fedora} > 12 %global with_python3 1 %else %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: python-cairocffi Version: 0.7.2 Release: 12%{?dist} Summary: cffi-based cairo bindings for Python License: BSD URL: https://pypi.python.org/pypi/cairocffi/ Source0: https://github.com/SimonSapin/cairocffi/archive/v%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel python2-setuptools python2-sphinx python2-cffi python2-xcffib %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools python3-cffi python3-xcffib %endif # if with_python3 %global _description\ cairocffi is a CFFI-based drop-in replacement for Pycairo, a set of\ Python bindings and object-oriented API for cairo. Cairo is a 2D\ vector graphics library with support for multiple backends including\ image buffers, PNG, PostScript, PDF, and SVG file output. %description %_description %package -n python2-cairocffi Summary: %summary Requires: python2-cffi cairo %if 0%{?fedora} > 13 || 0%{?rhel} > 6 Requires: gdk-pixbuf2 %endif %{?python_provide:%python_provide python2-cairocffi} %description -n python2-cairocffi %_description %if 0%{?with_python3} %package -n python3-cairocffi Summary: cffi-based cairo bindings for Python Requires: python3-cffi Requires: cairo %{?python_provide:%python_provide python3-cairocffi} %description -n python3-cairocffi %_description %endif # if with_python3 %prep %setup -q -n cairocffi-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %endif # with_python3 %build %{__python} setup.py build build_sphinx rm docs/_build/html/.buildinfo %if 0%{?with_python3} pushd %{py3dir} # rpmbuild defaults to exporting LANG="C", which screws up Python 3's # default encoding, and breaks setup.py reading cairocffi/__init__.py, # even though that file has an explicit tag of being UTF-8. LANG="en_US.UTF-8" %{__python3} setup.py build popd %endif # with_python3 %install %{__python} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} LANG="en_US.UTF-8" %{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot} popd %endif # with_python3 %files -n python2-cairocffi %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGES README.rst docs/_build/html %{python_sitelib}/* %if 0%{?with_python3} %files -n python3-cairocffi %license LICENSE %doc CHANGES README.rst docs/_build/html %{python3_sitelib}/* %endif # with_python3 %changelog * Tue Mar 13 2018 Iryna Shcherbina - 0.7.2-12 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Fri Feb 09 2018 Fedora Release Engineering - 0.7.2-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Wed Aug 09 2017 Zbigniew Jędrzejewski-Szmek - 0.7.2-10 - Python 2 binary package renamed to python2-cairocffi See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 * Thu Jul 27 2017 Fedora Release Engineering - 0.7.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 11 2017 Fedora Release Engineering - 0.7.2-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 0.7.2-7 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 0.7.2-6 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Mon Feb 08 2016 John Dulaney - 0.7.2-5 - Add cairo to Requires for python3 * Thu Feb 04 2016 Fedora Release Engineering - 0.7.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 10 2015 Fedora Release Engineering - 0.7.2-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Mon Oct 19 2015 Adam Williamson - 0.7.2-2 - buildrequires python-xcffib (for xcb support) * Fri Oct 16 2015 Adam Williamson - 0.7.2-1 - bump to latest upstream release (RHBZ #1249821) * Thu Jun 18 2015 Fedora Release Engineering - 0.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sun May 17 2015 Ville Skyttä - 0.6-2 - Build and ship HTML docs instead of their source - Mark LICENSE as %%license * Mon Nov 03 2014 Eric Smith 0.6-1 - Update to latest upstream. * Mon Aug 25 2014 Eric Smith 0.5.4-1 - Update to latest upstream. - No python3 in EL7. * Sat Jun 07 2014 Fedora Release Engineering - 0.5.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue May 27 2014 Kalev Lember - 0.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Fri Jul 26 2013 Eric Smith 0.5.1-3 - For EL6, remove require of gdk-pixbuf2. * Tue Jul 23 2013 Eric Smith 0.5.1-2 - Added Python 3 support. * Sun Jul 21 2013 Eric Smith 0.5.1-1 - initial version