Blob Blame History Raw
%global pypi_name svgwrite

Name:           python-%{pypi_name}
Version:        1.1.11
Release:        1%{?dist}
Summary:        Python 2 library to create SVG drawings

License:        MIT
URL:            https://bitbucket.org/mozman/%{pypi_name}
Source0:        https://pypi.python.org/packages/69/a5/c5edc66eb5bd9259589b3a379c8aac4084a92cad48fc688b07c1108da272/svgwrite-1.1.11.zip

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  pyparsing

%description
Python 2 library to create SVG drawings.


%package -n     python2-%{pypi_name}
Summary:        Python 3 library to create SVG drawings
Requires:       python-setuptools
Requires:       pyparsing
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
Python 3 library to create SVG drawings.


%package -n     python3-%{pypi_name}
Summary:        Python 3 library to create SVG drawings
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pyparsing
Requires:       python3-setuptools
Requires:       python3-pyparsing
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
Python 3 library to create SVG drawings.

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

%build
%py3_build
%py2_build


%install
%py3_install
# Remove shebang
for lib in %{buildroot}%{python3_sitelib}/%{pypi_name}/{,*/}/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done

%py2_install

# Remove shebang
for lib in %{buildroot}%{python2_sitelib}/%{pypi_name}/{,*/}/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done


%check
%{__python3} -m unittest discover -s tests

%{__python2} -m unittest discover -s tests


%files -n python2-%{pypi_name}
%license LICENSE.TXT
%doc NEWS.rst README.rst
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/%{pypi_name}/

%files -n python3-%{pypi_name}
%license LICENSE.TXT
%doc NEWS.rst README.rst
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{pypi_name}/


%changelog
* Sat Jun 03 2017  Julien Enselme <jujens@jujens.eu> - 1.1.11-1
- Update to 1.1.11

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.1.8-2
- Rebuild for Python 3.6

* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 1.1.8
- Update to 1.1.8

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Nov 12 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Nov 6 2015 Julien Enselme <jujens@jujens.eu> - 1.1.6-4
- Correct provides for python2 package

* Thu Nov 5 2015 Julien Enselme <jujens@jujens.eu> - 1.1.6-3
- Rebuilt for python 3.5

* Thu Nov 5 2015 Julien Enselme <jujens@jujens.eu> - 1.1.6-2
- Update package with new python guidelines

* Fri Jun 19 2015 Julien Enselme <jujens@jujens.eu> - 1.1.6-1
- Update to 1.1.6
- Reformat Requires and BuildRequires

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

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

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

* 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