Skip to content

Commit 31397a8

Browse files
davidmalcolmtomspurSlavek KabrdasYnfotorsava
committed
00102: Change the various install paths to use /usr/lib64/ instead or /usr/lib/
Only used when "%{_lib}" == "lib64". Co-authored-by: David Malcolm <dmalcolm@redhat.com> Co-authored-by: Thomas Spura <tomspur@fedoraproject.org> Co-authored-by: Slavek Kabrda <bkabrda@redhat.com> Co-authored-by: Matej Stuchlik <mstuchli@redhat.com> Co-authored-by: Tomas Orsava <torsava@redhat.com> Co-authored-by: Charalampos Stratakis <cstratak@redhat.com> Co-authored-by: Petr Viktorin <pviktori@redhat.com> Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
1 parent 4faa17e commit 31397a8

File tree

11 files changed

+32
-23
lines changed

11 files changed

+32
-23
lines changed

Lib/distutils/command/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
INSTALL_SCHEMES = {
3131
'unix_prefix': {
3232
'purelib': '$base/lib/python$py_version_short/site-packages',
33-
'platlib': '$platbase/lib/python$py_version_short/site-packages',
33+
'platlib': '$platbase/lib64/python$py_version_short/site-packages',
3434
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
3535
'scripts': '$base/bin',
3636
'data' : '$base',
3737
},
3838
'unix_home': {
3939
'purelib': '$base/lib/python',
40-
'platlib': '$base/lib/python',
40+
'platlib': '$base/lib64/python',
4141
'headers': '$base/include/python/$dist_name',
4242
'scripts': '$base/bin',
4343
'data' : '$base',

Lib/distutils/sysconfig.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
146146
prefix = plat_specific and EXEC_PREFIX or PREFIX
147147

148148
if os.name == "posix":
149+
if plat_specific or standard_lib:
150+
lib = "lib64"
151+
else:
152+
lib = "lib"
149153
libpython = os.path.join(prefix,
150-
"lib", "python" + get_python_version())
154+
lib, "python" + get_python_version())
151155
if standard_lib:
152156
return libpython
153157
else:

Lib/distutils/tests/test_install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ def check_path(got, expected):
5757
self.assertEqual(got, expected)
5858

5959
libdir = os.path.join(destination, "lib", "python")
60+
platlibdir = os.path.join(destination, "lib64", "python")
6061
check_path(cmd.install_lib, libdir)
61-
check_path(cmd.install_platlib, libdir)
62+
check_path(cmd.install_platlib, platlibdir)
6263
check_path(cmd.install_purelib, libdir)
6364
check_path(cmd.install_headers,
6465
os.path.join(destination, "include", "python", "foopkg"))

Lib/site.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,15 @@ def getsitepackages(prefixes=None):
335335
seen.add(prefix)
336336

337337
if os.sep == '/':
338+
sitepackages.append(os.path.join(prefix, "lib64",
339+
"python" + sys.version[:3],
340+
"site-packages"))
338341
sitepackages.append(os.path.join(prefix, "lib",
339342
"python%d.%d" % sys.version_info[:2],
340343
"site-packages"))
341344
else:
342345
sitepackages.append(prefix)
346+
sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
343347
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
344348
return sitepackages
345349

Lib/sysconfig.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
_INSTALL_SCHEMES = {
2727
'posix_prefix': {
28-
'stdlib': '{installed_base}/lib/python{py_version_short}',
29-
'platstdlib': '{platbase}/lib/python{py_version_short}',
28+
'stdlib': '{installed_base}/lib64/python{py_version_short}',
29+
'platstdlib': '{platbase}/lib64/python{py_version_short}',
3030
'purelib': '{base}/lib/python{py_version_short}/site-packages',
31-
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
31+
'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
3232
'include':
3333
'{installed_base}/include/python{py_version_short}{abiflags}',
3434
'platinclude':
@@ -67,10 +67,10 @@
6767
'data': '{userbase}',
6868
},
6969
'posix_user': {
70-
'stdlib': '{userbase}/lib/python{py_version_short}',
71-
'platstdlib': '{userbase}/lib/python{py_version_short}',
70+
'stdlib': '{userbase}/lib64/python{py_version_short}',
71+
'platstdlib': '{userbase}/lib64/python{py_version_short}',
7272
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
73-
'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
73+
'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
7474
'include': '{userbase}/include/python{py_version_short}',
7575
'scripts': '{userbase}/bin',
7676
'data': '{userbase}',

Lib/test/test_site.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ def test_getsitepackages(self):
268268
dirs = site.getsitepackages()
269269
if os.sep == '/':
270270
# OS X, Linux, FreeBSD, etc
271-
self.assertEqual(len(dirs), 1)
272-
wanted = os.path.join('xoxo', 'lib',
271+
self.assertEqual(len(dirs), 2)
272+
wanted = os.path.join('xoxo', 'lib64',
273273
'python%d.%d' % sys.version_info[:2],
274274
'site-packages')
275275
self.assertEqual(dirs[0], wanted)

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ LIBDIR= @libdir@
143143
MANDIR= @mandir@
144144
INCLUDEDIR= @includedir@
145145
CONFINCLUDEDIR= $(exec_prefix)/include
146-
SCRIPTDIR= $(prefix)/lib
146+
SCRIPTDIR= $(prefix)/lib64
147147
ABIFLAGS= @ABIFLAGS@
148148

149149
# Detailed destination directories

Modules/getpath.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
730730
if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
731731
return PATHLEN_ERR();
732732
}
733-
status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
733+
status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
734734
if (_PyStatus_EXCEPTION(status)) {
735735
return status;
736736
}
@@ -1063,7 +1063,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix,
10631063
return PATHLEN_ERR();
10641064
}
10651065
}
1066-
status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
1066+
status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
10671067
if (_PyStatus_EXCEPTION(status)) {
10681068
return status;
10691069
}
@@ -1193,7 +1193,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
11931193
if (!calculate->exec_prefix) {
11941194
return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
11951195
}
1196-
calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len);
1196+
calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len);
11971197
if (!calculate->lib_python) {
11981198
return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
11991199
}

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15262,9 +15262,9 @@ fi
1526215262

1526315263

1526415264
if test x$PLATFORM_TRIPLET = x; then
15265-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
15265+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
1526615266
else
15267-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
15267+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
1526815268
fi
1526915269

1527015270

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4720,9 +4720,9 @@ fi
47204720
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
47214721
AC_SUBST(PY_ENABLE_SHARED)
47224722
if test x$PLATFORM_TRIPLET = x; then
4723-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
4723+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
47244724
else
4725-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
4725+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
47264726
fi
47274727
AC_SUBST(LIBPL)
47284728

0 commit comments

Comments
 (0)