From 54ac4a4a39ab1c9d2bbb1edde63f2e15832c53f4 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Sat, 18 Feb 2023 16:11:10 +0100 Subject: [PATCH 1/2] SSSDConfig: use 'setuptools' instead of 'distutils' The Python standard library distutils module will be removed from Python 3.12+ --- contrib/sssd.spec.in | 2 +- src/config/setup.py.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 6431fc9d79b..21571bd9762 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -144,7 +144,7 @@ BuildRequires: pcre2-devel BuildRequires: pkgconfig BuildRequires: popt-devel BuildRequires: python3-devel -BuildRequires: (python3-setuptools if python3 >= 3.12) +BuildRequires: python3-setuptools BuildRequires: samba-devel # required for idmap_sss.so BuildRequires: samba-winbind diff --git a/src/config/setup.py.in b/src/config/setup.py.in index 27f63c4061c..613b050d538 100644 --- a/src/config/setup.py.in +++ b/src/config/setup.py.in @@ -19,10 +19,10 @@ # """ -Python-level packaging using distutils. +Python-level packaging using setuptools. """ -from distutils.core import setup +from setuptools import setup setup( name='SSSDConfig', From 18a206d6c9f629d54226845a5bdc01792089549c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Wed, 13 Sep 2023 16:10:56 +0200 Subject: [PATCH 2/2] SSSDConfig: set PYTHONPATH to make setuptools work on centos8 --- Makefile.am | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4bac10d86d4..ccb0ad2455c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5475,13 +5475,15 @@ install-exec-hook: installsssddirs if BUILD_PYTHON2_BINDINGS if [ "$(DESTDIR)" = "" ]; then \ cd $(builddir)/src/config; \ - $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config \ - install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ + $(MKDIR_P) "$(python2dir)"; \ + PYTHONPATH="$(PYTHONPATH):$(python2dir)" $(PYTHON2) setup.py build \ + --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ --record=$(abs_builddir)/src/config/.files2; \ else \ cd $(builddir)/src/config; \ - $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config \ - install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ + $(MKDIR_P) "$(python2dir)"; \ + PYTHONPATH="$(PYTHONPATH):$(python2dir)" $(PYTHON2) setup.py build \ + --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ --record=$(abs_builddir)/src/config/.files2 --root=$(DESTDIR); \ fi cd $(DESTDIR)$(py2execdir) && \ @@ -5493,13 +5495,15 @@ endif if BUILD_PYTHON3_BINDINGS if [ "$(DESTDIR)" = "" ]; then \ cd $(builddir)/src/config; \ - $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config \ - install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ + $(MKDIR_P) "$(python3dir)"; \ + PYTHONPATH="$(PYTHONPATH):$(python3dir)" $(PYTHON3) setup.py build \ + --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ --record=$(abs_builddir)/src/config/.files3; \ else \ cd $(builddir)/src/config; \ - $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config \ - install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ + $(MKDIR_P) "$(python3dir)"; \ + PYTHONPATH="$(PYTHONPATH):$(python3dir)" $(PYTHON3) setup.py build \ + --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ --record=$(abs_builddir)/src/config/.files3 --root=$(DESTDIR); \ fi cd $(DESTDIR)$(py3execdir) && \ @@ -5563,10 +5567,16 @@ uninstall-hook: if BUILD_PYTHON2_BINDINGS cd $(DESTDIR)$(py2execdir) && \ rm -f pysss.so pyhbac.so pysss_murmur.so pysss_nss_idmap.so + rm -fr "$(DESTDIR)$(python2dir)/easy-install.pth" + rm -fr "$(DESTDIR)$(python2dir)/__pycache__" + rm -fr "$(DESTDIR)$(python2dir)/site.py" endif if BUILD_PYTHON3_BINDINGS cd $(DESTDIR)$(py3execdir) && \ rm -f pysss.so pyhbac.so pysss_murmur.so pysss_nss_idmap.so + rm -fr "$(DESTDIR)$(python3dir)/easy-install.pth" + rm -fr "$(DESTDIR)$(python3dir)/__pycache__" + rm -fr "$(DESTDIR)$(python3dir)/site.py" endif if BUILD_SAMBA rm $(DESTDIR)/$(winbindplugindir)/sss.so