File python-xlwt.spec of Package python-xlwt

%global         sum Spreadsheet python library

Name:           python-xlwt
Version:        1.3.0
Release:        1%{?dist}
Summary:        %{sum}

Group:          Development/Libraries
                # Utils.py is LPGL2.0+
License:        LGPLv2+ and BSD and BSD with advertising
URL:            http://pypi.python.org/pypi/xlwt
                # See also https://github.com/python-excel/xlwt
Source0:         https://pypi.io/packages/source/x/xlwt/xlwt-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python3-devel
BuildRequires:  python2-setuptools
BuildRequires:  python3-setuptools
BuildRequires:  antlr-python

Requires:       python
Requires:       antlr-python


%description
A library for generating spreadsheet files that are compatible with
Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric. xlwt has
full support for Unicode. Excel spreadsheets can be generated on any
platform without needing Excel or a COM server. The only requirement
is Python 2.3 to 2.7.


%package -n python2-xlwt
Summary:      %{sum}
Provides:     python-xlwt = %{version}-%{release}
Obsoletes:    python-xlwt <= 0.7.4
              # https://github.com/python-excel/xlwt/issues/73
Provides:     bundled(antlr) = 2.7.7
%{?python_provide:%python_provide python2-xlwt}

%description -n python2-xlwt
A library for generating spreadsheet files that are compatible with
Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric. xlwt has
full support for Unicode. Excel spreadsheets can be generated on any
platform without needing Excel or a COM server. The only requirement
is Python 2.3 to 2.7.


%package -n python3-xlwt
Summary:      %{sum}
              # https://github.com/python-excel/xlwt/issues/73
Provides:     bundled(antlr) = 2.7.7
%{?python_provide:%python_provide python3-xlwt}

%description -n python3-xlwt
A library for generating spreadsheet files that are compatible with
Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric. xlwt has
full support for Unicode. Excel spreadsheets can be generated on any
platform without needing Excel or a COM server. The only requirement
is Python 2.3 to 2.7.


%prep
%autosetup -p1 -n xlwt-%{version}
sed -i "s|tests/python.bmp|python.bmp|g" tests/test_bitmaps.py
sed -i '\;/usr/bin/env;d' xlwt/Formatting.py
cd examples
for file in  \
    panes2.py numbers_demo.py zoom_magnification.py image_chg_col_wid.py
do
    sed "s|\r||g" $file > $file.new && \
    touch -r $file $file.new && \
    mv $file.new $file
done


%build
%py2_build
%py3_build


%check
cd tests
PYTHONPATH=.. %{__python2} -m unittest discover
PYTHONPATH=.. %{__python3} -m unittest discover


%install
%py2_install
%py3_install
mkdir tmp_docs
cp -ar examples docs tmp_docs


%files -n python2-xlwt
%license docs/licenses.rst
%doc README.rst tmp_docs/*
%{python2_sitelib}/xlwt
%{python2_sitelib}/*.egg-info

%files -n python3-xlwt
%license docs/licenses.rst
%doc README.rst tmp_docs/*
%{python3_sitelib}/xlwt
%{python3_sitelib}/*.egg-info


%changelog
* Fri Feb 16 2018 Yunfei Shi <shiyf2@lenovo.com> - 1.3.0-1
- Update o 1.3.0.

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

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

* Sat Dec 24 2016 Alec Leamas <leamas.alec@gmail.com> - 1.1.2-1
- New version
- Get sources from github instead of broken pypis source repos.
- Add patch from upstream to make tests run.

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

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

* Mon Jan 04 2016 Alec Leamas <leamas.alec@gmail.com> - 1.0.0-2
- Add python3 subpackage

* Mon Jan 04 2016 Alec Leamas <leamas.alec@gmail.com> - 1.0.0-1
- Updating to new upstream.
- Remove upstreamed patch xlwt-fsf-address.
- Bundling antlr.py, the system one is unusable; upstream issue filed.

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

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

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

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu May 03 2012 Alec Leamas <leamas.alec@gmail.com> - 0.7.4-1
- Rewriting license according to legal advice.
- Adding %%check

* Thu May 03 2012 Alec Leamas <leamas.alec@gmail.com> - 0.7.4-1
- Tentative rewrite of License tag (blocked on FE_LEGAL)
- Unbundle antlr
- Explicit naming of files in %%{python_sitelib}

* Thu May 03 2012 Alec Leamas <leamas.alec@gmail.com> - 0.7.4-1
- Fixing bad License:
- Fixing license file encoding.

* Wed May 02 2012 Alec Leamas <leamas.alec@gmail.com> - 0.7.4-1
- Initial release
openSUSE Build Service is sponsored by