#44 F29: Use %python_provide macros for backward compatibility provides (+1 older commit)
Merged 4 years ago by churchyard. Opened 4 years ago by churchyard.
rpms/ churchyard/python2 python_provide  into  f29

file modified
+18 -13
@@ -193,6 +193,9 @@ 

  

  BuildRequires: zlib-devel

  

+ # For %%python_provide

+ BuildRequires: python-rpm-macros

+ 

  %if %{with rpmwheels}

  BuildRequires: python-setuptools-wheel

  BuildRequires: python-pip-wheel
@@ -828,8 +831,8 @@ 

  Provides: bundled(python2-setuptools) = 40.6.2

  %endif

  

- Provides: python-libs = %{version}-%{release}

- Provides: python-libs%{?_isa} = %{version}-%{release}

+ %{?python_provide:%python_provide python2-libs}

+ %{?python_provide:%python_provide python2-libs%{?_isa}}

  

  %description libs

  This package contains files used to embed Python 2 into applications.
@@ -869,8 +872,8 @@ 

  # package

  Conflicts: %{python} < %{version}-%{release}

  

- Provides: python-devel = %{version}-%{release}

- Provides: python-devel%{?_isa} = %{version}-%{release}

+ %{?python_provide:%python_provide python2-devel}

+ %{?python_provide:%python_provide python2-devel%{?_isa}}

  

  %description devel

  This package contains libraries and header files used to build applications
@@ -883,8 +886,8 @@ 

  Requires: %{name} = %{version}-%{release}

  Requires: %{python}-tkinter = %{version}-%{release}

  

- Provides: python-tools = %{version}-%{release}

- Provides: python-tools%{?_isa} = %{version}-%{release}

+ %{?python_provide:%python_provide python2-tools}

+ %{?python_provide:%python_provide python2-tools%{?_isa}}

  

  %description tools

  This package includes several tools to help with the development of Python 2
@@ -897,12 +900,14 @@ 

  

  Requires: %{name} = %{version}-%{release}

  

+ %if 0%{?fedora} < 31

  Provides: tkinter = %{version}-%{release}

  Provides: tkinter%{?_isa} = %{version}-%{release}

  Provides: tkinter2 = %{version}-%{release}

  Provides: tkinter2%{?_isa} = %{version}-%{release}

- Provides: python-tkinter = %{version}-%{release}

- Provides: python-tkinter%{?_isa} = %{version}-%{release}

+ %endif

+ %{?python_provide:%python_provide python2-tkinter}

+ %{?python_provide:%python_provide python2-tkinter%{?_isa}}

  

  %description tkinter

  
@@ -918,8 +923,8 @@ 

  

  Requires: %{name} = %{version}-%{release}

  

- Provides: python-test = %{version}-%{release}

- Provides: python-test%{?_isa} = %{version}-%{release}

+ %{?python_provide:%python_provide python2-test}

+ %{?python_provide:%python_provide python2-test%{?_isa}}

  

  %description test

  
@@ -945,8 +950,8 @@ 

  Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}

  Requires: %{name}-tools%{?_isa} = %{version}-%{release}

  

- Provides: python-debug = %{version}-%{release}

- Provides: python-debug%{?_isa} = %{version}-%{release}

+ %{?python_provide:%python_provide python2-debug}

+ %{?python_provide:%python_provide python2-debug%{?_isa}}

  

  %description debug

  python2-debug provides a version of the Python 2 runtime with numerous debugging
@@ -1624,7 +1629,7 @@ 

  

  %files -n python-unversioned-command

  %{_bindir}/python

- %{_mandir}/*/python.1.*

+ %{_mandir}/*/python.1*

  

  %files libs

  %{!?_licensedir:%global license %%doc}

This allows easier compatibility back and forth once (and if)
https://fedoraproject.org/wiki/Changes/Python_means_Python3
happens. This is not the full implementation of the change,
as the python-unversioned package still stays.

Note that on Fedora 31, the provides are no longer with %{_isa},
but we are not breaking stable releases in that regard, as %{_isa}
is still provided on those.

Also, conditionalize the tkinter provides for Fedora < 31 (nothing uses it).

+1, please merge if it builds

I also plan to review the changes in provides for all the Fedora releases.

2 new commits added

  • Use %python_provide macros for backward compatibility provides
  • Update man page glob to allow man pages without compression
4 years ago

Amended:

Use %python_provide macros for backward compatibility provides

This allows easier compatibility back and forth once (and if)
https://fedoraproject.org/wiki/Changes/Python_means_Python3
happens. This is not the full implementation of the change,
as the python-unversioned package still stays.

The provides with %{?_isa} are added for backwards compatibility.
In theory, such provides should be added by %python_provide automatically,
but in practice the noarch python-unversioned-command subpackage prevents
it, see https://bugzilla.redhat.com/show_bug.cgi?id=1705656

Also, conditionalize the tkinter provides for Fedora < 31 (nothing uses it).
$ for pkg in fedora/*rpm; do echo rpmdiff $pkg ${pkg/fedora/pr}; rpmdiff -iT -i5 -iS -iV $pkg ${pkg/fedora/pr} | grep -v '/usr/lib/.build-id' | grep -v 'rpmlib'; echo; echo; done
rpmdiff fedora/python2-debug-2.7.16-2.fc29.x86_64.rpm pr/python2-debug-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-debug < 2.7.16-2.fc29
added       OBSOLETES python-debug(x86-64) < 2.7.16-2.fc29


rpmdiff fedora/python2-devel-2.7.16-2.fc29.x86_64.rpm pr/python2-devel-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-devel < 2.7.16-2.fc29
added       OBSOLETES python-devel(x86-64) < 2.7.16-2.fc29


rpmdiff fedora/python2-libs-2.7.16-2.fc29.x86_64.rpm pr/python2-libs-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-libs < 2.7.16-2.fc29
added       OBSOLETES python-libs(x86-64) < 2.7.16-2.fc29


rpmdiff fedora/python2-test-2.7.16-2.fc29.x86_64.rpm pr/python2-test-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-test < 2.7.16-2.fc29
added       OBSOLETES python-test(x86-64) < 2.7.16-2.fc29


rpmdiff fedora/python2-tkinter-2.7.16-2.fc29.x86_64.rpm pr/python2-tkinter-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-tkinter < 2.7.16-2.fc29
added       OBSOLETES python-tkinter(x86-64) < 2.7.16-2.fc29


rpmdiff fedora/python2-tools-2.7.16-2.fc29.x86_64.rpm pr/python2-tools-2.7.16-2.fc29.x86_64.rpm
added       OBSOLETES python-tools < 2.7.16-2.fc29
added       OBSOLETES python-tools(x86-64) < 2.7.16-2.fc29

Pull-Request has been merged by churchyard

4 years ago