From: David Reiss Date: Wed, 5 Sep 2007 00:47:32 +0000 (+0000) Subject: Thrift: Python installation. X-Git-Tag: 0.2.0~1224 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=d683219966237417297e8f0b24e6c8fce166c490;p=common%2Fthrift.git Thrift: Python installation. Summary: Added the configure script variable PY_PREFIX which serves the same purpose for Python as --prefix does for C/C++. We chose to do this because Python has different conventions for where to install libraries. Reviewed By: mcslee Test Plan: Full clean builds and installs of Thrift from the Thrift root, with and without PY_PREFIX. Watched output of make install. Ran configure from lib/py without PY_PREFIX, with PY_PREFIX and with PY_PREFIX in the environment. Checked config.status for each. Revert Plan: okay git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665248 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/README b/README index 0953f37f..5dc232e7 100644 --- a/README +++ b/README @@ -108,7 +108,9 @@ Run ./configure --help to see other configuration options Please be aware that the Python library will ignore the --prefix option and just install wherever Python's distutils puts it (usually along -the lines of /usr/lib/pythonX.Y/site-packages/). DESTDIR is respected. +the lines of /usr/lib/pythonX.Y/site-packages/). If you need to control +where the Python modules are installed, set the PY_PREFIX variable. +(DESTDIR is respected for Python and C++.) Make thrift: diff --git a/configure.ac b/configure.ac index 9a4aeb5d..2605478c 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,12 @@ AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE +AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. + (Normal --prefix is ignored for Python because + Python has different conventions.) + Default = "/usr"]) +AS_IF([test "x$PY_PREFIX" == x], [PY_PREFIX="/usr"]) + AC_CONFIG_FILES([Makefile]) AC_CONFIG_SUBDIRS([compiler/cpp lib/cpp lib/py if]) diff --git a/lib/py/Makefile.am b/lib/py/Makefile.am index 24c58921..7db5c3b9 100644 --- a/lib/py/Makefile.am +++ b/lib/py/Makefile.am @@ -5,4 +5,4 @@ DESTDIR ?= / # Old version (can't put inline because it's not portable). #$(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) $(PYTHON_SETUPUTIL_ARGS) install-exec-hook: - $(PYTHON) setup.py install --root=$(DESTDIR) $(PYTHON_SETUPUTIL_ARGS) + $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PY_PREFIX) $(PYTHON_SETUPUTIL_ARGS) diff --git a/lib/py/README b/lib/py/README index bdd2ef18..3a5ba920 100644 --- a/lib/py/README +++ b/lib/py/README @@ -1,7 +1,7 @@ Thrift Python Software Library Author: Mark Slee (mcslee@facebook.com) -Last Modified: 2007-Mar-05 +Last Modified: 2007-Sep-04 Thrift is distributed under the Thrift open source software license. Please see the included LICENSE file. @@ -13,7 +13,8 @@ Thrift is provided as a set of Python packages. The top level package is thrift, and there are subpackages for the protocol, transport, and server code. Each package contains modules using standard Thrift naming conventions (i.e. TProtocol, TTransport) and implementations in corresponding modules -(i.e. TSocket). +(i.e. TSocket). There is also a subpackage reflection, which contains +the generated code for the reflection structures. The Python libraries can be installed manually using the provided setup.py file, or automatically using the install hook provided via autoconf/automake. diff --git a/lib/py/configure.ac b/lib/py/configure.ac index 7014fa93..61c6df4b 100644 --- a/lib/py/configure.ac +++ b/lib/py/configure.ac @@ -6,6 +6,12 @@ AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE +AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. + (Normal --prefix is ignored for Python because + Python has different conventions.) + Default = "/usr"]) +AS_IF([test "x$PY_PREFIX" == x], [PY_PREFIX="/usr"]) + AM_PATH_PYTHON(2.4,, :) AC_CONFIG_FILES([Makefile])