#1 Drop optional build dependency on python2-setuptools
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/python2-cairo no_py2_setuptools  into  rawhide

file modified
+34 -7
@@ -1,20 +1,19 @@ 

  Name: python2-cairo

  Version: 1.18.2

- Release: 8%{?dist}

+ Release: 9%{?dist}

  Summary: Python 2 bindings for the cairo library

  

  License: MPLv1.1 or LGPLv2

  URL: http://cairographics.org/pycairo

  Source0: https://github.com/pygobject/pycairo/releases/download/v%{version}/pycairo-%{version}.tar.gz

  

- # This package has a FESCo exception to use Python 2, for GIMP

- # https://pagure.io/fesco/issue/2238

- 

  BuildRequires: cairo-devel

  BuildRequires: gcc

  BuildRequires: pkgconfig

- BuildRequires: python2-devel

- BuildRequires: python2-setuptools

+ 

+ # This package has a FESCo exception to use Python 2, for GIMP

+ # https://pagure.io/fesco/issue/2238

+ BuildRequires: python2.7

  

  %{?python_provide:%python_provide python2-cairo}

  # Renamed in F27
@@ -47,7 +46,32 @@ 

  %install

  %py2_install

  

- # No python2-pytest, no %%check

+ # %%python2_egg_path was a directory in previous builds, because setuptools were used.

+ # Before the version is bumped and this path changed, we need to preserve the directory to avoid:

+ # https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/

+ %global python2_egg_path %{python2_sitearch}/pycairo-%{version}-py%{python2_version}.egg-info

+ 

+ %if "%{version}" == "1.18.2"

+ mv %{buildroot}%{python2_egg_path} PKG-INFO

+ mkdir %{buildroot}%{python2_egg_path}

+ mv PKG-INFO %{buildroot}%{python2_egg_path}

+ echo cairo > %{buildroot}%{python2_egg_path}/top_level.txt

+ # dependency_links.txt and SOURCES.txt were also present, but they don't seem mandatory

+ %endif

+ 

+ 

+ %check

+ # No python2-pytest, no tests

+ 

+ %if "%{version}" == "1.18.2"

+ # assert the Python 2 egg info is a directory to preserve upgrade path

+ test -d %{buildroot}%{python2_egg_path}

+ %else

+ # assert the Python 2 egg info is *not* a directory to be able to eventually

+ # drop all the egg-info mangling from this spec

+ test -f %{buildroot}%{python2_egg_path}

+ %endif

+ 

  

  %files

  %license COPYING*
@@ -60,6 +84,9 @@ 

  %{_libdir}/pkgconfig/pycairo.pc

  

  %changelog

+ * Wed Jun 23 2021 Miro Hrončok <mhroncok@redhat.com> - 1.18.2-9

+ - Drop optional build dependency on python2-setuptools

+ 

  * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.2-8

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

  

While we are on version 1.18.2 we need an ugly scriptlet to replace an egg-info
directory with a file.

If a new version ever comes out, we can get rid of it.

No need to merge yet, I plan to open a discussion about retiring python2-setuptools on the devel mailing list.

Thanks! Looks sane to me.

Just out of curiosity, why is the ! flatpak condition needed? Did the script somehow fail for flatpak builds?

My idea was that the scriptlet is not needed in the flatpak build because there is no concept of updating this package via RPM there.

Ah I see, thanks! Yes, it shouldn't be needed for flatpak.

An alternative to the ugly scriptlet might be to generate the content of the egg info dir manually from the egg info file and the buildroot content. I'll take a look.

rebased onto 6e6f95a

2 years ago

rebased onto 3269702

2 years ago

That looks much nicer and cleaner. Can you just please add version and release to your changelog entry? Otherwise +1 from me -- just go ahead and merge when you want.

rebased onto 4d0bf73

2 years ago

Good catch. I must have used rpmdev-bumpsec when there was an unclosed %if in the spec file. Added.

just go ahead and merge when you want.

Ack. I'll see if there are more concerns in the devel thread and will eventually merge this once python2-setuptools is retired.

Pull-Request has been merged by churchyard

2 years ago
Metadata