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 diff -Nur Python-2.5b2.orig/Lib/distutils/command/install.py Python-2.5b2/Lib/distutils/command/install.py
59 --- Python-2.5b2.orig/Lib/distutils/command/install.py 2006-03-27 22:55:21.000000000 +0100
60 +++ Python-2.5b2/Lib/distutils/command/install.py 2006-07-12 17:42:51.000000000 +0100
62 from distutils.errors import DistutilsOptionError
67 if sys.version < "2.2":
73 'purelib': '$base/lib/python$py_version_short/site-packages',
74 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
75 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
76 'headers': '$base/include/python$py_version_short/$dist_name',
77 'scripts': '$base/bin',
81 'purelib': '$base/lib/python',
82 - 'platlib': '$base/lib/python',
83 + 'platlib': '$base/'+libname+'/python',
84 'headers': '$base/include/python/$dist_name',
85 'scripts': '$base/bin',
87 diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py
88 --- Python-2.5b2.orig/Lib/distutils/sysconfig.py 2006-06-27 11:08:25.000000000 +0100
89 +++ Python-2.5b2/Lib/distutils/sysconfig.py 2006-07-12 17:42:51.000000000 +0100
91 prefix = plat_specific and EXEC_PREFIX or PREFIX
93 if os.name == "posix":
98 libpython = os.path.join(prefix,
99 - "lib", "python" + get_python_version())
100 + lib, "python" + get_python_version())
104 diff -Nur Python-2.5b2.orig/Lib/distutils/tests/test_install.py Python-2.5b2/Lib/distutils/tests/test_install.py
105 --- Python-2.5b2.orig/Lib/distutils/tests/test_install.py 2004-06-26 00:02:59.000000000 +0100
106 +++ Python-2.5b2/Lib/distutils/tests/test_install.py 2006-07-12 17:42:51.000000000 +0100
108 """Tests for distutils.command.install."""
114 from distutils.command.install import install
116 self.assertEqual(got, expected)
118 libdir = os.path.join(destination, "lib", "python")
119 + platlibdir = os.path.join(destination, sys.lib, "python")
120 check_path(cmd.install_lib, libdir)
121 - check_path(cmd.install_platlib, libdir)
122 + check_path(cmd.install_platlib, platlibdir)
123 check_path(cmd.install_purelib, libdir)
124 check_path(cmd.install_headers,
125 os.path.join(destination, "include", "python", "foopkg"))
126 diff -Nur Python-2.5b2.orig/Lib/site.py Python-2.5b2/Lib/site.py
127 --- Python-2.5b2.orig/Lib/site.py 2006-06-12 09:23:02.000000000 +0100
128 +++ Python-2.5b2/Lib/site.py 2006-07-12 17:42:51.000000000 +0100
129 @@ -258,13 +258,19 @@
130 if sys.platform in ('os2emx', 'riscos'):
131 sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
133 - sitedirs.append(os.path.join(prefix, "lib",
134 + sitedirs.append(os.path.join(prefix, sys.lib,
135 "python" + sys.version[:3],
137 - sitedirs.append(os.path.join(prefix, "lib", "site-python"))
138 + sitedirs.append(os.path.join(prefix, sys.lib, "site-python"))
139 + if sys.lib != 'lib':
140 + sitedirs.append(os.path.join(prefix, 'lib',
141 + "python" + sys.version[:3],
143 + sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
146 sitedirs.append(prefix)
147 - sitedirs.append(os.path.join(prefix, "lib", "site-packages"))
148 + sitedirs.append(os.path.join(prefix, sys.lib, "site-packages"))
150 if sys.platform == "darwin":
151 # for framework builds *only* we add the standard Apple
152 diff -Nur Python-2.5b2.orig/Makefile.pre.in Python-2.5b2/Makefile.pre.in
153 --- Python-2.5b2.orig/Makefile.pre.in 2006-06-27 16:45:32.000000000 +0100
154 +++ Python-2.5b2/Makefile.pre.in 2006-07-12 17:42:51.000000000 +0100
157 # Machine-dependent subdirectories
162 # Install prefix for architecture-independent files
166 # Expanded directories
167 BINDIR= $(exec_prefix)/bin
168 -LIBDIR= $(exec_prefix)/lib
169 +LIBDIR= $(exec_prefix)/$(LIB)
171 INCLUDEDIR= @includedir@
172 CONFINCLUDEDIR= $(exec_prefix)/include
173 -SCRIPTDIR= $(prefix)/lib
174 +SCRIPTDIR= $(prefix)/$(LIB)
176 # Detailed destination directories
177 BINLIBDEST= $(LIBDIR)/python$(VERSION)
179 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
181 Python/getplatform.o: $(srcdir)/Python/getplatform.c
182 - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
183 + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
185 Python/importdl.o: $(srcdir)/Python/importdl.c
186 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
187 diff -Nur Python-2.5b2.orig/Modules/getpath.c Python-2.5b2/Modules/getpath.c
188 --- Python-2.5b2.orig/Modules/getpath.c 2006-07-10 02:18:57.000000000 +0100
189 +++ Python-2.5b2/Modules/getpath.c 2006-07-12 17:42:51.000000000 +0100
191 #define EXEC_PREFIX PREFIX
195 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
196 +#define LIB_PYTHON L"lib64/python"
198 +#define LIB_PYTHON L"lib/python"
203 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
204 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
205 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
206 + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
211 static wchar_t exec_prefix[MAXPATHLEN+1];
212 static wchar_t progpath[MAXPATHLEN+1];
213 static wchar_t *module_search_path = NULL;
214 -static wchar_t lib_python[] = L"lib/python" VERSION;
215 +static wchar_t lib_python[] = LIB_PYTHON VERSION;
217 /* In principle, this should use HAVE__WSTAT, and _wstat
218 should be detected by autoconf. However, no current
219 diff -Nur Python-2.5b2.orig/Python/getplatform.c Python-2.5b2/Python/getplatform.c
220 --- Python-2.5b2.orig/Python/getplatform.c 2000-09-02 00:29:29.000000000 +0100
221 +++ Python-2.5b2/Python/getplatform.c 2006-07-12 17:42:51.000000000 +0100
228 +#define ARCH "unknown"
246 diff -Nur Python-2.5b2.orig/Python/sysmodule.c Python-2.5b2/Python/sysmodule.c
247 --- Python-2.5b2.orig/Python/sysmodule.c 2006-07-10 22:08:24.000000000 +0100
248 +++ Python-2.5b2/Python/sysmodule.c 2006-07-12 17:42:51.000000000 +0100
249 @@ -1080,6 +1080,10 @@
250 PyUnicode_FromString(Py_GetCopyright()));
251 SET_SYS_FROM_STRING("platform",
252 PyUnicode_FromString(Py_GetPlatform()));
253 + SET_SYS_FROM_STRING("arch",
254 + PyUnicode_FromString(Py_GetArch()));
255 + SET_SYS_FROM_STRING("lib",
256 + PyUnicode_FromString(Py_GetLib()));
257 SET_SYS_FROM_STRING("executable",
258 PyUnicode_FromString(Py_GetProgramFullPath()));
259 SET_SYS_FROM_STRING("prefix",
260 diff -Nur Python-2.5b2.orig/setup.py Python-2.5b2/setup.py
261 --- Python-2.5b2.orig/setup.py 2006-06-30 07:18:39.000000000 +0100
262 +++ Python-2.5b2/setup.py 2006-07-12 17:45:14.000000000 +0100
263 @@ -290,12 +290,12 @@
268 # lib_dirs and inc_dirs are used to search for files;
269 # if a file is found in one of those directories, it can
270 # be assumed that no additional -I,-L directives are needed.
271 lib_dirs = self.compiler.library_dirs + [
272 - '/lib64', '/usr/lib64',
273 - '/lib', '/usr/lib',
274 + libname, '/usr/'+libname
276 inc_dirs = self.compiler.include_dirs + ['/usr/include']
278 @@ -496,11 +496,11 @@
279 elif self.compiler.find_library_file(lib_dirs, 'curses'):
280 readline_libs.append('curses')
281 elif self.compiler.find_library_file(lib_dirs +
282 - ['/usr/lib/termcap'],
283 + ['/usr' + libname + '/termcap'],
285 readline_libs.append('termcap')
286 exts.append( Extension('readline', ['readline.c'],
287 - library_dirs=['/usr/lib/termcap'],
288 + library_dirs=['/usr' + libname + 'termcap'],
289 extra_link_args=readline_extra_link_args,
290 libraries=readline_libs) )
291 if platform not in ['mac']:
292 @@ -1244,8 +1244,8 @@
293 added_lib_dirs.append('/usr/openwin/lib')
294 elif os.path.exists('/usr/X11R6/include'):
295 include_dirs.append('/usr/X11R6/include')
296 - added_lib_dirs.append('/usr/X11R6/lib64')
297 - added_lib_dirs.append('/usr/X11R6/lib')
298 + added_lib_dirs.append('/usr/X11R6/'+sys.lib)
299 + #added_lib_dirs.append('/usr/X11R6/lib')
300 elif os.path.exists('/usr/X11R5/include'):
301 include_dirs.append('/usr/X11R5/include')
302 added_lib_dirs.append('/usr/X11R5/lib')