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