templates: python: update to build and installed modules; rename setuptools based template to python-setuptools

This commit is contained in:
Silvan Calarco 2022-10-08 16:18:58 +02:00
parent f6b5836e2a
commit db27bffab2
2 changed files with 56 additions and 12 deletions

View File

@ -25,23 +25,18 @@ License: ...
%setup -q %setup -q
%build %build
CFLAGS="%{optflags}" %{__python} setup.py build CFLAGS="%{optflags}" %{__python} -m build --no-isolation --wheel
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%{__python} setup.py install \\ %{__python} -m installer --destdir=%{buildroot} dist/*.whl
\ -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 %files %{?pyappend}
%files %{?pyappend} -f %{name}.filelist
%defattr(-,root,root) %defattr(-,root,root)
%dir %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info %dir %{python_sitelib}/%{pkgname}-%{version}.dist-info
%{python_sitearch}/%{pkgname}-%{version}-py*.egg-info/* %{python_sitelib}/%{pkgname}-%{version}.dist-info/*
%dir %{python_sitelib}/%{pkgname}
%{python_sitelib}/%{pkgname}/*
@standard_docs@ @standard_docs@
%changelog %changelog

View File

@ -0,0 +1,49 @@
%define pkgname %(echo %name | cut -d- -f2- | tr - _)
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: System/Libraries
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: ...
Source: ...
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
%description
%{summary}.
%if 0%{?with_pyver}
%pyver_package
%endif
%prep
%setup -q
%build
CFLAGS="%{optflags}" %{__python} setup.py build
%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
%files %{?pyappend} -f %{name}.filelist
%defattr(-,root,root)
%dir %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info
%{python_sitearch}/%{pkgname}-%{version}-py*.egg-info/*
@standard_docs@
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@