File python-OleFileIO_PL.spec of Package python-OleFileIO_PL

#
# spec file for package python-OleFileIO_PL
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           python-OleFileIO_PL
Version:        0.26
Release:        0
# The license text is the same as python-imaging which has "Python-2.0 ; MIT"
License:        Python-2.0 and MIT
Summary:        Python module to read Microsoft OLE2 files
Url:            https://bitbucket.org/decalage/olefileio_pl
Group:          Development/Libraries/Python
Source:         https://bitbucket.org/decalage/olefileio_pl/downloads/OleFileIO_PL-0.26.zip
BuildRequires:  python-devel
BuildRequires:  unzip
Provides:       OleFileIO_PL = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%else
BuildArch:      noarch
%endif


%description
OleFileIO_PL is a Python module to read Microsoft OLE2 files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office documents, Image Composer and FlashPix files, Outlook messages, ...

This is an improved version of the OleFileIO module from PIL, the excellent Python Imaging Library, created and maintained by Fredrik Lundh. The API is still compatible with PIL, but I have improved the internal implementation significantly, with new features, bugfixes and a more robust design.

As far as I know, this module is now the most complete and robust Python implementation to read MS OLE2 files, portable on several operating systems. (please tell me if you know other similar Python modules)

%prep
%setup -q -n OleFileIO_PL-%{version}
# fix end-of-line encoding
sed -i 's|\r$||' OleFileIO_PL.py *.txt
# delete the interpreter
sed -i -e "/#!\/usr\/local\/bin/d" OleFileIO_PL.py

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%files 
%defattr(-,root,root)
%doc LICENSE.txt README.html README.txt
%{python_sitelib}/OleFileIO_PL.py
%{python_sitelib}/OleFileIO_PL.pyc
%{python_sitelib}/OleFileIO_PL-%{version}-py%{py_ver}.egg-info


openSUSE Build Service is sponsored by