use python-build to fix uninstalled files [release 0.4.8-3mamba;Sat May 28 2022]

This commit is contained in:
Silvan Calarco 2024-01-06 11:27:11 +01:00
parent e1d99a005f
commit 1108466fa7

View File

@ -1,19 +1,26 @@
%define pkgname %(echo %name | cut -d- -f2- | tr - _)
Name: python-mechanize
Version: 0.4.8
Release: 2mamba
Release: 3mamba
Summary: Stateful programmatic web browsing in Python
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/python-mechanize/mechanize
#Source: https://github.com/python-mechanize/mechanize.git/v%{version}/mechanize-%{version}.tar.bz2
Source: https://pypi.debian.net/mechanize/mechanize-%{version}.tar.gz
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: libpython3-devel
BuildRequires: python3.7dist(html5lib)
## AUTOBUILDREQ-END
BuildRequires: python-build-py3
BuildRequires: python-wheel-py3
BuildRequires: python-python_install-py3
BuildRequires: python-build-py310
BuildRequires: python-wheel-py310
BuildRequires: python-python_install-py310
%description
Stateful programmatic web browsing in Python, after Andy Lesters Perl module WWW::Mechanize.
@ -27,26 +34,25 @@ Stateful programmatic web browsing in Python, after Andy Lesters Perl module
#%patch0 -p1
%build
CFLAGS="%{optflags}" %{__python} setup.py build
%{__python} -m build --wheel --skip-dependency-check
#--no-isolation
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%{__python} setup.py install \
-O1 --skip-build \
--root="%{buildroot}" \
--install-headers=%{python_inc} \
--install-lib=%{python_sitearch} \
--record=%{name}.filelist
sed -i "\,\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
%{__python} -m venv --system-site-packages test-env
%{__python} -m install --optimize=1 --destdir="%{buildroot}" dist/*.whl
%files %{?pyappend}
#-f %{name}.filelist
%defattr(-,root,root)
%dir %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info
%{python_sitearch}/%{pkgname}-%{version}-py*.egg-info/*
%dir %{python_sitelib}/%{pkgname}
%{python_sitelib}/%{pkgname}/*
%dir %{python_sitelib}/%{pkgname}-%{version}.dist-info
%{python_sitelib}/%{pkgname}-%{version}.dist-info/*
%changelog
* Sat May 28 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 0.4.8-3mamba
- use python-build to fix uninstalled files
* Thu May 05 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 0.4.8-2mamba
- rebuilt with distdeps and python 3.10 subpackage