Skip to content

Commit 76a09bc

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 2192a0a commit 76a09bc

File tree

10 files changed

+30
-21
lines changed

10 files changed

+30
-21
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
@@ -147,8 +147,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
147147
prefix = plat_specific and EXEC_PREFIX or PREFIX
148148

149149
if os.name == "posix":
150+
if plat_specific or standard_lib:
151+
lib = "lib64"
152+
else:
153+
lib = "lib"
150154
libpython = os.path.join(prefix,
151-
"lib", "python" + get_python_version())
155+
lib, "python" + get_python_version())
152156
if standard_lib:
153157
return libpython
154158
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
@@ -334,11 +334,15 @@ def getsitepackages(prefixes=None):
334334
seen.add(prefix)
335335

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

Lib/sysconfig.py

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

2121
_INSTALL_SCHEMES = {
2222
'posix_prefix': {
23-
'stdlib': '{installed_base}/lib/python{py_version_short}',
24-
'platstdlib': '{platbase}/lib/python{py_version_short}',
23+
'stdlib': '{installed_base}/lib64/python{py_version_short}',
24+
'platstdlib': '{platbase}/lib64/python{py_version_short}',
2525
'purelib': '{base}/lib/python{py_version_short}/site-packages',
26-
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
26+
'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
2727
'include':
2828
'{installed_base}/include/python{py_version_short}{abiflags}',
2929
'platinclude':
@@ -62,10 +62,10 @@
6262
'data': '{userbase}',
6363
},
6464
'posix_user': {
65-
'stdlib': '{userbase}/lib/python{py_version_short}',
66-
'platstdlib': '{userbase}/lib/python{py_version_short}',
65+
'stdlib': '{userbase}/lib64/python{py_version_short}',
66+
'platstdlib': '{userbase}/lib64/python{py_version_short}',
6767
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
68-
'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
68+
'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
6969
'include': '{userbase}/include/python{py_version_short}',
7070
'scripts': '{userbase}/bin',
7171
'data': '{userbase}',

Lib/test/test_site.py

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

Makefile.pre.in

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

150150
# Detailed destination directories

Modules/getpath.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config,
535535
"Could not find platform dependent libraries <exec_prefix>\n");
536536
}
537537
wcsncpy(exec_prefix, calculate->exec_prefix, MAXPATHLEN);
538-
joinpath(exec_prefix, L"lib/lib-dynload");
538+
joinpath(exec_prefix, L"lib64/lib-dynload");
539539
}
540540
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
541541
}
@@ -783,7 +783,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix)
783783
else {
784784
wcsncpy(calculate->zip_path, calculate->prefix, MAXPATHLEN);
785785
}
786-
joinpath(calculate->zip_path, L"lib/python00.zip");
786+
joinpath(calculate->zip_path, L"lib64/python00.zip");
787787

788788
/* Replace "00" with version */
789789
size_t bufsz = wcslen(calculate->zip_path);
@@ -908,7 +908,7 @@ calculate_init(PyCalculatePath *calculate,
908908
if (!calculate->exec_prefix) {
909909
return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
910910
}
911-
calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len);
911+
calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len);
912912
if (!calculate->lib_python) {
913913
return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
914914
}

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4775,9 +4775,9 @@ AC_MSG_RESULT($LDVERSION)
47754775
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
47764776
AC_SUBST(PY_ENABLE_SHARED)
47774777
if test x$PLATFORM_TRIPLET = x; then
4778-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
4778+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
47794779
else
4780-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
4780+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
47814781
fi
47824782
AC_SUBST(LIBPL)
47834783

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def detect_modules(self):
585585
# directories (i.e. '.' and 'Include') must be first. See issue
586586
# 10520.
587587
if not cross_compiling:
588-
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
588+
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
589589
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
590590
# only change this for cross builds for 3.3, issues on Mageia
591591
if cross_compiling:
@@ -891,11 +891,11 @@ def detect_modules(self):
891891
elif curses_library:
892892
readline_libs.append(curses_library)
893893
elif self.compiler.find_library_file(lib_dirs +
894-
['/usr/lib/termcap'],
894+
['/usr/lib64/termcap'],
895895
'termcap'):
896896
readline_libs.append('termcap')
897897
exts.append( Extension('readline', ['readline.c'],
898-
library_dirs=['/usr/lib/termcap'],
898+
library_dirs=['/usr/lib64/termcap'],
899899
extra_link_args=readline_extra_link_args,
900900
libraries=readline_libs) )
901901
else:

0 commit comments

Comments
 (0)