speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH (speechd) 1/2] Fix DESTDIR and prefix when installing Python file


From: Christopher Brannon
Subject: [PATCH (speechd) 1/2] Fix DESTDIR and prefix when installing Python files.
Date: Sat, 27 Feb 2010 11:29:15 -0600

I added DESTDIR to src/python/Makefile.in some time ago, but I did
it wrong, because I didn't understand distutils well.
In order to install to DESTDIR with distutils, one says
python setup.py --root="${DESTDIR}" --prefix="${prefix}",
rather than
python setup.py --prefix="${DESTDIR}${prefix}"

This patch also removes remaining uses of DESTDIR while constructing
paths.py.  Installed files should never contain a reference to $DESTDIR,
since it is only a staging area.
---
 src/python/Makefile.in |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/python/Makefile.in b/src/python/Makefile.in
index d66f006..b7357cf 100644
--- a/src/python/Makefile.in
+++ b/src/python/Makefile.in
@@ -10,13 +10,17 @@ SPD_CONF_PATH_PY="speechd_config/spd_conf_path.py"
 all:
        echo "SPD_CONF_ORIG_PATH=\"@address@hidden"" > speechd_config/paths.py
        echo "SPD_CONF_PATH=\"@address@hidden"" >> speechd_config/paths.py
-       echo "SPD_SOUND_DATA_PATH=\"address@hidden@\"" >> 
speechd_config/paths.py
-       echo "SPD_DESKTOP_CONF_PATH=\"address@hidden@\"" >> 
speechd_config/paths.py
+       echo "SPD_SOUND_DATA_PATH=\"@address@hidden"" >> speechd_config/paths.py
+       echo "SPD_DESKTOP_CONF_PATH=\"@address@hidden"" >> 
speechd_config/paths.py
        @ENABLE_SESSION_TRUE at echo 
"SPD_SPAWN_CMD=\"@prefix@/bin/speechd-server-spawn\"" > speechd/spawn.py
 
 install:
        if test -x /usr/bin/python; then \
-               ./setup.py install --prefix=${DESTDIR}${prefix}; \
+               if test -n "${DESTDIR}"; then \
+                       ./setup.py install --root="${DESTDIR}" 
--prefix="${prefix}"; \
+               else \
+                       ./setup.py install --prefix="${prefix}"; \
+               fi; \
        else \
                echo "Python not found, not installing speechd module nor 
spd-conf"; \
        fi
-- 
1.7.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]