use unified __python macro

This commit is contained in:
Zdenek Dohnal 2023-09-11 14:08:50 +02:00
parent 30a0ba9cdc
commit 6ec0fd19d8

View File

@ -9,9 +9,9 @@
# we still need something for python2... # we still need something for python2...
%if 0%{?rhel} >= 8 || 0%{?fedora} %if 0%{?rhel} >= 8 || 0%{?fedora}
%bcond_without python3 %global __python %{__python3}
%else %else
%bcond_with python3 %global __python /usr/bin/python2
%endif %endif
#%%global prever rc1 #%%global prever rc1
@ -22,7 +22,7 @@ Summary: CUPS printing system
Name: cups Name: cups
Epoch: 1 Epoch: 1
Version: 2.4.6 Version: 2.4.6
Release: 5%{?dist} Release: 6%{?dist}
# backend/failover.c - BSD-3-Clause # backend/failover.c - BSD-3-Clause
# cups/md5* - Zlib # cups/md5* - Zlib
# scheduler/colorman.c - Apache-2.0 WITH LLVM-exception AND BSD-2-Clause # scheduler/colorman.c - Apache-2.0 WITH LLVM-exception AND BSD-2-Clause
@ -168,11 +168,7 @@ Requires(preun): systemd
Requires(postun): systemd Requires(postun): systemd
# for upgrade-get-document script - remove after C10S is released and F40 is EOL # for upgrade-get-document script - remove after C10S is released and F40 is EOL
%if %{with python3} Requires(post): %{__python}
Requires(post): python3
%else
Requires(post): python
%endif
%package client %package client
@ -488,11 +484,7 @@ s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
install -m 0755 %{SOURCE3} %{buildroot}%{_sbindir}/upgrade_get_document install -m 0755 %{SOURCE3} %{buildroot}%{_sbindir}/upgrade_get_document
# adjust shebang for old python2 if needed - remove once C10S is released and F40 EOL # adjust shebang for old python2 if needed - remove once C10S is released and F40 EOL
%if %{with python3} sed -i 's,@PYTHON_SHEBANG@,#!%{__python},' %{buildroot}%{_sbindir}/upgrade_get_document
sed -i 's,@PYTHON_SHEBANG@,#!/usr/bin/python3,' %{buildroot}%{_sbindir}/upgrade_get_document
%else
sed -i 's,@PYTHON_SHEBANG@,#!/usr/bin/python,' %{buildroot}%{_sbindir}/upgrade_get_document
%endif
%post %post
# remove after CentOS Stream 10 is released # remove after CentOS Stream 10 is released
@ -796,6 +788,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man7/ippeveps.7.gz %{_mandir}/man7/ippeveps.7.gz
%changelog %changelog
* Mon Sep 11 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.4.6-6
- use unified __python macro
* Mon Aug 14 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.4.6-5 * Mon Aug 14 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.4.6-5
- comply the upgrade script with python2 as well if needed - comply the upgrade script with python2 as well if needed