2025-12-10 10:04:46 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-msoffcrypto-tool
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
|
|
|
#
|
|
|
|
|
# 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/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%{?sle15_python_module_pythons}
|
|
|
|
|
Name: python-msoffcrypto-tool
|
|
|
|
|
Version: 5.4.2
|
|
|
|
|
Release: 0
|
|
|
|
|
Summary: Library for decrypting MS Office files
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/nolze/msoffcrypto-tool
|
2025-12-10 14:43:21 +00:00
|
|
|
Source: https://github.com/nolze/msoffcrypto-tool/archive/v%{version}.tar.gz#/msoffcrypto_tool-%{version}.tar.gz
|
2025-12-10 10:04:46 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2025-12-10 14:43:21 +00:00
|
|
|
BuildRequires: %{python_module poetry-core}
|
|
|
|
|
BuildRequires: %{python_module wheel}
|
2025-12-10 10:04:46 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
Requires: python-cryptography >= 39.0
|
|
|
|
|
Requires: python-olefile >= 0.46
|
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
# SECTION test requirements
|
|
|
|
|
BuildRequires: %{python_module cryptography >= 39.0}
|
|
|
|
|
BuildRequires: %{python_module olefile >= 0.46}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
|
# /SECTION
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
A Python tool and library for decrypting MS Office
|
|
|
|
|
files with passwords or other keys.
|
|
|
|
|
|
|
|
|
|
%prep
|
2025-12-10 14:43:21 +00:00
|
|
|
%autosetup -p1 -n msoffcrypto-tool-%{version}
|
2025-12-10 10:04:46 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/msoffcrypto-tool
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
|
|
%check
|
2025-12-10 14:43:21 +00:00
|
|
|
# pytest creates an illegitimate doctest case for __main__ which then fails
|
|
|
|
|
%{python_expand #
|
|
|
|
|
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
|
|
|
|
sed -i "s/python\([0-9]\.[0-9]*\)\?/python%{$python_bin_suffix}/" tests/test_cli.sh
|
|
|
|
|
$python -m pytest --doctest-modules -k 'not __main__'
|
|
|
|
|
}
|
2025-12-10 10:04:46 +00:00
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%python_install_alternative msoffcrypto-tool
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative msoffcrypto-tool
|
|
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
|
%doc README.md
|
2025-12-10 14:43:21 +00:00
|
|
|
%doc %{python_sitelib}/NOTICE.txt
|
2025-12-10 10:04:46 +00:00
|
|
|
%license LICENSE.txt
|
|
|
|
|
%python_alternative %{_bindir}/msoffcrypto-tool
|
2025-12-10 14:43:21 +00:00
|
|
|
%{python_sitelib}/msoffcrypto
|
|
|
|
|
%{python_sitelib}/msoffcrypto_tool-%{version}.dist-info
|
2025-12-10 10:04:46 +00:00
|
|
|
|
|
|
|
|
%changelog
|