Blame SOURCES/00102-lib64.patch

f068d2
From be6b9803109c3702dbff0ed8b0953913206008ca Mon Sep 17 00:00:00 2001
e336cb
From: David Malcolm <dmalcolm@redhat.com>
e336cb
Date: Wed, 13 Jan 2010 21:25:18 +0000
e336cb
Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/
e336cb
 instead or /usr/lib/
e336cb
MIME-Version: 1.0
e336cb
Content-Type: text/plain; charset=UTF-8
e336cb
Content-Transfer-Encoding: 8bit
e336cb
e336cb
Only used when "%{_lib}" == "lib64".
e336cb
e336cb
Co-authored-by: David Malcolm <dmalcolm@redhat.com>
e336cb
Co-authored-by: Thomas Spura <tomspur@fedoraproject.org>
e336cb
Co-authored-by: Slavek Kabrda <bkabrda@redhat.com>
e336cb
Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
e336cb
Co-authored-by: Tomas Orsava <torsava@redhat.com>
e336cb
Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
e336cb
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
e336cb
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
e336cb
Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
e336cb
---
e336cb
 Lib/distutils/command/install.py    |  4 ++--
e336cb
 Lib/distutils/sysconfig.py          |  6 +++++-
e336cb
 Lib/distutils/tests/test_install.py |  3 ++-
e336cb
 Lib/site.py                         |  4 ++++
e336cb
 Lib/sysconfig.py                    | 12 ++++++------
e336cb
 Lib/test/test_site.py               |  4 ++--
e336cb
 Makefile.pre.in                     |  2 +-
e336cb
 Modules/getpath.c                   |  6 +++---
e336cb
 configure                           |  4 ++--
e336cb
 configure.ac                        |  4 ++--
e336cb
 setup.py                            |  6 +++---
e336cb
 11 files changed, 32 insertions(+), 23 deletions(-)
