06eb999
%if 0%{?fedora}
06eb999
%global with_python3 1
06eb999
%endif
06eb999
06eb999
%global modname cairosvg
06eb999
%global eggname CairoSVG
06eb999
06eb999
Name:               python-cairosvg
06eb999
Version:            0.5
06eb999
Release:            2%{?dist}
06eb999
Summary:            A Simple SVG Converter for Cairo
06eb999
06eb999
Group:              Development/Libraries
06eb999
License:            LGPLv3+
06eb999
URL:                http://pypi.python.org/pypi/CairoSVG
06eb999
Source0:            http://pypi.python.org/packages/source/C/%{eggname}/%{eggname}-%{version}.tar.gz
06eb999
06eb999
BuildArch:          noarch
06eb999
06eb999
06eb999
BuildRequires:      python2-devel
06eb999
BuildRequires:      pycairo
06eb999
Requires:           pycairo
06eb999
06eb999
%if 0%{?with_python3}
06eb999
BuildRequires:      python3-devel
06eb999
BuildRequires:      python3-cairo
06eb999
%endif
06eb999
06eb999
%description
06eb999
CairoSVG is a SVG converter based on Cairo. It can export SVG files to PDF,
06eb999
PostScript and PNG files.
06eb999
06eb999
For further information, please visit the CairoSVG Website
06eb999
http://www.cairosvg.org
06eb999
06eb999
%if 0%{?with_python3}
06eb999
%package -n python3-CairoSVG
06eb999
Summary:            A Simple SVG Converter for Cairo
06eb999
Group:              Development/Libraries
06eb999
06eb999
Requires:           python3-cairo
06eb999
06eb999
%description -n python3-CairoSVG
06eb999
CairoSVG is a SVG converter based on Cairo. It can export SVG files to PDF,
06eb999
PostScript and PNG files.
06eb999
06eb999
For further information, please visit the CairoSVG Website
06eb999
http://www.cairosvg.org
06eb999
%endif
06eb999
06eb999
%prep
06eb999
%setup -q -n %{eggname}-%{version}
06eb999
06eb999
# Remove bundled egg-info in case it exists
06eb999
rm -rf %{eggname}.egg-info
06eb999
%if 0%{?with_python3}
06eb999
rm -rf %{py3dir}
06eb999
cp -a . %{py3dir}
06eb999
%endif
06eb999
06eb999
%build
06eb999
%{__python} setup.py build
06eb999
%if 0%{?with_python3}
06eb999
pushd %{py3dir}
06eb999
%{__python3} setup.py build
06eb999
popd
06eb999
%endif
06eb999
06eb999
%install
06eb999
%if 0%{?with_python3}
06eb999
pushd %{py3dir}
06eb999
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
06eb999
mv %{buildroot}/%{_bindir}/cairosvg %{buildroot}/%{_bindir}/python3-cairosvg
06eb999
popd
06eb999
%endif
06eb999
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
06eb999
06eb999
%files
06eb999
%doc README.rst COPYING NEWS.rst TODO.rst
06eb999
%{python_sitelib}/%{modname}/
06eb999
%{python_sitelib}/%{eggname}-%{version}*
06eb999
%{_bindir}/cairosvg
06eb999
06eb999
%if 0%{?with_python3}
06eb999
%files -n python3-CairoSVG
06eb999
%doc README.rst COPYING NEWS.rst TODO.rst
06eb999
%{python3_sitelib}/%{modname}/
06eb999
%{python3_sitelib}/%{eggname}-%{version}-*
06eb999
%{_bindir}/python3-cairosvg
06eb999
%endif
06eb999
06eb999
%changelog
06eb999
* Tue Apr 16 2013 Ralph Bean <rbean@redhat.com> - 0.5-2
06eb999
- Updated license to LGPLv3+ after clarification from upstream.
06eb999
  https://github.com/Kozea/CairoSVG/pull/8
06eb999
- Removed reStructuredText markup from the description.
06eb999
06eb999
* Sat Apr 13 2013 Ralph Bean <rbean@redhat.com> - 0.5-1
06eb999
- Initial package for Fedora