1 diff -Nur Python-2.5b2.orig/configure.in Python-2.5b2/configure.in
2 --- Python-2.5b2.orig/configure.in 2006-07-06 11:13:35.000000000 +0100
3 +++ Python-2.5b2/configure.in 2006-07-12 17:42:51.000000000 +0100
18 +case $ac_sys_system in
20 + # Test if the compiler is 64bit
21 + echo 'int i;' > conftest.$ac_ext
22 + python_cv_cc_64bit_output=no
23 + if AC_TRY_EVAL(ac_compile); then
24 + case `/usr/bin/file conftest.$ac_objext` in
26 + python_cv_cc_64bit_output=yes
34 +case $ARCH:$python_cv_cc_64bit_output in
35 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
45 AC_MSG_CHECKING(LIBRARY)
46 diff -Nur Python-2.5b2.orig/Include/pythonrun.h Python-2.5b2/Include/pythonrun.h
47 --- Python-2.5b2.orig/Include/pythonrun.h 2006-04-03 07:26:32.000000000 +0100
48 +++ Python-2.5b2/Include/pythonrun.h 2006-07-12 17:42:51.000000000 +0100
50 /* In their own files */
51 PyAPI_FUNC(const char *) Py_GetVersion(void);
52 PyAPI_FUNC(const char *) Py_GetPlatform(void);
53 +PyAPI_FUNC(const char *) Py_GetArch(void);
54 +PyAPI_FUNC(const char *) Py_GetLib(void);
55 PyAPI_FUNC(const char *) Py_GetCopyright(void);
56 PyAPI_FUNC(const char *) Py_GetCompiler(void);
57 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
58 --- Python-3.2/Lib/distutils/command/install.py.orig 2010-11-25 04:46:44.000000000 +0100
59 +++ Python-3.2/Lib/distutils/command/install.py 2011-04-02 08:13:23.765733920 +0200
61 from site import USER_SITE
66 if sys.version < "2.2":
72 'purelib': '$base/lib/python$py_version_short/site-packages',
73 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
74 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
75 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
76 'scripts': '$base/bin',
80 'purelib': '$base/lib/python',
81 - 'platlib': '$base/lib/python',
82 + 'platlib': '$base/'+libname+'/python',
83 'headers': '$base/include/python/$dist_name',
84 'scripts': '$base/bin',
86 diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py
87 --- Python-2.5b2.orig/Lib/distutils/sysconfig.py 2006-06-27 11:08:25.000000000 +0100
88 +++ Python-2.5b2/Lib/distutils/sysconfig.py 2006-07-12 17:42:51.000000000 +0100
90 prefix = plat_specific and EXEC_PREFIX or PREFIX
92 if os.name == "posix":
97 libpython = os.path.join(prefix,
98 - "lib", "python" + get_python_version())
99 + lib, "python" + get_python_version())
103 diff -Nur Python-2.5b2.orig/Lib/distutils/tests/test_install.py Python-2.5b2/Lib/distutils/tests/test_install.py
104 --- Python-2.5b2.orig/Lib/distutils/tests/test_install.py 2004-06-26 00:02:59.000000000 +0100
105 +++ Python-2.5b2/Lib/distutils/tests/test_install.py 2006-07-12 17:42:51.000000000 +0100
107 self.assertEqual(got, expected)
109 libdir = os.path.join(destination, "lib", "python")
110 + platlibdir = os.path.join(destination, sys.lib, "python")
111 check_path(cmd.install_lib, libdir)
112 - check_path(cmd.install_platlib, libdir)
113 + check_path(cmd.install_platlib, platlibdir)
114 check_path(cmd.install_purelib, libdir)
115 check_path(cmd.install_headers,
116 os.path.join(destination, "include", "python", "foopkg"))
117 --- Python-3.2/Lib/site.py.orig 2010-12-26 20:54:29.000000000 +0100
118 +++ Python-3.2/Lib/site.py 2011-04-02 08:16:21.341737273 +0200
119 @@ -285,13 +285,16 @@
120 if sys.platform in ('os2emx', 'riscos'):
121 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
123 - sitepackages.append(os.path.join(prefix, "lib",
124 + sitepackages.append(os.path.join(prefix, sys.lib,
125 "python" + sys.version[:3],
127 - sitepackages.append(os.path.join(prefix, "lib", "site-python"))
128 + sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
129 + if sys.lib != 'lib':
130 + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
131 + sitepackages.append(os.path.join(prefix, "lib", "site-python"))
133 sitepackages.append(prefix)
134 - sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
135 + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
136 if sys.platform == "darwin":
137 # for framework builds *only* we add the standard Apple
139 --- Python-3.2/Makefile.pre.in.orig 2011-02-19 09:47:14.000000000 +0100
140 +++ Python-3.2/Makefile.pre.in 2011-04-02 08:17:59.357737273 +0200
143 # Machine-dependent subdirectories
148 # Install prefix for architecture-independent files
152 INCLUDEDIR= @includedir@
153 CONFINCLUDEDIR= $(exec_prefix)/include
154 -SCRIPTDIR= $(prefix)/lib
155 +SCRIPTDIR= $(prefix)/$(LIB)
158 # Detailed destination directories
160 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
162 Python/getplatform.o: $(srcdir)/Python/getplatform.c
163 - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
164 + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
166 Python/importdl.o: $(srcdir)/Python/importdl.c
167 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
168 --- Python-3.2/Modules/getpath.c.orig 2010-12-03 21:14:31.000000000 +0100
169 +++ Python-3.2/Modules/getpath.c 2011-04-02 08:18:39.573738111 +0200
171 #define EXEC_PREFIX PREFIX
175 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
176 +#define LIB_PYTHON L"lib64/python"
178 +#define LIB_PYTHON L"lib/python"
183 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
184 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
185 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
186 + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
191 static wchar_t exec_prefix[MAXPATHLEN+1];
192 static wchar_t progpath[MAXPATHLEN+1];
193 static wchar_t *module_search_path = NULL;
194 -static wchar_t *lib_python = L"lib/python" VERSION;
195 +static wchar_t *lib_python = LIB_PYTHON VERSION;
199 diff -Nur Python-2.5b2.orig/Python/getplatform.c Python-2.5b2/Python/getplatform.c
200 --- Python-2.5b2.orig/Python/getplatform.c 2000-09-02 00:29:29.000000000 +0100
201 +++ Python-2.5b2/Python/getplatform.c 2006-07-12 17:42:51.000000000 +0100
208 +#define ARCH "unknown"
226 --- Python-3.2/Python/sysmodule.c.orig 2011-01-05 21:08:25.000000000 +0100
227 +++ Python-3.2/Python/sysmodule.c 2011-04-02 08:20:16.773734758 +0200
228 @@ -1608,6 +1608,10 @@
229 PyUnicode_FromString(Py_GetCopyright()));
230 SET_SYS_FROM_STRING("platform",
231 PyUnicode_FromString(Py_GetPlatform()));
232 + SET_SYS_FROM_STRING("arch",
233 + PyUnicode_FromString(Py_GetArch()));
234 + SET_SYS_FROM_STRING("lib",
235 + PyUnicode_FromString(Py_GetLib()));
236 SET_SYS_FROM_STRING("executable",
237 PyUnicode_FromWideChar(
238 Py_GetProgramFullPath(), -1));
239 --- Python-3.2/setup.py.orig 2010-12-28 10:51:43.000000000 +0100
240 +++ Python-3.2/setup.py 2011-04-02 08:21:49.597738949 +0200
241 @@ -422,12 +422,12 @@
242 add_dir_to_list(self.compiler.include_dirs,
243 sysconfig.get_config_var("INCLUDEDIR"))
246 # lib_dirs and inc_dirs are used to search for files;
247 # if a file is found in one of those directories, it can
248 # be assumed that no additional -I,-L directives are needed.
249 lib_dirs = self.compiler.library_dirs + [
250 - '/lib64', '/usr/lib64',
251 - '/lib', '/usr/lib',
252 + libname, '/usr/'+libname
254 inc_dirs = self.compiler.include_dirs + ['/usr/include']
256 @@ -620,11 +620,11 @@
258 readline_libs.append(curses_library)
259 elif self.compiler.find_library_file(lib_dirs +
260 - ['/usr/lib/termcap'],
261 + ['/usr/' + libname + '/termcap'],
263 readline_libs.append('termcap')
264 exts.append( Extension('readline', ['readline.c'],
265 - library_dirs=['/usr/lib/termcap'],
266 + library_dirs=['/usr/' + libname + '/termcap'],
267 extra_link_args=readline_extra_link_args,
268 libraries=readline_libs) )