#34 Define a new macros %python_wheel_dir and %python_wheel_pkg_prefix
Merged 2 years ago by churchyard. Opened 2 years ago by torsava.
rpms/ torsava/epel-rpm-macros macronized-wheels  into  epel8

file modified
+4 -1
@@ -1,6 +1,6 @@ 

  Name:           epel-rpm-macros

  Version:        8

- Release:        24

+ Release:        25

  Summary:        Extra Packages for Enterprise Linux RPM macros

  

  Group:          System Environment/Base
@@ -72,6 +72,9 @@ 

  

  

  %changelog

+ * Tue Oct 26 2021 Tomas Orsava <torsava@redhat.com> - 8-25

+ - Define a new macros %%python_wheel_dir and %%python_wheel_pkg_prefix

+ 

  * Wed Sep  1 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 8-24

  - Fix macros.build-constraints' %%limit_build

    - number of CPUs will never be set to less than 1

file modified
+14
@@ -115,6 +115,20 @@ 

  %undefine __pythondist_requires \

  %{nil}

  

+ # Define where Python wheels will be stored and the prefix of -wheel packages

+ # - In Fedora we want wheel subpackages named e.g. `python-pip-wheel` that

+ #   install packages into `/usr/share/python-wheels`. Both names are not

+ #   versioned, because they're used by all Python 3 stacks.

+ # - In RHEL we want wheel packages named e.g. `python3-pip-wheel` and

+ #   `python3.11-pip-wheel` that install packages into similarly versioned

+ #   locations. We want each Python stack in RHEL to have their own wheels,

+ #   because the main python3 wheels (which we can't upgrade) will likely be

+ #   quite old by the time we're adding new alternate Python stacks.

+ # - In ELN we want to follow Fedora, because builds for ELN and Fedora rawhide

+ #   need to be interoperable.

+ %python_wheel_pkg_prefix python%{?rhel:%{!?eln:%{python3_pkgversion}}}

+ %python_wheel_dir %{_datadir}/%{python_wheel_pkg_prefix}-wheels

+ 

  # gpgverify verifies signed sources. There is documentation in the script.

  %gpgverify(k:s:d:) %{lua:

  local script = rpm.expand("%{_rpmconfigdir}/gpgverify ")

Build succeeded.

The results are expected:

<mock-chroot> sh-4.4$ rpm --eval '%python_wheel_dir'
/usr/share/python3-wheels
<mock-chroot> sh-4.4$ rpm --eval '%python_wheel_pkg_prefix'
python3
<mock-chroot> sh-4.4$ rpm --define 'python3_pkgversion 38' --eval '%python_wheel_dir'
/usr/share/python38-wheels
<mock-chroot> sh-4.4$ rpm --define 'python3_pkgversion 38' --eval '%python_wheel_pkg_prefix'
python38

And If I build an SRPM on EPEL 8 system with fedpkg, it even evaluates as if on Fedora:

<mock-chroot> sh-4.4$ fedpkg srpm  # on branch rawhide

Wrote: /builddir/python3.11/python3.11-3.11.0~a1-2.fc36.src.rpm


<mock-chroot> sh-4.4$ rpm -q --requires /builddir/python3.11/python3.11-3.11.0~a1-2.fc36.src.rpm | grep wheel
python-pip-wheel
python-setuptools-wheel

Pull-Request has been merged by churchyard

2 years ago