churchyard / rpms / python2

Forked from rpms/python2 6 years ago
Clone
31c5334
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
31c5334
index b9f1c6c..7b23714 100644
31c5334
--- a/Lib/distutils/command/install.py
31c5334
+++ b/Lib/distutils/command/install.py
a7ef9c1
@@ -42,14 +42,14 @@ else:
60b7a5f
 INSTALL_SCHEMES = {
60b7a5f
     'unix_prefix': {
60b7a5f
         'purelib': '$base/lib/python$py_version_short/site-packages',
60b7a5f
-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
60b7a5f
+        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
60b7a5f
         'headers': '$base/include/python$py_version_short/$dist_name',
60b7a5f
         'scripts': '$base/bin',
60b7a5f
         'data'   : '$base',
60b7a5f
         },
60b7a5f
     'unix_home': {
60b7a5f
         'purelib': '$base/lib/python',
60b7a5f
-        'platlib': '$base/lib/python',
60b7a5f
+        'platlib': '$base/lib64/python',
60b7a5f
         'headers': '$base/include/python/$dist_name',
60b7a5f
         'scripts': '$base/bin',
60b7a5f
         'data'   : '$base',
31c5334
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
31c5334
index 068d1ba..3e7f077 100644
31c5334
--- a/Lib/distutils/sysconfig.py
31c5334
+++ b/Lib/distutils/sysconfig.py
31c5334
@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
60b7a5f
         prefix = plat_specific and EXEC_PREFIX or PREFIX
60b7a5f
 
60b7a5f
     if os.name == "posix":
60b7a5f
+        if plat_specific or standard_lib:
60b7a5f
+            lib = "lib64"
60b7a5f
+        else:
60b7a5f
+            lib = "lib"
60b7a5f
         libpython = os.path.join(prefix,
60b7a5f
-                                 "lib", "python" + get_python_version())
60b7a5f
+                                 lib, "python" + get_python_version())
60b7a5f
         if standard_lib:
60b7a5f
             return libpython
60b7a5f
         else:
31c5334
diff --git a/Lib/site.py b/Lib/site.py
2027616
index c360802..868b7cb 100644
31c5334
--- a/Lib/site.py
31c5334
+++ b/Lib/site.py
7455bcf
@@ -288,12 +288,16 @@ def getsitepackages():
a7ef9c1
         if sys.platform in ('os2emx', 'riscos'):
c6247fd
             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
a7ef9c1
         elif os.sep == '/':
c6247fd
+            sitepackages.append(os.path.join(prefix, "lib64",
a7ef9c1
+                                        "python" + sys.version[:3],
a7ef9c1
+                                        "site-packages"))
c6247fd
             sitepackages.append(os.path.join(prefix, "lib",
a7ef9c1
                                         "python" + sys.version[:3],
a7ef9c1
                                         "site-packages"))
c6247fd
             sitepackages.append(os.path.join(prefix, "lib", "site-python"))
a7ef9c1
         else:
c6247fd
             sitepackages.append(prefix)
c6247fd
+            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
c6247fd
             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
2027616
     return sitepackages
2027616
 
31c5334
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
2027616
index d9a9324..e411e5c 100644
31c5334
--- a/Lib/test/test_site.py
31c5334
+++ b/Lib/test/test_site.py
2027616
@@ -235,17 +235,20 @@ class HelperFunctionsTests(unittest.TestCase):
2027616
             self.assertEqual(dirs[0], wanted)
5810c5d
         elif os.sep == '/':
2027616
             # OS X, Linux, FreeBSD, etc
4b97eeb
-            self.assertEqual(len(dirs), 2)
b0a6ae1
-            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
b0a6ae1
+            self.assertEqual(len(dirs), 3)
5810c5d
+            wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3],
4b97eeb
                                   'site-packages')
b0a6ae1
             self.assertEqual(dirs[0], wanted)
b0a6ae1
-            wanted = os.path.join('xoxo', 'lib', 'site-python')
b0a6ae1
+            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
31c5334
+                                   'site-packages')
b0a6ae1
             self.assertEqual(dirs[1], wanted)
b0a6ae1
+            wanted = os.path.join('xoxo', 'lib', 'site-python')
b0a6ae1
+            self.assertEqual(dirs[2], wanted)
5810c5d
         else:
b0a6ae1
             # other platforms
b0a6ae1
             self.assertEqual(len(dirs), 2)
b0a6ae1
             self.assertEqual(dirs[0], 'xoxo')
5810c5d
-            wanted = os.path.join('xoxo', 'lib', 'site-packages')
5810c5d
+            wanted = os.path.join('xoxo', 'lib64', 'site-packages')
b0a6ae1
             self.assertEqual(dirs[1], wanted)
5810c5d
 
b0a6ae1
 class PthFile(object):
31c5334
diff --git a/Makefile.pre.in b/Makefile.pre.in
2027616
index adae76b..ecb27f3 100644
31c5334
--- a/Makefile.pre.in
31c5334
+++ b/Makefile.pre.in
31c5334
@@ -111,7 +111,7 @@ LIBDIR=		@libdir@
60b7a5f
 MANDIR=		@mandir@
