Blame SOURCES/00102-lib64.patch

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