e336cb
e336cb
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
e336cb
index c625c95bf7..ae4f915669 100644
e336cb
--- a/Lib/distutils/command/install.py
e336cb
+++ b/Lib/distutils/command/install.py
e336cb
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
e336cb
 INSTALL_SCHEMES = {
e336cb
     'unix_prefix': {
e336cb
         'purelib': '$base/lib/python$py_version_short/site-packages',
e336cb
-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
e336cb
+        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
e336cb
         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
e336cb
         'scripts': '$base/bin',
e336cb
         'data'   : '$base',
e336cb
         },
e336cb
     'unix_home': {
e336cb
         'purelib': '$base/lib/python',
e336cb
-        'platlib': '$base/lib/python',
e336cb
+        'platlib': '$base/lib64/python',
e336cb
         'headers': '$base/include/python/$dist_name',
e336cb
         'scripts': '$base/bin',
e336cb
         'data'   : '$base',
e336cb
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
e336cb
index b51629eb94..9a4892a737 100644
e336cb
--- a/Lib/distutils/sysconfig.py
e336cb
+++ b/Lib/distutils/sysconfig.py
e336cb
@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
e336cb
             prefix = plat_specific and EXEC_PREFIX or PREFIX
e336cb
 
e336cb
     if os.name == "posix":
e336cb
+        if plat_specific or standard_lib:
e336cb
+            lib = "lib64"
e336cb
+        else:
e336cb
+            lib = "lib"
e336cb
         libpython = os.path.join(prefix,
e336cb
-                                 "lib", "python" + get_python_version())
e336cb
+                                 lib, "python" + get_python_version())
e336cb
         if standard_lib:
e336cb
             return libpython
e336cb
         else:
e336cb
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
e336cb
index 287ab1989e..d4c05e0ab1 100644
e336cb
--- a/Lib/distutils/tests/test_install.py
e336cb
+++ b/Lib/distutils/tests/test_install.py
e336cb
@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager,
e336cb
             self.assertEqual(got, expected)
e336cb
 
e336cb
         libdir = os.path.join(destination, "lib", "python")
e336cb
+        platlibdir = os.path.join(destination, "lib64", "python")
e336cb
         check_path(cmd.install_lib, libdir)
e336cb
-        check_path(cmd.install_platlib, libdir)
e336cb
+        check_path(cmd.install_platlib, platlibdir)
e336cb
         check_path(cmd.install_purelib, libdir)
e336cb
         check_path(cmd.install_headers,
e336cb
                    os.path.join(destination, "include", "python", "foopkg"))
e336cb
diff --git a/Lib/site.py b/Lib/site.py
e336cb
index a065ab0b5d..22d53fa562 100644
e336cb
--- a/Lib/site.py
e336cb
+++ b/Lib/site.py
e336cb
@@ -335,11 +335,15 @@ def getsitepackages(prefixes=None):
e336cb
         seen.add(prefix)
e336cb
 
e336cb
         if os.sep == '/':
e336cb
+            sitepackages.append(os.path.join(prefix, "lib64",
e336cb
+                                        "python" + sys.version[:3],
e336cb
+                                        "site-packages"))
e336cb
             sitepackages.append(os.path.join(prefix, "lib",
e336cb
                                         "python%d.%d" % sys.version_info[:2],
e336cb
                                         "site-packages"))
e336cb
         else:
e336cb
             sitepackages.append(prefix)
e336cb
+            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
e336cb
             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
e336cb
     return sitepackages
e336cb
 
e336cb
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
e336cb
index b9e2fafbc0..0ae6d35b69 100644
e336cb
--- a/Lib/sysconfig.py
e336cb
+++ b/Lib/sysconfig.py
e336cb
@@ -20,10 +20,10 @@ __all__ = [
e336cb
 
e336cb
 _INSTALL_SCHEMES = {
e336cb
     'posix_prefix': {
e336cb
-        'stdlib': '{installed_base}/lib/python{py_version_short}',
e336cb
-        'platstdlib': '{platbase}/lib/python{py_version_short}',
e336cb
+        'stdlib': '{installed_base}/lib64/python{py_version_short}',
e336cb
+        'platstdlib': '{platbase}/lib64/python{py_version_short}',
e336cb
         'purelib': '{base}/lib/python{py_version_short}/site-packages',
e336cb
-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
e336cb
+        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
e336cb
         'include':
e336cb
             '{installed_base}/include/python{py_version_short}{abiflags}',
e336cb
         'platinclude':
e336cb
@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = {
e336cb
         'data': '{userbase}',
e336cb
         },
e336cb
     'posix_user': {
e336cb
-        'stdlib': '{userbase}/lib/python{py_version_short}',
e336cb
-        'platstdlib': '{userbase}/lib/python{py_version_short}',
e336cb
+        'stdlib': '{userbase}/lib64/python{py_version_short}',
e336cb
+        'platstdlib': '{userbase}/lib64/python{py_version_short}',
e336cb
         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
e336cb
-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
e336cb
+        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
e336cb
         'include': '{userbase}/include/python{py_version_short}',
e336cb
         'scripts': '{userbase}/bin',
e336cb
         'data': '{userbase}',
e336cb
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
f068d2
index 1bbc697936..9a7e80dfa0 100644
e336cb
--- a/Lib/test/test_site.py
e336cb
+++ b/Lib/test/test_site.py
f068d2
@@ -267,8 +267,8 @@ class HelperFunctionsTests(unittest.TestCase):
e336cb
         dirs = site.getsitepackages()
e336cb
         if os.sep == '/':
e336cb
             # OS X, Linux, FreeBSD, etc
e336cb
-            self.assertEqual(len(dirs), 1)
e336cb
-            wanted = os.path.join('xoxo', 'lib',
e336cb
+            self.assertEqual(len(dirs), 2)
e336cb
+            wanted = os.path.join('xoxo', 'lib64',
e336cb
                                   'python%d.%d' % sys.version_info[:2],
e336cb
                                   'site-packages')
e336cb
             self.assertEqual(dirs[0], wanted)
e336cb
diff --git a/Makefile.pre.in b/Makefile.pre.in
f068d2
index a914a9c70f..406a441082 100644
e336cb
--- a/Makefile.pre.in
e336cb
+++ b/Makefile.pre.in
e336cb
@@ -143,7 +143,7 @@ LIBDIR=		@libdir@
e336cb
 MANDIR=		@mandir@
e336cb
 INCLUDEDIR=	@includedir@
e336cb
 CONFINCLUDEDIR=	$(exec_prefix)/include
e336cb
-SCRIPTDIR=	$(prefix)/lib
e336cb
+SCRIPTDIR=	$(prefix)/lib64
e336cb
 ABIFLAGS=	@ABIFLAGS@
e336cb
 
e336cb
 # Detailed destination directories
e336cb
diff --git a/Modules/getpath.c b/Modules/getpath.c
e336cb
index b727f66953..a0c5fb6139 100644
e336cb
--- a/Modules/getpath.c
e336cb
+++ b/Modules/getpath.c
e336cb
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
e336cb
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
e336cb
             return PATHLEN_ERR();
e336cb
         }
e336cb
-        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
e336cb
+        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
e336cb
         if (_PyStatus_EXCEPTION(status)) {
e336cb
             return status;
e336cb
         }
e336cb
@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix,
e336cb
             return PATHLEN_ERR();
e336cb
         }
e336cb
     }
e336cb
-    status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
e336cb
+    status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
e336cb
     if (_PyStatus_EXCEPTION(status)) {
e336cb
         return status;
e336cb
     }
e336cb
@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
e336cb
     if (!calculate->exec_prefix) {
e336cb
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
e336cb
     }
e336cb
-    calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len;;
e336cb
+    calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len;;
e336cb
     if (!calculate->lib_python) {
e336cb
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
e336cb
     }
e336cb
diff --git a/configure b/configure
f068d2
index 8886561645..78867c6ffc 100755
e336cb
--- a/configure
e336cb
+++ b/configure
f068d2
@@ -15214,9 +15214,9 @@ fi
e336cb
 
e336cb
 
e336cb
 if test x$PLATFORM_TRIPLET = x; then
e336cb
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
e336cb
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
e336cb
 else
e336cb
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
e336cb
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
e336cb
 fi
e336cb
 
e336cb
 
e336cb
diff --git a/configure.ac b/configure.ac
f068d2
index d8de9d4943..477a5ff1cb 100644
e336cb
--- a/configure.ac
e336cb
+++ b/configure.ac
f068d2
@@ -4689,9 +4689,9 @@ fi
e336cb
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
e336cb
 AC_SUBST(PY_ENABLE_SHARED)
e336cb
 if test x$PLATFORM_TRIPLET = x; then
e336cb
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
e336cb
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
e336cb
 else
e336cb
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
e336cb
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
e336cb
 fi
e336cb
 AC_SUBST(LIBPL)
e336cb
 
e336cb
diff --git a/setup.py b/setup.py
f068d2
index b168ed4082..8628b9d1cd 100644
e336cb
--- a/setup.py
e336cb
+++ b/setup.py
e336cb
@@ -649,7 +649,7 @@ class PyBuildExt(build_ext):
e336cb
         # directories (i.e. '.' and 'Include') must be first.  See issue
e336cb
         # 10520.
e336cb
         if not CROSS_COMPILING:
e336cb
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
e336cb
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
e336cb
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
e336cb
         # only change this for cross builds for 3.3, issues on Mageia
e336cb
         if CROSS_COMPILING:
e336cb
@@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
e336cb
             elif curses_library:
e336cb
                 readline_libs.append(curses_library)
e336cb
             elif self.compiler.find_library_file(self.lib_dirs +
e336cb
-                                                     ['/usr/lib/termcap'],
e336cb
+                                                     ['/usr/lib64/termcap'],
e336cb
                                                      'termcap'):
e336cb
                 readline_libs.append('termcap')
e336cb
             self.add(Extension('readline', ['readline.c'],
e336cb
-                               library_dirs=['/usr/lib/termcap'],
e336cb
+                               library_dirs=['/usr/lib64/termcap'],
e336cb
                                extra_link_args=readline_extra_link_args,
e336cb
                                libraries=readline_libs))
e336cb
         else:
e336cb
-- 
f068d2
2.26.2
e336cb