60b7a5f
 INCLUDEDIR=	@includedir@
60b7a5f
 CONFINCLUDEDIR=	$(exec_prefix)/include
60b7a5f
-SCRIPTDIR=	$(prefix)/lib
60b7a5f
+SCRIPTDIR=	$(prefix)/lib64
60b7a5f
 
60b7a5f
 # Detailed destination directories
60b7a5f
 BINLIBDEST=	$(LIBDIR)/python$(VERSION)
31c5334
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
2027616
index fbfa1c1..138fb33 100644
31c5334
--- a/Modules/Setup.dist
31c5334
+++ b/Modules/Setup.dist
3056bfd
@@ -231,7 +231,7 @@
3056bfd
 # Some more UNIX dependent modules -- off by default, since these
3056bfd
 # are not supported by all UNIX systems:
3056bfd
 
3056bfd
-nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
3056bfd
+nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib64/nsl
3056bfd
 termios termios.c	# Steen Lumholt's termios module
3056bfd
 resource resource.c	# Jeremy Hylton's rlimit interface
3056bfd
 
7455bcf
@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
7455bcf
 # Edit the variables DB and DBLIBVERto point to the db top directory
7455bcf
 # and the subdirectory of PORT where you built it.
7455bcf
 DBINC=/usr/include/libdb
7455bcf
-DBLIB=/usr/lib
7455bcf
+DBLIB=/usr/lib64
7455bcf
 _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
7455bcf
 
7455bcf
 # Historical Berkeley DB 1.85
7455bcf
@@ -462,7 +462,7 @@ cPickle cPickle.c
7455bcf
 # Andrew Kuchling's zlib module.
7455bcf
 # This require zlib 1.1.3 (or later).
7455bcf
 # See http://www.gzip.org/zlib/
7455bcf
-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
7455bcf
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
7455bcf
 
7455bcf
 # Interface to the Expat XML parser
7455bcf
 #
31c5334
diff --git a/Modules/getpath.c b/Modules/getpath.c
2027616
index fd33a01..c5c86fd 100644
31c5334
--- a/Modules/getpath.c
31c5334
+++ b/Modules/getpath.c
31c5334
@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
60b7a5f
 static char exec_prefix[MAXPATHLEN+1];
60b7a5f
 static char progpath[MAXPATHLEN+1];
60b7a5f
 static char *module_search_path = NULL;
60b7a5f
-static char lib_python[] = "lib/python" VERSION;
60b7a5f
+static char lib_python[] = "lib64/python" VERSION;
60b7a5f
 
60b7a5f
 static void
60b7a5f
 reduce(char *dir)
2027616
@@ -548,7 +548,7 @@ calculate_path(void)
60b7a5f
             fprintf(stderr,
60b7a5f
                 "Could not find platform dependent libraries <exec_prefix>\n");
60b7a5f
         strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
60b7a5f
-        joinpath(exec_prefix, "lib/lib-dynload");
60b7a5f
+        joinpath(exec_prefix, "lib64/lib-dynload");
60b7a5f
     }
60b7a5f
     /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */
60b7a5f
 
31c5334
diff --git a/setup.py b/setup.py
2027616
index 99ac359..859b6c4 100644
31c5334
--- a/setup.py
31c5334
+++ b/setup.py
31c5334
@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
a7ef9c1
     def detect_modules(self):
a7ef9c1
         # Ensure that /usr/local is always used
7455bcf
         if not cross_compiling:
7455bcf
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
7455bcf
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
7455bcf
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
7455bcf
         if cross_compiling:
7455bcf
             self.add_gcc_paths()
31c5334
@@ -782,11 +782,11 @@ class PyBuildExt(build_ext):
c6247fd
             elif curses_library:
c6247fd
                 readline_libs.append(curses_library)
a7ef9c1
             elif self.compiler.find_library_file(lib_dirs +
c6247fd
-                                                     ['/usr/lib/termcap'],
c6247fd
+                                                     ['/usr/lib64/termcap'],
c6247fd
                                                      'termcap'):
a7ef9c1
                 readline_libs.append('termcap')
a7ef9c1
             exts.append( Extension('readline', ['readline.c'],
a7ef9c1
-                                   library_dirs=['/usr/lib/termcap'],
a7ef9c1
+                                   library_dirs=['/usr/lib64/termcap'],
a7ef9c1
                                    extra_link_args=readline_extra_link_args,
a7ef9c1
                                    libraries=readline_libs) )
a7ef9c1
         else:
31c5334
@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
a7ef9c1
             if krb5_h:
a7ef9c1
                 ssl_incs += krb5_h
a7ef9c1
         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
a7ef9c1
-                                     ['/usr/local/ssl/lib',
a7ef9c1
-                                      '/usr/contrib/ssl/lib/'
a7ef9c1
+                                     ['/usr/local/ssl/lib64',
a7ef9c1
+                                      '/usr/contrib/ssl/lib64/'
a7ef9c1
                                      ] )
a7ef9c1
 
a7ef9c1
         if (ssl_incs is not None and