Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname cairosvg
%global eggname CairoSVG

Name:               python-cairosvg
Version:            1.0.16
Release:            2%{?dist}
Summary:            A Simple SVG Converter for Cairo

Group:              Development/Libraries
License:            LGPLv3+
URL:                http://pypi.python.org/pypi/CairoSVG
Source0:            http://pypi.python.org/packages/source/C/%{eggname}/%{eggname}-%{version}.tar.gz

BuildArch:          noarch


BuildRequires:      python2-devel
BuildRequires:      pycairo
Requires:           pycairo

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-cairo
%endif

%description
CairoSVG is a SVG converter based on Cairo. It can export SVG files to PDF,
PostScript and PNG files.

For further information, please visit the CairoSVG Website
http://www.cairosvg.org

%if 0%{?with_python3}
%package -n python3-cairosvg
Summary:            A Simple SVG Converter for Cairo
Group:              Development/Libraries

# The subpackage used to be called this on accident.
# https://bugzilla.redhat.com/show_bug.cgi?id=1263793
Provides:           python3-CairoSVG

Requires:           python3-cairo

%description -n python3-cairosvg
CairoSVG is a SVG converter based on Cairo. It can export SVG files to PDF,
PostScript and PNG files.

For further information, please visit the CairoSVG Website
http://www.cairosvg.org
%endif

%prep
%setup -q -n %{eggname}-%{version}

# Remove bundled egg-info in case it exists
rm -rf %{eggname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
mv %{buildroot}/%{_bindir}/cairosvg %{buildroot}/%{_bindir}/python3-cairosvg
popd
%endif
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%files
%doc README.rst COPYING NEWS.rst TODO.rst
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{eggname}-%{version}*
%{_bindir}/cairosvg

%if 0%{?with_python3}
%files -n python3-cairosvg
%doc README.rst COPYING NEWS.rst TODO.rst
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{eggname}-%{version}-*
%{_bindir}/python3-cairosvg
%endif

%changelog
* Wed Sep 16 2015 Ralph Bean <rbean@redhat.com> - 1.0.16-2
- Rename the python3 subpackage and Provide the old name.

* Wed Sep 16 2015 Ralph Bean <rbean@redhat.com> - 1.0.16-1
- new version

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Feb 27 2015 Ralph Bean <rbean@redhat.com> - 1.0.13-1
- new version

* Wed Aug 20 2014 Ralph Bean <rbean@redhat.com> - 1.0.9-1
- Latest upstream.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Thu May 08 2014 Ralph Bean <rbean@redhat.com> - 1.0.7-1
- Latest upstream.

* Fri Mar 07 2014 Ralph Bean <rbean@redhat.com> - 1.0.6-1
- Latest upstream.

* Wed Feb 12 2014 Ralph Bean <rbean@redhat.com> - 1.0.4-1
- Latest upstream.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Apr 16 2013 Ralph Bean <rbean@redhat.com> - 0.5-2
- Updated license to LGPLv3+ after clarification from upstream.
  https://github.com/Kozea/CairoSVG/pull/8
- Removed reStructuredText markup from the description.

* Sat Apr 13 2013 Ralph Bean <rbean@redhat.com> - 0.5-1
- Initial package for Fedora