The unversioned Python RPM macros
Go to file
Miro Hrončok 5cf7712d6f Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme
Our Pythons currently patches distutils to install packages to
/usr/lib(64)/pythonX.Y/site-packages when the $RPM_BUILD_ROOT environment
variable is set (and to /usr/local/lib(64)/pythonX.Y/site-packages otherwise).
With the deprecation of distutils [1] we want to change the patch to create
and use a different sysconfig install scheme [2].

However, we have realized that macros defined as %(%{__python3} ...) don't
"see" the environment variables set by rpmbuild because they are expanded earlier
and hence e.g. %{python3_sitelib} evaluates to
/usr/local/lib/python3.X/site-packages -- which is not desired.
To be able to reliably detect an RPM build environment by checking
the presence of the $RPM_BUILD_ROOT environment variable,
we manually set it in the macro definitions.

Since %{buildroot} in not fully populated
(e.g. it can expand literally to
/home/anna/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64),
we don't use it here.
The variable simply needs to present in the environment.

See also the analysis of the build failures when this is not done [3].

[1] https://www.python.org/dev/peps/pep-0632/
[2] https://bugs.python.org/issue43976
[3] https://src.fedoraproject.org/rpms/python3.10/pull-request/63#comment-79042

Related: rhbz#1950291
2021-12-14 21:28:24 +01:00
tests CI eval tests: Drop the python3.6 dependency 2021-08-25 14:21:23 +02:00
.gitignore New branch setup 2020-10-08 23:33:09 +00:00
compileall2.py RHEL 9.0.0 Alpha bootstrap 2020-10-14 20:10:31 -07:00
gating.yaml Add gating.yaml from RHEL 2021-06-02 12:42:49 +02:00
macros.pybytecompile Escape % symbols in macro files comments 2021-05-05 17:18:32 +02:00
macros.python Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-12-14 21:28:24 +01:00
macros.python3 Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-12-14 21:28:24 +01:00
macros.python-srpm Define a new macros %python_wheel_dir and %python_wheel_pkg_prefix 2021-11-05 10:47:41 +01:00
python-rpm-macros.spec Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-12-14 21:28:24 +01:00
python.lua Update comment for python_altnames() to reflect the reality 2021-04-22 18:25:28 +02:00
sources RHEL 9.0.0 Alpha bootstrap 2020-10-14 20:10:31 -07:00