From 59a8e4cd3044d2f2fb1117c989ece9df8f3111fc Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Jul 26 2013 16:41:54 +0000 Subject: Initial import (#986715). --- diff --git a/.gitignore b/.gitignore index e69de29..b2be597 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/v0.5.1.tar.gz diff --git a/python-cairocffi.spec b/python-cairocffi.spec new file mode 100644 index 0000000..3f46b1b --- /dev/null +++ b/python-cairocffi.spec @@ -0,0 +1,87 @@ +%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%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.5.1 +Release: 2%{?dist} +Group: Development/Libraries +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 python-setuptools +%if 0%{?with_python3} +BuildRequires: python3-devel python3-setuptools +%endif # if with_python3 + +Requires: python-cffi cairo gdk-pixbuf2 + +%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. + +%if 0%{?with_python3} +%package -n python3-cairocffi +Group: Development/Libraries +Summary: cffi-based cairo bindings for Python + +%description -n python3-cairocffi +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. +%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 + +%if 0%{?with_python3} +pushd %{py3dir} +# rpmbuild defaults to exporting LANG="C", which screws up Python 3's +# default encoidng, 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 +%doc LICENSE CHANGES README.rst docs +%{python_sitelib}/* + +%if 0%{?with_python3} +%files -n python3-cairocffi +%doc LICENSE CHANGES README.rst docs +%{python3_sitelib}/* +%endif # with_python3 + +%changelog +* 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 diff --git a/sources b/sources index e69de29..8f29ec2 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +410a3dc56d9416b01b525591b27154c8 v0.5.1.tar.gz