This patch changes all python libs to be "fixed" in either /usr/lib64 or /usr/lib depending on the bitness regardless of their "purity"; thus separating 32-bit python from 64-bit python permanently. This patch must be applied after python-2.7.5-multilib.patch; it does not work alone. James 2014 diff -ur Python-2.7.6-multilib/Lib/distutils/command/install.py Python-2.7.6/Lib/distutils/command/install.py --- Python-2.7.6-multilib/Lib/distutils/command/install.py 2014-03-24 23:59:42.931403290 +0700 +++ Python-2.7.6/Lib/distutils/command/install.py 2014-03-25 00:01:47.028065200 +0700 @@ -43,15 +43,15 @@ INSTALL_SCHEMES = { 'unix_prefix': { - 'purelib': '$base/lib/python$py_version_short/site-packages', + 'purelib': '$base/'+libname+'/python$py_version_short/site-packages', 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'unix_home': { - 'purelib': '$base/lib/python', - 'platlib': '$base/lib/python', + 'purelib': '$base/'+libname+'/python', + 'platlib': '$base/'+libname+'/python', 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', diff -ur Python-2.7.6-multilib/Lib/distutils/sysconfig.py Python-2.7.6/Lib/distutils/sysconfig.py --- Python-2.7.6-multilib/Lib/distutils/sysconfig.py 2014-03-24 23:59:42.931403290 +0700 +++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-03-25 00:03:51.654726531 +0700 @@ -119,10 +119,7 @@ prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": - if plat_specific or standard_lib: - lib = sys.lib - else: - lib = "lib" + lib = sys.lib libpython = os.path.join(prefix, lib, "python" + get_python_version()) if standard_lib: return libpython diff -ur Python-2.7.6-multilib/Lib/site.py Python-2.7.6/Lib/site.py --- Python-2.7.6-multilib/Lib/site.py 2014-03-24 23:59:42.931403290 +0700 +++ Python-2.7.6/Lib/site.py 2014-03-25 00:27:43.958003994 +0700 @@ -303,11 +303,12 @@ "python" + sys.version[:3], "site-packages")) sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) - if sys.lib != "lib": + """if sys.lib != "lib": sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")) sitepackages.append(os.path.join(prefix, "lib", "site-python")) + """ else: sitepackages.append(prefix) sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) diff -ur Python-2.7.6-multilib/Lib/sysconfig.py Python-2.7.6/Lib/sysconfig.py --- Python-2.7.6-multilib/Lib/sysconfig.py 2014-03-24 23:59:42.931403290 +0700 +++ Python-2.7.6/Lib/sysconfig.py 2014-03-25 00:12:50.071372409 +0700 @@ -9,7 +9,7 @@ 'posix_prefix': { 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}', 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', - 'purelib': '{base}/lib/python{py_version_short}/site-packages', + 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages', 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', 'include': '{base}/include/python{py_version_short}', 'platinclude': '{platbase}/include/python{py_version_short}', @@ -17,10 +17,10 @@ 'data': '{base}', }, 'posix_home': { - 'stdlib': '{base}/lib/python', - 'platstdlib': '{base}/lib/python', - 'purelib': '{base}/lib/python', - 'platlib': '{base}/lib/python', + 'stdlib': '{base}/'+sys.lib+'/python', + 'platstdlib': '{base}/'+sys.lib+'/python', + 'purelib': '{base}/'+sys.lib+'/python', + 'platlib': '{base}/'+sys.lib+'/python', 'include': '{base}/include/python', 'platinclude': '{base}/include/python', 'scripts': '{base}/bin', @@ -67,7 +67,7 @@ 'posix_user': { 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', + 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', diff -ur Python-2.7.6-multilib/Modules/getpath.c Python-2.7.6/Modules/getpath.c --- Python-2.7.6-multilib/Modules/getpath.c 2014-03-24 23:59:42.934736697 +0700 +++ Python-2.7.6/Modules/getpath.c 2014-03-25 00:21:45.028018090 +0700 @@ -545,7 +545,7 @@ } else strncpy(zip_path, PREFIX, MAXPATHLEN); - joinpath(zip_path, "lib/python00.zip"); + joinpath(zip_path, LIB "/python00.zip"); bufsz = strlen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; @@ -555,7 +555,7 @@ fprintf(stderr, "Could not find platform dependent libraries \n"); strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN); - joinpath(exec_prefix, "lib/lib-dynload"); + joinpath(exec_prefix, LIB "/lib-dynload"); } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */