From a080390cd25e09685906a9dd42f53a65497a0f6f Mon Sep 17 00:00:00 2001
From: Alan Conway <aconway@apache.org>
Date: Tue, 10 Feb 2015 19:44:41 +0000
Subject: [PATCH 07/10] NO-JIRA: Make python/setup.py.in respect DESTDIR on
python 2.6
git-svn-id: https://svn.apache.org/repos/asf/qpid/dispatch/trunk@1658787 13f79535-47bb-0310-9956-ffa450edef68
---
bin/test.sh | 2 ++
python/setup.py.in | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/bin/test.sh b/bin/test.sh
index 7b56dda..44f8465 100755
--- a/bin/test.sh
+++ b/bin/test.sh
@@ -18,6 +18,8 @@
# under the License.
#
+test -z "$SOURCE_DIR" -a -f config.sh && source ./config.sh
+
if [[ -z "$SOURCE_DIR" ]]; then
echo "The devel environment isn't ready. Run 'source config.sh' from"
echo "the base of the dispatch source tree"
diff --git a/python/setup.py.in b/python/setup.py.in
index 22e8fb0..af63f5f 100755
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -22,6 +22,7 @@ from distutils.core import setup
from distutils.command.build_py import build_py
from distutils.file_util import copy_file
from os.path import join
+from os import environ
"""Install public packages and scripts for Qpid Dispatch."""
@@ -38,8 +39,14 @@ class BuildPy(build_py):
def get_outputs(self, **kwargs):
return build_py.get_outputs(self, **kwargs) + [join(self.build_lib, m) for m in self.MODULES]
-# Install public python modules in standard python locations.
+options={}
+destdir = environ.get("DESTDIR")
+if destdir:
+ options["install"] = {"root": destdir}
+
setup(
+ options=options,
+
name='qpid_dispatch',
description='Apache Qpid Dispatch tools and libraries.',
package_dir={'' : '${CMAKE_SOURCE_DIR}/python'},
--
2.1.0