From 1c5e0d2aa7951dccac415d2e5a5aca320e269887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 25 Apr 2023 14:01:38 +0200 Subject: [PATCH] Don't install a Python .egg Due to an upcoming deprecation of .eggs in pip, we'd like to avoid all Python .eggs in Fedora. setuptools forces installation of an .egg when --prefix is set without --root. To assert this works, we list the .egg-info directory explicitly in %files. --- libgpiod.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libgpiod.spec b/libgpiod.spec index ecf60d2..6bdc9e8 100644 --- a/libgpiod.spec +++ b/libgpiod.spec @@ -2,7 +2,7 @@ Name: libgpiod Version: 2.0.1 -Release: 1%{?candidate:.%{candidate}}%{?dist} +Release: 2%{?candidate:.%{candidate}}%{?dist} Summary: C library and tools for interacting with linux GPIO char device License: LGPLv2+ @@ -62,6 +62,10 @@ Files for development with %{name}. %prep %autosetup -p1 +# to prevent setuptools from installing an .egg, we need to pass --root to setup.py install +# see https://github.com/pypa/setuptools/issues/3143 +# and https://github.com/pypa/pip/issues/11501 +sed -i 's/--prefix=$(DESTDIR)$(prefix)/--root=$(DESTDIR) --prefix=$(prefix)/' bindings/python/Makefile* %build autoreconf -vif @@ -92,7 +96,8 @@ find %{buildroot} -name '*.la' -delete %{_libdir}/libgpiodcxx.so.* %files -n python3-%{name} -%{python3_sitearch}/gpiod-*/ +%{python3_sitearch}/gpiod/ +%{python3_sitearch}/gpiod-*.egg-info/ %files devel %{_includedir}/gpiod.* @@ -101,6 +106,9 @@ find %{buildroot} -name '*.la' -delete %{_libdir}/%{name}*.so %changelog +* Tue Apr 25 2023 Miro HronĨok - 2.0.1-2 +- Don't install a Python .egg + * Tue Apr 11 2023 Peter Robinson - 2.0.1-1 - Update to 2.0.1