improve pyproject_install macro

This commit is contained in:
caodongxia 2023-05-11 10:44:59 +08:00
parent 146d4ce7bf
commit a20620c109
2 changed files with 9 additions and 5 deletions

View File

@ -4,8 +4,8 @@ Date: Thu, 13 Apr 2023 17:11:53 +0800
Subject: [PATCH] add pyproject macros
---
macros.python | 11 +++++++++++
1 file changed, 11 insertions(+)
macros.python | 12 +++++++++++
1 file changed, 12 insertions(+)
diff --git a/macros.python b/macros.python
index d504d3f..d5a7a86 100644
@ -24,13 +24,14 @@ index d504d3f..d5a7a86 100644
%py_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
@@ -45,6 +51,11 @@ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $pyth
@@ -45,6 +51,12 @@ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $pyth
%{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
+%pyproject_install() %{expand:\\\
+ specifier=$(ls ./build/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/')
+ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
+ %{__python3} -mpip install --verbose --progress-bar off --disable-pip-version-check --root %{buildroot} --no-compile --ignore-installed --no-deps --no-index --find-links ./build %{?*}
+ %{__python3} -mpip install --verbose --progress-bar off --disable-pip-version-check --root %{buildroot} --no-compile --ignore-installed --no-deps --no-index --find-links ./build $specifier %{?*}
+}
+
%py_install_egg() %{expand:\\\

View File

@ -3,7 +3,7 @@
Name: %{vendor}-rpm-config
Version: 30
Release: 38
Release: 39
License: GPL+
Summary: specific rpm configuration files
URL: https://gitee.com/openeuler/openEuler-rpm-config
@ -141,6 +141,9 @@ sed -i "s/__vendor/%{vendor}/g" `grep "__vendor" -rl %{buildroot}%{_rpmconfigdir
%{rpmvdir}/find-requires.ksyms
%changelog
* Thu May 11 2023 caodongxia <caodongxia@h-partners.com> - 30-39
- improve pyproject_install macro
* Thu Apr 20 2023 caodongxia <caodongxia@h-partners.com> - 30-38
- support pyproject compilation