File python-olefile.spec of Package python-olefile

#
# spec file for package python-olefile
#
# Copyright (c) 2017 SUSE LINUX 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name:           python-olefile
Version:        0.44
Release:        0
Summary:        Read and write Microsoft OLE2 files
License:        BSD-2-Clause and HPND
Group:          Development/Languages/Python
Url:            https://www.decalage.info/python/olefileio
Source:         https://files.pythonhosted.org/packages/source/o/olefile/olefile-%{version}.zip
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  unzip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       python-OleFileIO_PL = %{version}
Obsoletes:      python-OleFileIO_PL <= 0.26
%ifpython2
Provides:       %{oldpython}-OleFileIO_PL = %{version}
Obsoletes:      %{oldpython}-OleFileIO_PL <= 0.26
%endif
%python_subpackages

%description
Olefile is a Python package to parse, read and write Microsoft OLE2
files (also called Structured Storage, Compound File Binary Format or
Compound Document File Format), such as Microsoft Office 97-2003
documents, vbaProject.bin in MS Office 2007+ files, Image Composer and
FlashPix files, Outlook messages, StickyNotes, several Microscopy file
formats, McAfee antivirus quarantine files, etc.

%prep
%setup -q -n olefile-%{version}
# Fix wrong-file-end-of-line-encoding
sed -i 's/\r$//' doc/License.rst

%build
%python_build

%install
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}

%files %{python_files}
%defattr(-,root,root,-)
%doc README.md doc/License.rst
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by