]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] Add --with-python-install-dir configure option
authorMichał Kępień <michal@isc.org>
Wed, 23 Aug 2017 09:50:01 +0000 (11:50 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 4 Sep 2017 06:40:23 +0000 (08:40 +0200)
4698. [port] Add --with-python-install-dir configure option to allow
specifying a nonstandard installation directory for
Python modules. [RT #45407]

CHANGES
bin/python/Makefile.in
bin/python/dnssec-checkds.py.in
bin/python/dnssec-coverage.py.in
bin/python/dnssec-keymgr.py.in
configure.in

diff --git a/CHANGES b/CHANGES
index fe3c9c29701c8ee2aa034a7c28e65be84b20b793..de6ff35539171e811cbc00883ba74eaa887da61c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4698.  [port]          Add --with-python-install-dir configure option to allow
+                       specifying a nonstandard installation directory for
+                       Python modules. [RT #45407]
+
 4697.  [bug]           Restore workaround for Microsoft Windows TSIG hash
                        computation bug. [RT #45854]
 
index 18d2135b4c28f6bb2c76a2c93c13b1ccc5ab7c49..cfc7c7fe65f6cb7ef0d43bf480ddfac2d5aac1d7 100644 (file)
@@ -53,9 +53,9 @@ install:: ${TARGETS} installdirs
        ${INSTALL_DATA} ${srcdir}/dnssec-keymgr.8 ${DESTDIR}${mandir}/man8
        if test -n "${PYTHON}" ; then \
                if test -n "${DESTDIR}" ; then \
-                       ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} ; \
+                       ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \
                else \
-                       ${PYTHON} ${srcdir}/setup.py install --prefix=${prefix} ; \
+                       ${PYTHON} ${srcdir}/setup.py install --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \
                fi ; \
                rm -rf build ; \
        fi
index 32e20026f6762fc06e660fdb3818c70aee0f80a1..420e862c43c15cdd8ab278615226ea7003c19cf9 100644 (file)
@@ -12,8 +12,11 @@ import sys
 
 sys.path.insert(0, os.path.dirname(sys.argv[0]))
 if os.name != 'nt':
-    sys.path.insert(1, os.path.join('@prefix@', 'lib',
-                   'python' + sys.version[:3], 'site-packages'))
+    if '@PYTHON_INSTALL_DIR@': # value of --with-python-install-dir
+        sys.path.insert(1, '@PYTHON_INSTALL_DIR@')
+    else:
+        sys.path.insert(1, os.path.join('@prefix@', 'lib',
+                        'python' + sys.version[:3], 'site-packages'))
 
 import isc.checkds
 
index 6b7dfa422d66e6921a6950a66e5666b9e087fca4..ef546b1141a2bcd9c670bb093b8318495a6f7564 100644 (file)
@@ -12,8 +12,11 @@ import sys
 
 sys.path.insert(0, os.path.dirname(sys.argv[0]))
 if os.name != 'nt':
-    sys.path.insert(1, os.path.join('@prefix@', 'lib',
-                   'python' + sys.version[:3], 'site-packages'))
+    if '@PYTHON_INSTALL_DIR@': # value of --with-python-install-dir
+        sys.path.insert(1, '@PYTHON_INSTALL_DIR@')
+    else:
+        sys.path.insert(1, os.path.join('@prefix@', 'lib',
+                        'python' + sys.version[:3], 'site-packages'))
 
 import isc.coverage
 
index 1caa6922b4e0cea08b2a77b4989ecd6c1b98e531..82d1c8a18a43d9746f0b23f7662fbb0ff5ac40a6 100644 (file)
@@ -12,8 +12,11 @@ import sys
 
 sys.path.insert(0, os.path.dirname(sys.argv[0]))
 if os.name != 'nt':
-    sys.path.insert(1, os.path.join('@prefix@', 'lib',
-                   'python' + sys.version[:3], 'site-packages'))
+    if '@PYTHON_INSTALL_DIR@': # value of --with-python-install-dir
+        sys.path.insert(1, '@PYTHON_INSTALL_DIR@')
+    else:
+        sys.path.insert(1, os.path.join('@prefix@', 'lib',
+                        'python' + sys.version[:3], 'site-packages'))
 
 import isc.keymgr
 
index f2fcf7ea7c47a8ffd262433c2b46daae44dde3b1..4d422998cfb8b5546b69329c6a2170d341480c55 100644 (file)
@@ -212,6 +212,10 @@ AC_SUBST(PERL)
 AC_ARG_WITH(python,
 [  --with-python=PATH      specify path to python interpreter],
     use_python="$withval", use_python="unspec")
+AC_ARG_WITH(python-install-dir,
+           AC_HELP_STRING([--with-python-install-dir=PATH],
+                          [installation directory for Python modules]),
+           use_python_install_dir="$withval", use_python_install_dir="unspec")
 
 python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
 
@@ -268,8 +272,19 @@ case "$use_python" in
                                         unset PYTHON
                                fi
                        done
-                       if test "X$PYTHON" = "X"
+                       if test "X$PYTHON" != "X"
                        then
+                               case "$use_python_install_dir" in
+                               unspec)
+                                       PYTHON_INSTALL_DIR=""
+                                       PYTHON_INSTALL_LIB=""
+                                       ;;
+                               *)
+                                       PYTHON_INSTALL_DIR="$use_python_install_dir"
+                                       PYTHON_INSTALL_LIB="--install-lib=$use_python_install_dir"
+                                       ;;
+                               esac
+                       else
                                AC_MSG_CHECKING([for python support])
                                case "$use_python" in
                                unspec)
@@ -327,6 +342,8 @@ AC_SUBST(CHECKDS)
 AC_SUBST(COVERAGE)
 AC_SUBST(KEYMGR)
 AC_SUBST(PYTHON_TOOLS)
+AC_SUBST(PYTHON_INSTALL_DIR)
+AC_SUBST(PYTHON_INSTALL_LIB)
 
 #
 # Special processing of paths depending on whether --prefix,