All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tree-wide: install python libraries on Debian with appropriate option
@ 2020-04-07 11:45 Christian Göttsche
  2020-04-07 13:38 ` Ondrej Mosnacek
  2020-05-01 13:46 ` [PATCH v2] tree-wide: introduce PYTON_SETUP_ARGS to customize setup.py calls on Debian Christian Göttsche
  0 siblings, 2 replies; 8+ messages in thread
From: Christian Göttsche @ 2020-04-07 11:45 UTC (permalink / raw)
  To: selinux

On Debian the `distutils` module is patched, so `get_python_lib()` returns by default `/usr/lib/python3/dist-packages` (no minor version).

But `setuptools` affecting setup.py is not patched to create the library directory at `/usr/lib/python3/dist-packages` by default, rather than a command line argument `--install-layout deb` is added.

Add this option to `python setup.py install` invocation on Debian.

See https://www.debian.org/doc/packaging-manuals/python-policy/packaging_tools.html section B.1.

Fixes: https://github.com/SELinuxProject/selinux/issues/187

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/Makefile  | 2 +-
 python/sepolicy/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 2d1c654e..3efbe3aa 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -173,7 +173,7 @@ install: all
 	ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
 
 install-pywrap: pywrap
-	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
+	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` `grep -qxF ID=debian /etc/os-release && echo --install-layout deb`
 	install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
 	ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
 
diff --git a/python/sepolicy/Makefile b/python/sepolicy/Makefile
index 69f29fa9..54cd27ca 100644
--- a/python/sepolicy/Makefile
+++ b/python/sepolicy/Makefile
@@ -27,7 +27,7 @@ test:
 	@$(PYTHON) test_sepolicy.py -v
 
 install:
-	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
+	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` `grep -qxF ID=debian /etc/os-release && echo --install-layout deb`
 	[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
 	install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy
 	(cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen)
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-06 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 11:45 [PATCH] tree-wide: install python libraries on Debian with appropriate option Christian Göttsche
2020-04-07 13:38 ` Ondrej Mosnacek
2020-05-01 13:46 ` [PATCH v2] tree-wide: introduce PYTON_SETUP_ARGS to customize setup.py calls on Debian Christian Göttsche
2020-05-04 13:03   ` Petr Lautrbach
2020-05-04 14:12     ` Ondrej Mosnacek
2020-05-04 17:55   ` [PATCH v3] tree-wide: introduce PYTHON_SETUP_ARGS " Christian Göttsche
2020-05-05  8:41     ` Petr Lautrbach
2020-05-06 14:20       ` Petr Lautrbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.