Name: python-svgwrite
Version: 1.1.5
Release: 1%{?dist}
Summary: Python 2 library to create SVG drawings
License: MIT
URL: https://bitbucket.org/mozman/svgwrite
Source0: https://bitbucket.org/mozman/svgwrite/downloads/svgwrite-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel python-setuptools pyparsing
Requires: python-setuptools pyparsing
%description
Python 2 library to create SVG drawings.
%package -n python3-svgwrite
Summary: Python 3 library to create SVG drawings
BuildRequires: python3-devel python3-setuptools python3-pyparsing
Requires: python3-setuptools python3-pyparsing
%description -n python3-svgwrite
Python 3 library to create SVG drawings.
%prep
%setup -q -n svgwrite-%{version}
rm -rf %{py3dir}
cp -a . %{py3dir}
%build
pushd %{py3dir}
%{__python3} setup.py build
popd
%{__python2} setup.py build
%install
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
# Remove shebang
for lib in $RPM_BUILD_ROOT%{python3_sitelib}/svgwrite/{,*/}/*.py; do
sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
touch -r $lib $lib.new &&
mv $lib.new $lib
done
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
# Remove shebang
for lib in $RPM_BUILD_ROOT%{python2_sitelib}/svgwrite/{,*/}/*.py; do
sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
touch -r $lib $lib.new &&
mv $lib.new $lib
done
%check
pushd %{py3dir}
%{__python3} -m unittest discover -s tests
popd
%{__python2} -m unittest discover -s tests
%files
%doc LICENSE.TXT NEWS.TXT README.TXT
%{python2_sitelib}/svgwrite-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/svgwrite/
%files -n python3-svgwrite
%doc LICENSE.TXT NEWS.TXT README.TXT
%{python3_sitelib}/svgwrite-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/svgwrite/
%changelog
* Tue Apr 15 2014 Julien Enselme <jujens@jujens.eu> - 1.1.5-1
- Update to 1.1.5 from upstream
* Tue Mar 25 2014 Julien Enselme <jujens@jujens.eu> - 1.1.4-2
- Add python-setuptools as a dependancy
* Tue Mar 25 2014 Julien Enselme <jujens@jujens.eu> - 1.1.4-1
- Update to 1.1.4 from upstream
- The bundled library was removed upstream
* Fri Mar 14 2014 Julien Enselme <jujens@jujens.eu> - 1.1.3-4
- Add pyparsing and python3-pyparsing as requires
- Patch sources so that this bundled library is not used
* Wed Mar 12 2014 Julien Enselme <jujens@jujens.eu> - 1.1.3-3
- Add check macro for unitests
* Fri Feb 28 2014 Julien Enselme <jujens@jujens.eu> - 1.1.3-2
- Add python3 support
- Improve packaging
* Sun Feb 09 2014 Julien Enselme <jujens@jujens.eu> - 1.1.3-1
- Initial packaging