URL: https://github.com/freeipa/freeipa/pull/598
Author: tiran
 Title: #598: Add PYTHON_INSTALL_EXTRA_OPTIONS and --install-layout=deb
Action: opened

PR body:
"""
Debian packages should be installed under dist-packages, not
site-packages. Debian has patched distutils and setuptools to add a new
flag '--install-layout'. For --with-ipaplatform=debian,
PYTHON_INSTALL_EXTRA_OPTIONS is set to '--install-layout=deb'.

https://pagure.io/freeipa/issue/6764

Signed-off-by: Christian Heimes <chei...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/598/head:pr598
git checkout pr598
From 0bf37348882a1cdf5034f24b2918655704a6ba4e Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Wed, 15 Mar 2017 10:46:36 +0100
Subject: [PATCH] Add PYTHON_INSTALL_EXTRA_OPTIONS and --install-layout=deb

Debian packages should be installed under dist-packages, not
site-packages. Debian has patched distutils and setuptools to add a new
flag '--install-layout'. For --with-ipaplatform=debian,
PYTHON_INSTALL_EXTRA_OPTIONS is set to '--install-layout=deb'.

https://pagure.io/freeipa/issue/6764

Signed-off-by: Christian Heimes <chei...@redhat.com>
---
 Makefile.python.am | 3 ++-
 configure.ac       | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile.python.am b/Makefile.python.am
index f158ff5..7d30ff1 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -28,7 +28,8 @@ install-exec-local: $(top_builddir)/ipasetup.py
 		        --prefix "$(DESTDIR)$(prefix)" \
 		        --single-version-externally-managed \
 		        --record "$(DESTDIR)$(pkgpythondir)/install_files.txt" \
-		        --optimize 1; \
+		        --optimize 1 \
+		        $(PYTHON_INSTALL_EXTRA_OPTIONS); \
 	fi
 
 uninstall-local:
diff --git a/configure.ac b/configure.ac
index 4a3ba15..2eaef00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,6 +284,14 @@ fi
 AC_SUBST([IPAPLATFORM])
 AC_MSG_RESULT([${IPAPLATFORM}])
 
+if test "x${IPAPLATFORM}" == "xdebian"; then
+    # see https://www.debian.org/doc/packaging-manuals/python-policy/ap-packaging_tools.html
+    PYTHON_INSTALL_EXTRA_OPTIONS="--install-layout=deb"
+else
+    PYTHON_INSTALL_EXTRA_OPTIONS=""
+fi
+AC_SUBST([PYTHON_INSTALL_EXTRA_OPTIONS])
+AC_MSG_RESULT([python setup.py install extra options ${PYTHON_INSTALL_EXTRA_OPTIONS}])
 
 dnl ---------------------------------------------------------------------------
 dnl Version information from VERSION.m4 and command line
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to