import CS python-rpm-macros-3.12-10.el10
This commit is contained in:
parent
f614affe11
commit
ce3261867e
15
brp-python-rpm-in-distinfo
Executable file
15
brp-python-rpm-in-distinfo
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
# If using normal root, avoid changing anything.
|
||||
if [ "${RPM_BUILD_ROOT:-/}" = "/" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
find "$RPM_BUILD_ROOT" -name 'INSTALLER' -type f -print0|grep -z -E "/usr/lib(64)?/python3\.[0-9]+/site-packages/[^/]+\.dist-info/INSTALLER" | while read -d "" installer ; do
|
||||
if cmp -s <(echo pip) "$installer" ; then
|
||||
echo "rpm" > "$installer"
|
||||
rm -f $(dirname "$installer")/RECORD
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
@ -66,6 +66,8 @@
|
||||
|
||||
### BRP scripts (and related macros)
|
||||
|
||||
## Modifies installation method in .dist-info/INSTALLER file to rpm
|
||||
%python_rpm_in_distinfo 1
|
||||
## Automatically compile python files
|
||||
%py_auto_byte_compile 1
|
||||
## Should python bytecompilation errors terminate a build?
|
||||
@ -78,16 +80,19 @@
|
||||
%__env_unset_source_date_epoch_if_not_clamp_mtime %[0%{?clamp_mtime_to_source_date_epoch} == 0 ? "env -u SOURCE_DATE_EPOCH" : "env"]
|
||||
|
||||
## The individual BRP scripts
|
||||
%__brp_python_rpm_in_distinfo %{_rpmconfigdir}/redhat/brp-python-rpm-in-distinfo
|
||||
%__brp_python_bytecompile %{__env_unset_source_date_epoch_if_not_clamp_mtime} %{_rpmconfigdir}/redhat/brp-python-bytecompile "" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}" "%{?_smp_build_ncpus:-j%{_smp_build_ncpus}}"
|
||||
%__brp_fix_pyc_reproducibility %{_rpmconfigdir}/redhat/brp-fix-pyc-reproducibility
|
||||
%__brp_python_hardlink %{_rpmconfigdir}/redhat/brp-python-hardlink
|
||||
|
||||
## This macro is included in redhat-rpm-config's %%__os_install_post
|
||||
# Note that the order matters:
|
||||
# 1. brp-python-bytecompile can create (or replace) pyc files
|
||||
# 2. brp-fix-pyc-reproducibility can modify the pyc files from above
|
||||
# 3. brp-python-hardlink de-duplicates identical pyc files
|
||||
# 1. brp-python-rpm-in-distinfo modifies .dist-info/INSTALLER file
|
||||
# 2. brp-python-bytecompile can create (or replace) pyc files
|
||||
# 3. brp-fix-pyc-reproducibility can modify the pyc files from above
|
||||
# 4. brp-python-hardlink de-duplicates identical pyc files
|
||||
%__os_install_post_python \
|
||||
%{?python_rpm_in_distinfo:%{?__brp_python_rpm_in_distinfo}} \
|
||||
%{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \
|
||||
%{?py_reproducible_pyc_path:%{?__brp_fix_pyc_reproducibility} "%{py_reproducible_pyc_path}"} \
|
||||
%{?__brp_python_hardlink} \
|
||||
|
||||
@ -33,6 +33,8 @@ Source402: brp-python-hardlink
|
||||
# This one is from redhat-rpm-config < 190
|
||||
# It has no upstream yet
|
||||
Source403: brp-fix-pyc-reproducibility
|
||||
# brp script to write "rpm" string into the .dist-info/INSTALLER file
|
||||
Source404: brp-python-rpm-in-distinfo
|
||||
|
||||
# macros and lua: MIT
|
||||
# import_all_modules.py: MIT
|
||||
@ -53,7 +55,7 @@ elseif posix.stat('macros.python-srpm') then
|
||||
end
|
||||
}
|
||||
Version: %{__default_python3_version}
|
||||
Release: 9.1%{?dist}
|
||||
Release: 10%{?dist}
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -136,6 +138,7 @@ install -m 755 brp-* %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
%global __brp_python_bytecompile %{add_buildroot __brp_python_bytecompile}
|
||||
%global __brp_python_hardlink %{add_buildroot __brp_python_hardlink}
|
||||
%global __brp_fix_pyc_reproducibility %{add_buildroot __brp_fix_pyc_reproducibility}
|
||||
%global __brp_python_rpm_in_distinfo %{add_buildroot __brp_python_rpm_in_distinfo}
|
||||
|
||||
|
||||
%check
|
||||
@ -156,6 +159,7 @@ grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* && exit 1 || true
|
||||
%{_rpmconfigdir}/redhat/brp-python-bytecompile
|
||||
%{_rpmconfigdir}/redhat/brp-python-hardlink
|
||||
%{_rpmconfigdir}/redhat/brp-fix-pyc-reproducibility
|
||||
%{_rpmconfigdir}/redhat/brp-python-rpm-in-distinfo
|
||||
%{_rpmluadir}/fedora/srpm/python.lua
|
||||
|
||||
%files -n python3-rpm-macros
|
||||
@ -163,6 +167,10 @@ grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* && exit 1 || true
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Apr 07 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12-10
|
||||
- Add brp script to modify .dist-info/INSTALLER file
|
||||
- Resolves: RHEL-86802
|
||||
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com>
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
Loading…
Reference in New Issue
Block a user