Compare commits

...

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

4 changed files with 107 additions and 22 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/Python-3.6.3.tar.xz
/Python-3.6.3.tar.xz

View File

@ -1 +0,0 @@
6c71b14bdbc4d8aa0cfd59d4b6dc356d46abfdf5 SOURCES/Python-3.6.3.tar.xz

View File

@ -2,15 +2,18 @@
# IMPORTANT
# ==================
# This package is intended only for the RHEL8 buildroot, and therefore
# it's blocked from going into the rhel-8.0-candidate tag.
# See: https://projects.engineering.redhat.com/browse/RCM-37705
# This package is intended only for the RHEL8 buildroot.
# The python36 package for the python36 module is on the git branch
# `stream-3.6`.
#
# To build it, use the `-skip-tag` option and then tag the build into
# the `rhel-8.0-override` tag.
# You can build this package normally as you would any other package.
# Please keep the "buildroot" part of the "Release" tag so it can be
# easily distinguished.
#
# Relevant JIRA tickets:
# * https://projects.engineering.redhat.com/browse/RCM-42305
# * https://projects.engineering.redhat.com/browse/RCM-37705
# (superceded by the one above)
@ -22,7 +25,7 @@
Name: python36
Version: %{pybasever}.6
Release: 13.buildroot%{?dist}
Release: 14.buildroot%{?dist}
Summary: Interpreter of the Python programming language
License: Python
@ -63,6 +66,11 @@ Obsoletes: python3 < 3.6.6-13
Requires: %{_libexecdir}/platform-python
# Require alternatives version that implements the --keep-foreign flag
Requires: alternatives >= 1.19.2-1
Requires(post): alternatives >= 1.19.2-1
Requires(postun): alternatives >= 1.19.2-1
%global _description \
Python is an accessible, high-level, dynamically typed, interpreted programming\
language, designed with an emphasis on code readibility.\
@ -87,6 +95,12 @@ Summary: Libraries and header files needed for Python development
Requires: python36
Requires: platform-python-devel
# Require alternatives version that implements the --keep-foreign flag
Requires(postun): alternatives >= 1.19.2-1
# python36 installs the alternatives master symlink to which we attach a slave
Requires(post): python36
Requires(postun): python36
%description devel
This package contains the header files and configuration needed to compile
Python extension modules (typically written in C or C++), to embed Python
@ -105,6 +119,12 @@ Requires: python36
Requires: python36-devel
Requires: platform-python-debug
# Require alternatives version that implements the --keep-foreign flag
Requires(postun): alternatives >= 1.19.2-1
# python36 installs the alternatives master symlink to which we attach a slave
Requires(post): python36
Requires(postun): python36
%description debug
python3-debug provides a version of the Python runtime with numerous debugging
features enabled, aimed at advanced Python users such as developers of Python
@ -137,13 +157,9 @@ mkdir -p %{buildroot}%{_bindir}
# Symlink the executable to libexec
ln -s %{_libexecdir}/platform-python%{pybasever} %{buildroot}%{_bindir}/python%{pybasever}
# Additional symlink for buildroot
ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_bindir}/python3
# Symlink the config executables
ln -s python%{LDVERSION_optimized}-config %{buildroot}%{_bindir}/python%{pybasever}-config
# Additional symlink for buildroot
ln -s %{_bindir}/python%{pybasever}-config %{buildroot}%{_bindir}/python3-config
# LDVERSION specific section
InstallPython() {
@ -162,20 +178,85 @@ InstallPython %{LDVERSION_debug}
# General debug symlinks
ln -s python%{LDVERSION_debug}-config %{buildroot}%{_bindir}/python%{pybasever}-debug-config
ln -s python%{LDVERSION_debug} %{buildroot}%{_bindir}/python%{pybasever}-debug
# Additional symlinks for buildroot
ln -s %{_bindir}/python%{pybasever}-debug-config %{buildroot}%{_bindir}/python3-debug-config
ln -s %{_bindir}/python%{pybasever}-debug %{buildroot}%{_bindir}/python3-debug
%endif # with debug_build
InstallPython %{LDVERSION_optimized}
# All ghost files controlled by alternatives need to exist for the files
# section check to succeed
# - Don't list /usr/bin/python as a ghost file so `yum install /usr/bin/python`
# doesn't install this package
touch %{buildroot}%{_bindir}/python3
touch %{buildroot}%{_bindir}/python3-config
touch %{buildroot}%{_bindir}/python3-debug
touch %{buildroot}%{_bindir}/python3-debug-config
%post
# Alternative for /usr/bin/python3 -> /usr/bin/python3.6
# Create only if it doesn't exist already
EXISTS=`alternatives --display python3 | \
grep -c "^/usr/bin/python3.6 - priority [0-9]*"`
if [ $EXISTS -eq 0 ]; then
alternatives --install %{_bindir}/python3 \
python3 \
%{_bindir}/python3.6 \
1000000
fi
%postun
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove python3 \
%{_bindir}/python3.6
# Remove link python → python3 if no other python3.* exists
if ! alternatives --display python3 > /dev/null; then
alternatives --keep-foreign --remove python \
%{_bindir}/python3
fi
fi
%post -n python36-devel
alternatives --add-slave python3 %{_bindir}/python3.6 \
%{_bindir}/python3-config \
python3-config \
%{_bindir}/python3.6-config
%postun -n python36-devel
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.6 \
python3-config
fi
%post -n python36-debug
alternatives --add-slave python3 %{_bindir}/python3.6 \
%{_bindir}/python3-debug \
python3-debug \
%{_bindir}/python3.6-debug
alternatives --add-slave python3 %{_bindir}/python3.6 \
%{_bindir}/python3-debug-config \
python3-debug-config \
%{_bindir}/python3.6-debug-config
%postun -n python36-debug
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.6 \
python3-debug
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.6 \
python3-debug-config
fi
%files
%license LICENSE
%doc README.rst
%{_bindir}/python%{pybasever}
%{_bindir}/python%{LDVERSION_optimized}
%{_bindir}/python3
%ghost %{_bindir}/python3
%files devel
%license LICENSE
@ -183,7 +264,7 @@ InstallPython %{LDVERSION_optimized}
%{_bindir}/python%{pybasever}-config
%{_bindir}/python%{LDVERSION_optimized}-config
%{_bindir}/python%{LDVERSION_optimized}-*-config
%{_bindir}/python3-config
%ghost %{_bindir}/python3-config
%files debug
%license LICENSE
@ -193,13 +274,17 @@ InstallPython %{LDVERSION_optimized}
%{_bindir}/python%{LDVERSION_debug}-*-config
%{_bindir}/python%{pybasever}-debug-config
%{_bindir}/python%{pybasever}-debug
%{_bindir}/python3-debug
%{_bindir}/python3-debug-config
%ghost %{_bindir}/python3-debug
%ghost %{_bindir}/python3-debug-config
# IMPORTANT #
# See note at the top of the spec file #
%changelog
* Mon Jan 29 2024 Lumír Balhar <lbalhar@redhat.com> - 3.6.6-14.buildroot
- Implemented alternatives the same way as they're in python36 module
Resolves: RHEL-23019
* Sat Sep 29 2018 Tomas Orsava <torsava@redhat.com> - 3.6.6-13.buildroot
- Merged `stream-3.6` branch into the `rhel-8.0` branch for the buildroot
- Differences:

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (Python-3.6.3.tar.xz) = 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b