Update to 0.44

epel9
Sandro Mani 8 years ago
parent 9c074b3efd
commit 5f79ede199

1
.gitignore vendored

@ -1 +1,2 @@
/olefile-bc9d196.tar.gz
/olefile-0.44.zip

@ -1,21 +0,0 @@
diff -rupN olefile-bc9d196b02e9be2d179c5b75c696a8e041232254/OleFileIO_PL.py olefile-bc9d196b02e9be2d179c5b75c696a8e041232254-new/OleFileIO_PL.py
--- olefile-bc9d196b02e9be2d179c5b75c696a8e041232254/OleFileIO_PL.py 2016-11-29 23:09:20.000000000 +0100
+++ olefile-bc9d196b02e9be2d179c5b75c696a8e041232254-new/OleFileIO_PL.py 2017-01-02 18:39:48.255899000 +0100
@@ -24,14 +24,6 @@ See source code and LICENSE.txt for info
# The OleFileIO_PL module is for backward compatibility
-try:
- # first try to import olefile for Python 2.6+/3.x
- from olefile.olefile import *
- # import metadata not covered by *:
- from olefile.olefile import __version__, __author__, __date__
-
-except:
- # if it fails, fallback to the old version olefile2 for Python 2.x:
- from olefile.olefile2 import *
- # import metadata not covered by *:
- from olefile.olefile2 import __doc__, __version__, __author__, __date__
+from olefile.olefile import *
+# import metadata not covered by *:
+from olefile.olefile import __version__, __author__, __date__

@ -1,7 +1,4 @@
%global srcname olefile
%global commit bc9d196b02e9be2d179c5b75c696a8e041232254
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global _description \
olefile is a Python package to parse, read and write Microsoft OLE2 files\
(also called Structured Storage, Compound File Binary Format or Compound\
@ -12,20 +9,14 @@ antivirus quarantine files, etc.
Name: python-%{srcname}
Version: 0.44
Release: 0.4%{?commit:.git%shortcommit}%{?dist}
Release: 1%{?dist}
Summary: Python package to parse, read and write Microsoft OLE2 files
License: BSD
URL: https://github.com/decalage2/olefile/
%if %{defined commit}
Source0: %{url}/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz
%else
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
%endif
URL: https://pypi.python.org/pypi/olefile/
Source0: https://files.pythonhosted.org/packages/source/o/%{srcname}/%{srcname}-%{version}.zip
# Don't install docs (they are installed through %%doc)
Patch0: olefile_skip-doc.patch
# Remove reference to olefile2 (a pre python2.6 compatibility version)
Patch1: olefile_no-olefile2.patch
BuildArch: noarch
@ -36,6 +27,7 @@ BuildArch: noarch
%package -n python2-%{srcname}
Summary: %{summary}
BuildRequires: python2-devel
BuildRequires: python2-sphinx
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname} %{_description}
@ -46,6 +38,7 @@ Python2 version.
%package -n python3-%{srcname}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-sphinx
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname} %{_description}
@ -54,26 +47,15 @@ Python3 version.
%prep
%if %{defined commit}
%autosetup -p1 -n %{srcname}-%{commit}
%else
%autosetup -p1 -n %{srcname}-%{version}
%endif
# olefile2 is a pre python2.6 compatibility version
rm -f olefile/olefile2.*
# Remove shebang from non-executable scripts
sed -i -e '1{\@^#!/usr/local/bin/python@d}' OleFileIO_PL.py
sed -i -e '1{\@^#!/usr/local/bin/python@d}' olefile/__init__.py
sed -i -e '1{\@^#!/usr/bin/env python@d}' olefile/olefile.py
# Fix incorrect line endings
sed -i -e "s/\r//" olefile/doc/*.md
sed -i -e "s/\r//" OleFileIO_PL.py
%build
%py2_build
make -C doc html BUILDDIR=_build_py2 SPHINXBUILD=sphinx-build-%python2_version
%py3_build
make -C doc html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
%install
@ -82,20 +64,22 @@ sed -i -e "s/\r//" OleFileIO_PL.py
%check
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} tests/test_olefile.py
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} tests/test_olefile.py
# Tests got left out in the 0.44 source archive
# https://github.com/decalage2/olefile/issues/56
# PYTHONPATH=%%{buildroot}%%{python2_sitelib} %%{__python2} tests/test_olefile.py
# PYTHONPATH=%%{buildroot}%%{python3_sitelib} %%{__python3} tests/test_olefile.py
%files -n python2-%{srcname}
%doc README.md olefile/doc/*
%license olefile/doc/License.*
%doc README.md doc/_build_py2/html
%license doc/License.rst
%{python2_sitelib}/OleFileIO_PL.py*
%{python2_sitelib}/olefile-*.egg-info
%{python2_sitelib}/olefile/
%files -n python3-%{srcname}
%doc README.md olefile/doc/*
%license olefile/doc/License.*
%doc README.md doc/_build_py3/html
%license doc/License.rst
%{python3_sitelib}/OleFileIO_PL.py*
%{python3_sitelib}/__pycache__/OleFileIO_PL.*
%{python3_sitelib}/olefile-*.egg-info
@ -103,6 +87,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} tests/test_olefile.py
%changelog
* Thu Jan 12 2017 Sandro Mani <manisandro@gmail.com> - 0.44-1
- Update to 0.44
* Mon Jan 02 2017 Sandro Mani <manisandro@gmail.com> - 0.44-0.4.gitbc9d196
- Fix incorrect line endings
- Remove shebang from non-executable scripts

@ -1 +1 @@
SHA512 (olefile-bc9d196.tar.gz) = abcadc7cef109c4e8f98d390f662eeb8d6851f39fb998e97213f17f2a72ee1e7f7bedf3e56ede2c940bb652a802bbbb9863ac5fb4d11e0df41c1d981f67fa5b4
SHA512 (olefile-0.44.zip) = 096450638b21882d462ceb6c60ece2e603318f7f4783414ed33b45e3dbbf38a60f763144b14df6685a0d55cc034cf16f82a0f8ed8773fe9a7d10d6bf32d4edfc

Loading…
Cancel
Save