diff --git a/Makefile.am b/Makefile.am index 4bac10d86d4..2ddc27032c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5475,13 +5475,13 @@ 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) \ + PYTHONPATH="$(python3dir):$(PYTHON2_PREFIX)/$(python2dir)" 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) \ + PYTHONPATH="$(python3dir):$(PYTHON2_PREFIX)/$(python2dir)" 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 +5493,13 @@ 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) \ + PYTHONPATH="$(python3dir):$(PYTHON3_PREFIX)/$(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) \ + PYTHONPATH="$(python3dir):$(PYTHON3_PREFIX)/$(python3dir)" 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 +5563,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