[packages/python] Use /usr/local for distutils default inst. prefix

jajcus jajcus at pld-linux.org
Wed Nov 25 18:56:16 CET 2015


commit 0fc165cadcaa9781f055d6f844429d31d0ce5fc1
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Wed Nov 25 18:55:26 2015 +0100

    Use /usr/local for distutils default inst. prefix
    
    Release: 4

 python-install_prefix.patch | 84 +++++++++++++++++++++++++++++++++++++++++++++
 python.spec                 |  4 ++-
 2 files changed, 87 insertions(+), 1 deletion(-)
---
diff --git a/python.spec b/python.spec
index 4d2f2b9..df73936 100644
--- a/python.spec
+++ b/python.spec
@@ -43,7 +43,7 @@ Summary(tr.UTF-8):	X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
 Summary(uk.UTF-8):	Мова програмування дуже високого рівня з X-інтерфейсом
 Name:		python
 Version:	%{py_ver}.10
-Release:	3
+Release:	4
 Epoch:		1
 License:	PSF
 Group:		Development/Languages/Python
@@ -59,6 +59,7 @@ Patch4:		%{name}-noarch_to_datadir.patch
 Patch5:		%{name}-verbose.patch
 Patch6:		%{name}-distro.patch
 Patch7:		%{name}-DNStests.patch
+Patch8:		%{name}-install_prefix.patch
 URL:		http://www.python.org/
 BuildRequires:	autoconf >= 2.65
 BuildRequires:	automake
@@ -580,6 +581,7 @@ napisanego w Pythonie.
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 tar xjf %{SOURCE1}
 
diff --git a/python-install_prefix.patch b/python-install_prefix.patch
new file mode 100644
index 0000000..6657f10
--- /dev/null
+++ b/python-install_prefix.patch
@@ -0,0 +1,84 @@
+diff -dur -x '*~' -x '*.orig' Python-2.7.6.orig/Lib/distutils/command/install.py Python-2.7.6/Lib/distutils/command/install.py
+--- Python-2.7.6.orig/Lib/distutils/command/install.py	2015-11-22 14:29:00.153420762 +0100
++++ Python-2.7.6/Lib/distutils/command/install.py	2015-11-22 14:28:19.000000000 +0100
+@@ -13,6 +13,8 @@
+ from distutils.core import Command
+ from distutils.debug import DEBUG
+ from distutils.sysconfig import get_config_vars
++from distutils.sysconfig import PREFIX, EXEC_PREFIX
++from distutils.sysconfig import SYS_PREFIX, SYS_EXEC_PREFIX
+ from distutils.errors import DistutilsPlatformError
+ from distutils.file_util import write_file
+ from distutils.util import convert_path, subst_vars, change_root
+@@ -306,9 +308,9 @@
+                             'py_version': py_version,
+                             'py_version_short': py_version[0:3],
+                             'py_version_nodot': py_version[0] + py_version[2],
+-                            'sys_prefix': prefix,
++                            'sys_prefix': SYS_PREFIX,
+                             'prefix': prefix,
+-                            'sys_exec_prefix': exec_prefix,
++                            'sys_exec_prefix': SYS_EXEC_PREFIX,
+                             'exec_prefix': exec_prefix,
+                             'userbase': self.install_userbase,
+                             'usersite': self.install_usersite,
+@@ -428,8 +430,8 @@
+                     raise DistutilsOptionError, \
+                           "must not supply exec-prefix without prefix"
+ 
+-                self.prefix = os.path.normpath(sys.prefix)
+-                self.exec_prefix = os.path.normpath(sys.exec_prefix)
++                self.prefix = PREFIX
++                self.exec_prefix = EXEC_PREFIX
+ 
+             else:
+                 if self.exec_prefix is None:
+diff -dur -x '*~' -x '*.orig' Python-2.7.6.orig/Lib/distutils/sysconfig.py Python-2.7.6/Lib/distutils/sysconfig.py
+--- Python-2.7.6.orig/Lib/distutils/sysconfig.py	2015-11-22 14:29:00.153420762 +0100
++++ Python-2.7.6/Lib/distutils/sysconfig.py	2015-11-22 13:49:06.000000000 +0100
+@@ -19,8 +19,10 @@
+ from distutils.errors import DistutilsPlatformError
+ 
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++SYS_PREFIX = os.path.normpath(sys.prefix)
++SYS_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++PREFIX = "/usr/local"
++EXEC_PREFIX = "/usr/local"
+ 
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+@@ -75,7 +77,7 @@
+     sys.exec_prefix -- i.e., ignore 'plat_specific'.
+     """
+     if prefix is None:
+-        prefix = plat_specific and EXEC_PREFIX or PREFIX
++        prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX
+ 
+     if os.name == "posix":
+         if python_build:
+@@ -116,7 +118,10 @@
+     sys.exec_prefix -- i.e., ignore 'plat_specific'.
+     """
+     if prefix is None:
+-        prefix = plat_specific and EXEC_PREFIX or PREFIX
++        if standard_lib:
++            prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX
++        else:
++            prefix = plat_specific and EXEC_PREFIX or PREFIX
+ 
+     if os.name == "posix":
+         if plat_specific: 
+diff -dur -x '*~' -x '*.orig' Python-2.7.6.orig/Lib/site.py Python-2.7.6/Lib/site.py
+--- Python-2.7.6.orig/Lib/site.py	2015-11-22 14:29:00.153420762 +0100
++++ Python-2.7.6/Lib/site.py	2015-11-22 13:40:03.000000000 +0100
+@@ -64,7 +64,7 @@
+ import traceback
+ 
+ # Prefixes for site-packages; add additional prefixes like /usr/local here
+-PREFIXES = [sys.prefix, sys.exec_prefix]
++PREFIXES = ["/usr/local", sys.prefix, sys.exec_prefix]
+ # Enable per user site-packages directory
+ # set it to False to disable the feature or True to force the feature
+ ENABLE_USER_SITE = None
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python.git/commitdiff/0fc165cadcaa9781f055d6f844429d31d0ce5fc1



More information about the pld-cvs-commit mailing list