2021-01-23 22:22:39 +00:00
#
# spec file for package python-oletools
#
2024-02-02 14:35:27 +00:00
# Copyright (c) 2024 SUSE LLC
2021-01-23 22:22:39 +00:00
#
# 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 https://bugs.opensuse.org/
#
Name : python-oletools
2024-02-02 14:35:27 +00:00
Version : 0.60.1
2021-01-23 22:22:39 +00:00
Release : 0
Summary : Tools to analyze security characteristics of MS Office and OLE files
2021-04-05 19:32:20 +00:00
License : BSD-2-Clause AND MIT
2021-01-23 22:22:39 +00:00
URL : http://www.decalage.info/python/oletools
Source : https://files.pythonhosted.org/packages/source/o/oletools/oletools-%{version} .zip
BuildRequires : %{python_module setuptools}
2021-04-05 19:32:20 +00:00
BuildRequires : python-rpm-macros
2021-01-23 22:22:39 +00:00
# SECTION test requirements
BuildRequires : %{python_module colorclass}
BuildRequires : %{python_module easygui}
BuildRequires : %{python_module msoffcrypto-tool}
BuildRequires : %{python_module olefile >= 0.46}
BuildRequires : %{python_module pyparsing >= 2.1.0}
2021-12-14 14:00:54 +00:00
BuildRequires : %{python_module pytest}
2021-01-23 22:22:39 +00:00
# /SECTION
BuildRequires : unzip
2024-02-02 14:35:27 +00:00
BuildRequires : dos2unix
2021-01-23 22:22:39 +00:00
BuildRequires : fdupes
2021-07-12 17:50:38 +00:00
%if 0%{?sle_version} == 150200 || 0%{?sle_version} == 150300
BuildRequires : python2-xml
%endif
2021-01-23 22:22:39 +00:00
Requires : python-colorclass
Requires : python-easygui
Requires : python-msoffcrypto-tool
Requires : python-olefile >= 0.46
Recommends: python-pcodedmp >= 1.2.5
Requires : python-pyparsing >= 2.1.0
2021-07-12 17:50:38 +00:00
%if "%{python_flavor}" == "python2"
Requires : python2-xml
%endif
2024-02-02 14:35:27 +00:00
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
2021-01-23 22:22:39 +00:00
BuildArch : noarch
%python_subpackages
%description
Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response (DFIR)
%prep
%setup -q -n oletools-%{version}
find oletools -name " * . p y " -exec sed -i '1{/\/bin\/env python/d;}' {} \+
find oletools -name " * . p y " -exec sed -i 's/\r\n/\n/' {} \+
2024-02-02 14:35:27 +00:00
dos2unix tests/olevba/test_basic.py oletools/olevba.py README.md
2021-01-23 22:22:39 +00:00
%build
%python_build
%install
%python_install
# remove actually optional dependency from requires
sed -i '1{/pcodedmp/d;}' %{buildroot} %{python_sitelib} /oletools-*.egg-info/requires.txt
%python_clone -a %{buildroot} %{_bindir} /ezhexviewer
%python_clone -a %{buildroot} %{_bindir} /mraptor
%python_clone -a %{buildroot} %{_bindir} /olebrowse
%python_clone -a %{buildroot} %{_bindir} /oledir
%python_clone -a %{buildroot} %{_bindir} /oleid
%python_clone -a %{buildroot} %{_bindir} /olemap
%python_clone -a %{buildroot} %{_bindir} /olemeta
%python_clone -a %{buildroot} %{_bindir} /oletimes
%python_clone -a %{buildroot} %{_bindir} /olevba
%python_clone -a %{buildroot} %{_bindir} /pyxswf
%python_clone -a %{buildroot} %{_bindir} /rtfobj
%python_clone -a %{buildroot} %{_bindir} /oleobj
%python_clone -a %{buildroot} %{_bindir} /msodde
%python_clone -a %{buildroot} %{_bindir} /olefile
2021-06-21 07:20:36 +00:00
%python_clone -a %{buildroot} %{_bindir} /ftguess
2021-01-23 22:22:39 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
%check
2024-02-02 14:35:27 +00:00
# test_macros, test_empty_behaviour, test_rtf_behaviour, test_text_behaviour, test_xlm: reported at https://github.com/decalage2/oletools/issues/767
%pytest -k 'not test_rough_doctype and not test_encrypted and not test_crypt_return and not test_all and not test_macros and not test_empty_behaviour and not test_rtf_behaviour and not test_text_behaviour and not test_xlm'
#%%pyunittest
2021-01-23 22:22:39 +00:00
%post
2021-06-21 07:20:36 +00:00
%python_install_alternative ezhexviewer mraptor olebrowse oledir oleid olemap olemeta oletimes olevba pyxswf rtfobj oleobj msodde olefile ftguess
2021-01-23 22:22:39 +00:00
%postun
%python_uninstall_alternative ezhexviewer
%files %{python_files}
2021-04-05 19:32:20 +00:00
%doc README.md
%license oletools/LICENSE.txt
2021-01-23 22:22:39 +00:00
%python_alternative %{_bindir} /ezhexviewer
%python_alternative %{_bindir} /mraptor
%python_alternative %{_bindir} /olebrowse
%python_alternative %{_bindir} /oledir
%python_alternative %{_bindir} /oleid
%python_alternative %{_bindir} /olemap
%python_alternative %{_bindir} /olemeta
%python_alternative %{_bindir} /oletimes
%python_alternative %{_bindir} /olevba
%python_alternative %{_bindir} /pyxswf
%python_alternative %{_bindir} /rtfobj
%python_alternative %{_bindir} /oleobj
%python_alternative %{_bindir} /msodde
%python_alternative %{_bindir} /olefile
2021-06-21 07:20:36 +00:00
%python_alternative %{_bindir} /ftguess
2024-02-02 14:35:27 +00:00
%{python_sitelib} /oletools/
%{python_sitelib} /oletools-%{version} -py*.egg-info
2021-01-23 22:22:39 +00:00
%changelog