File python-extract_msg.spec of Package python-extract_msg
#
# spec file for package python-extract_msg
#
# Copyright (c) 2021, Martin Hauke <mardnh@gmx.de>
#
# 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-extract_msg
Version: 0.28.7
Release: 0
Summary: Extracts emails and attachments saved in Microsoft Outlook's msg files
License: GPL-3.0-or-later
URL: https://github.com/TeamMsgExtractor/msg-extractor
Source: extract_msg-%{version}.tar.xz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module compressed_rtf >= 1.0.6}
BuildRequires: %{python_module ebcdic >= 1.1.1}
BuildRequires: %{python_module IMAPClient == 2.1.0}
BuildRequires: %{python_module olefile >= 0.46}
BuildRequires: %{python_module tzlocal >= 2.1}
# /SECTION
BuildRequires: fdupes
Requires: python-compressed_rtf >= 1.0.6
Requires: python-ebcdic >= 1.1.1
Requires: python-IMAPClient == 2.1.0
Requires: python-olefile >= 0.46
Requires: python-tzlocal >= 2.1
BuildArch: noarch
%python_subpackages
%description
Extracts emails and attachments saved in Microsoft Outlook's .msg files.
%prep
%setup -q -n extract_msg-%{version}
sed -i -e '/^#!\//, 1d' extract_msg/__init__.py
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/extract_msg
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative extract_msg
%postun
%python_uninstall_alternative extract_msg
%check
# FIXME: tests are broken
#%%pyunittest -v
#%%python_exec tests.py
%files %{python_files}
%license LICENSE.txt
%python_alternative %{_bindir}/extract_msg
%{python_sitelib}/extract_msg*
%changelog