%global _empty_manifest_terminate_build 0
Name:		python-shamir-mnemonic
Version:	0.3.0
Release:	1
Summary:	SLIP-39 Shamir Mnemonics
License:	MIT License
URL:		https://github.com/trezor/python-shamir-mnemonic
Source0:	https://files.pythonhosted.org/packages/b2/fd/9f5b305b5280795209817efe6b0cd6017f4714e3f36d160b2d4dfcc78c02/shamir_mnemonic-%{version}.tar.gz
BuildArch:	noarch

Requires:	python3-attrs
Requires:	python3-click
Requires:	python3-colorama

%description
This SLIP describes a standard and interoperable implementation of Shamir's secret sharing (SSS).
SSS splits a secret into unique parts which can be distributed among participants,
and requires a specified minimum number of parts to be supplied in order to reconstruct the original secret.
Knowledge of fewer than the required number of parts does not leak information about the secret.

%package -n python3-shamir-mnemonic
Summary:	SLIP-39 Shamir Mnemonics
Provides:	python-shamir-mnemonic
BuildRequires:	python3-devel
BuildRequires:	python3-pip
BuildRequires:	python3-setuptools
BuildRequires:	python3-wheel
BuildRequires:	python3-poetry-core
%description -n python3-shamir-mnemonic
This SLIP describes a standard and interoperable implementation of Shamir's secret sharing (SSS).
SSS splits a secret into unique parts which can be distributed among participants,
and requires a specified minimum number of parts to be supplied in order to reconstruct the original secret.
Knowledge of fewer than the required number of parts does not leak information about the secret.

%package help
Summary:	Development documents and examples for shamir-mnemonic
Provides:	python3-shamir-mnemonic-doc
%description help
This SLIP describes a standard and interoperable implementation of Shamir's secret sharing (SSS).
SSS splits a secret into unique parts which can be distributed among participants,
and requires a specified minimum number of parts to be supplied in order to reconstruct the original secret.
Knowledge of fewer than the required number of parts does not leak information about the secret.

%prep
%autosetup -n shamir_mnemonic-%{version}

%build
%pyproject_build

%install
%pyproject_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f ! -path "*/__pycache__/*" ! -name "*.pyc" ! -name "*.pyo" -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f ! -path "*/__pycache__/*" ! -name "*.pyc" ! -name "*.pyo" -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f ! -path "*/__pycache__/*" ! -name "*.pyc" ! -name "*.pyo" -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f ! -path "*/__pycache__/*" ! -name "*.pyc" ! -name "*.pyo" -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
# Remove __pycache__ directories and .pyc/.pyo files to ensure they are not packaged
find %{buildroot} -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find %{buildroot} -type f -name "*.pyc" -delete
find %{buildroot} -type f -name "*.pyo" -delete
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-shamir-mnemonic -f filelist.lst
%dir %{python3_sitelib}/*
%exclude %{python3_sitelib}/shamir_mnemonic/__pycache__
%exclude %{python3_sitelib}/shamir_mnemonic/__pycache__/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Thu Nov 13 2025 zhao6777 <zhaojianbin@kylinos.cn> - 0.3.0-1
- Update to 0.3.0
- Fix __pycache__ exclusion issue

* Wed Jun 21 2023 chendexi <chendexi@kylinos.cn> - 0.2.2-1
- Update package to version 0.2.2

* Tue Aug 31 2021 Python_Bot <Python_Bot@openeuler.org> - 0.2.1-1
- Package Init