SOURCES: python30-ac_fixes.patch (NEW), python30-db4.6.patch (NEW)...

arekm arekm at pld-linux.org
Sun Sep 2 20:37:52 CEST 2007


Author: arekm                        Date: Sun Sep  2 18:37:52 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- 3.0 patches

---- Files affected:
SOURCES:
   python30-ac_fixes.patch (NONE -> 1.1)  (NEW), python30-db4.6.patch (NONE -> 1.1)  (NEW), python30-doc_path.patch (NONE -> 1.1)  (NEW), python30-lib64.patch (NONE -> 1.1)  (NEW), python30-noarch_to_datadir.patch (NONE -> 1.1)  (NEW), python30-no_ndbm.patch (NONE -> 1.1)  (NEW), python30-pythonpath.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/python30-ac_fixes.patch
diff -u /dev/null SOURCES/python30-ac_fixes.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-ac_fixes.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,30 @@
+--- Python-2.5b2/configure.in.orig	2006-07-06 11:13:35.000000000 +0100
++++ Python-2.5b2/configure.in	2006-07-12 16:30:30.000000000 +0100
+@@ -753,13 +753,13 @@
+ 	    if test "$Py_DEBUG" = 'true' ; then
+ 		# Optimization messes up debuggers, so turn it off for
+ 		# debug builds.
+-		OPT="-g -Wall $STRICT_PROTO"
++		OPT="-g $CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
+ 	    else
+-		OPT="-g -O3 -Wall $STRICT_PROTO"
++		OPT="-g $CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
+ 	    fi
+ 	    ;;
+ 	*)
+-	    OPT="-O3 -Wall $STRICT_PROTO"
++	    OPT="$CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
+ 	    ;;
+ 	esac
+ 	case $ac_sys_system in
+--- Python-2.5c1.orig/Makefile.pre.in	2006-07-30 17:20:10.000000000 +0100
++++ Python-2.5c1/Makefile.pre.in	2006-08-25 17:51:05.000000000 +0100
+@@ -852,7 +852,7 @@
+ 	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+ 	# Substitution happens here, as the completely-expanded BINDIR
+ 	# is not available in configure
+-	sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
++	sed -e "s, at EXENAME@,$(BINDIR)/python$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
+ 	$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+ 	rm python-config
+ 	@if [ -s Modules/python.exp -a \

================================================================
Index: SOURCES/python30-db4.6.patch
diff -u /dev/null SOURCES/python30-db4.6.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-db4.6.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,11 @@
+--- Python-2.5.1/setup.py~	2007-07-27 20:10:06.000000000 +0200
++++ Python-2.5.1/setup.py	2007-07-27 22:11:36.000000000 +0200
+@@ -606,7 +606,7 @@
+         # a release.  Most open source OSes come with one or more
+         # versions of BerkeleyDB already installed.
+ 
+-        max_db_ver = (4, 5)
++        max_db_ver = (4, 6)
+         min_db_ver = (3, 3)
+         db_setup_debug = False   # verbose debug prints from this script?
+ 

================================================================
Index: SOURCES/python30-doc_path.patch
diff -u /dev/null SOURCES/python30-doc_path.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-doc_path.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,17 @@
+diff -urN Python-3.0a1.org/Lib/pydoc.py Python-3.0a1/Lib/pydoc.py
+--- Python-3.0a1.org/Lib/pydoc.py	2007-08-31 01:06:20.000000000 +0200
++++ Python-3.0a1/Lib/pydoc.py	2007-09-02 20:01:31.787666008 +0200
+@@ -1661,12 +1661,7 @@
+         join = os.path.join
+         for dir in [os.environ.get('PYTHONDOCS'),
+                     homedir and os.path.join(homedir, 'doc'),
+-                    join(execdir, 'doc'), # for Windows
+-                    join(sys.prefix, 'doc/python-docs-' + sys.version.split()[0]),
+-                    join(sys.prefix, 'doc/python-' + sys.version.split()[0]),
+-                    join(sys.prefix, 'doc/python-docs-' + sys.version[:3]),
+-                    join(sys.prefix, 'doc/python-' + sys.version[:3]),
+-                    join(sys.prefix, 'Resources/English.lproj/Documentation')]:
++                    '/usr/share/doc/python-doc-' + string.split(sys.version)[0]]:
+             if dir and os.path.isdir(join(dir, 'lib')):
+                 self.docdir = dir
+                 break

================================================================
Index: SOURCES/python30-lib64.patch
diff -u /dev/null SOURCES/python30-lib64.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-lib64.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,301 @@
+diff -Nur Python-2.5b2.orig/configure.in Python-2.5b2/configure.in
+--- Python-2.5b2.orig/configure.in	2006-07-06 11:13:35.000000000 +0100
++++ Python-2.5b2/configure.in	2006-07-12 17:42:51.000000000 +0100
+@@ -503,6 +503,41 @@
+     ;;
+ esac
+ 
++AC_SUBST(ARCH)
++AC_MSG_CHECKING(ARCH)
++ARCH=`uname -m`
++case $ARCH in
++i?86) ARCH=i386;;
++esac
++AC_MSG_RESULT($ARCH)
++
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++case $ac_sys_system in
++Linux*)
++  # Test if the compiler is 64bit
++  echo 'int i;' > conftest.$ac_ext
++  python_cv_cc_64bit_output=no
++  if AC_TRY_EVAL(ac_compile); then
++    case `/usr/bin/file conftest.$ac_objext` in
++    *"ELF 64"*)
++      python_cv_cc_64bit_output=yes
++      ;;
++    esac
++  fi
++  rm -rf conftest*
++  ;;
++esac
++
++case $ARCH:$python_cv_cc_64bit_output in
++powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++  LIB="lib64"
++  ;;
++*:*)
++  LIB="lib"
++  ;;
++esac
++AC_MSG_RESULT($LIB)
+ 
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+diff -Nur Python-2.5b2.orig/Include/pythonrun.h Python-2.5b2/Include/pythonrun.h
+--- Python-2.5b2.orig/Include/pythonrun.h	2006-04-03 07:26:32.000000000 +0100
++++ Python-2.5b2/Include/pythonrun.h	2006-07-12 17:42:51.000000000 +0100
+@@ -107,6 +107,8 @@
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetArch(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+diff -Nur Python-2.5b2.orig/Lib/distutils/command/install.py Python-2.5b2/Lib/distutils/command/install.py
+--- Python-2.5b2.orig/Lib/distutils/command/install.py	2006-03-27 22:55:21.000000000 +0100
++++ Python-2.5b2/Lib/distutils/command/install.py	2006-07-12 17:42:51.000000000 +0100
+@@ -19,6 +19,8 @@
+ from distutils.errors import DistutilsOptionError
+ from glob import glob
+ 
++libname = sys.lib
++
+ if sys.version < "2.2":
+     WINDOWS_SCHEME = {
+         'purelib': '$base',
+@@ -39,14 +41,14 @@
+ INSTALL_SCHEMES = {
+     'unix_prefix': {
+         'purelib': '$base/lib/python$py_version_short/site-packages',
+-        'platlib': '$platbase/lib/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',
++        'platlib': '$base/'+libname+'/python',
+         'headers': '$base/include/python/$dist_name',
+         'scripts': '$base/bin',
+         'data'   : '$base',
+diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py
+--- Python-2.5b2.orig/Lib/distutils/sysconfig.py	2006-06-27 11:08:25.000000000 +0100
++++ Python-2.5b2/Lib/distutils/sysconfig.py	2006-07-12 17:42:51.000000000 +0100
+@@ -99,8 +99,12 @@
+         prefix = plat_specific and EXEC_PREFIX or PREFIX
+ 
+     if os.name == "posix":
++        if plat_specific:
++            lib = sys.lib
++        else:
++            lib = 'lib'
+         libpython = os.path.join(prefix,
+-                                 "lib", "python" + get_python_version())
++                                 lib, "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
+diff -Nur Python-2.5b2.orig/Lib/distutils/tests/test_install.py Python-2.5b2/Lib/distutils/tests/test_install.py
+--- Python-2.5b2.orig/Lib/distutils/tests/test_install.py	2004-06-26 00:02:59.000000000 +0100
++++ Python-2.5b2/Lib/distutils/tests/test_install.py	2006-07-12 17:42:51.000000000 +0100
+@@ -1,6 +1,6 @@
+ """Tests for distutils.command.install."""
+ 
+-import os
++import os,sys
+ import unittest
+ 
+ from distutils.command.install import install
+@@ -39,8 +39,9 @@
+             self.assertEqual(got, expected)
+ 
+         libdir = os.path.join(destination, "lib", "python")
++        platlibdir =  os.path.join(destination, sys.lib, "python")
+         check_path(cmd.install_lib, libdir)
+-        check_path(cmd.install_platlib, libdir)
++        check_path(cmd.install_platlib, platlibdir)
+         check_path(cmd.install_purelib, libdir)
+         check_path(cmd.install_headers,
+                    os.path.join(destination, "include", "python", "foopkg"))
+diff -Nur Python-2.5b2.orig/Lib/site.py Python-2.5b2/Lib/site.py
+--- Python-2.5b2.orig/Lib/site.py	2006-06-12 09:23:02.000000000 +0100
++++ Python-2.5b2/Lib/site.py	2006-07-12 17:42:51.000000000 +0100
+@@ -182,12 +182,18 @@
+                 sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
+             elif os.sep == '/':
+                 sitedirs = [os.path.join(prefix,
+-                                         "lib",
++                                         sys.lib,
+                                          "python" + sys.version[:3],
+                                          "site-packages"),
+-                            os.path.join(prefix, "lib", "site-python")]
++                            os.path.join(prefix, sys.lib, "site-python")]
++                if sys.lib != 'lib':
++                    sitedirs.append(os.path.join(prefix,
++                                                 'lib',
++                                                 "python" + sys.version[:3],
++                                                 "site-packages"))
++                    sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
+             else:
+-                sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
++                sitedirs = [prefix, os.path.join(prefix, sys.lib, "site-packages")]
+             if sys.platform == 'darwin':
+                 # for framework builds *only* we add the standard Apple
+                 # locations. Currently only per-user, but /Library and
+diff -Nur Python-2.5b2.orig/Makefile.pre.in Python-2.5b2/Makefile.pre.in
+--- Python-2.5b2.orig/Makefile.pre.in	2006-06-27 16:45:32.000000000 +0100
++++ Python-2.5b2/Makefile.pre.in	2006-07-12 17:42:51.000000000 +0100
+@@ -75,6 +75,8 @@
+ 
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
++LIB=		@LIB@
++ARCH=		@ARCH@
+ 
+ # Install prefix for architecture-independent files
+ prefix=		@prefix@
+@@ -84,11 +86,11 @@
+ 
+ # Expanded directories
+ BINDIR=		$(exec_prefix)/bin
+-LIBDIR=		$(exec_prefix)/lib
++LIBDIR=		$(exec_prefix)/$(LIB)
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/lib
++SCRIPTDIR=	$(prefix)/$(LIB)
+ 
+ # Detailed destination directories
+ BINLIBDEST=	$(LIBDIR)/python$(VERSION)
+@@ -489,7 +491,7 @@
+ Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
+ 
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+-		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+ 
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ 		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+diff -Nur Python-2.5b2.orig/Modules/getpath.c Python-2.5b2/Modules/getpath.c
+--- Python-2.5b2.orig/Modules/getpath.c	2006-07-10 02:18:57.000000000 +0100
++++ Python-2.5b2/Modules/getpath.c	2006-07-12 17:42:51.000000000 +0100
+@@ -116,9 +116,17 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+ 
++#ifndef LIB_PYTHON
++#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
++#define LIB_PYTHON "lib64/python"
++#else
++#define LIB_PYTHON "lib/python"
++#endif
++#endif
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+-              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
++              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
+ #endif
+ 
+ #ifndef LANDMARK
+@@ -129,7 +137,7 @@
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON VERSION;
+ 
+ static void
+ reduce(char *dir)
+diff -Nur Python-2.5b2.orig/Python/getplatform.c Python-2.5b2/Python/getplatform.c
+--- Python-2.5b2.orig/Python/getplatform.c	2000-09-02 00:29:29.000000000 +0100
++++ Python-2.5b2/Python/getplatform.c	2006-07-12 17:42:51.000000000 +0100
+@@ -10,3 +10,23 @@
+ {
+ 	return PLATFORM;
+ }
++
++#ifndef ARCH
++#define ARCH "unknown"
++#endif
++
++const char *
++Py_GetArch(void)
++{
++	return ARCH;
++}
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++	return LIB;
++}
+diff -Nur Python-2.5b2.orig/Python/sysmodule.c Python-2.5b2/Python/sysmodule.c
+--- Python-2.5b2.orig/Python/sysmodule.c	2006-07-10 22:08:24.000000000 +0100
++++ Python-2.5b2/Python/sysmodule.c	2006-07-12 17:42:51.000000000 +0100
+@@ -1080,6 +1080,10 @@
+ 			    PyUnicode_FromString(Py_GetCopyright()));
+ 	SET_SYS_FROM_STRING("platform",
+ 			    PyUnicode_FromString(Py_GetPlatform()));
++	SET_SYS_FROM_STRING("arch",
++			    PyUnicode_FromString(Py_GetArch()));
++	SET_SYS_FROM_STRING("lib",
++			    PyUnicode_FromString(Py_GetLib()));
+ 	SET_SYS_FROM_STRING("executable",
+ 			    PyUnicode_FromString(Py_GetProgramFullPath()));
+ 	SET_SYS_FROM_STRING("prefix",
+diff -Nur Python-2.5b2.orig/setup.py Python-2.5b2/setup.py
+--- Python-2.5b2.orig/setup.py	2006-06-30 07:18:39.000000000 +0100
++++ Python-2.5b2/setup.py	2006-07-12 17:45:14.000000000 +0100
+@@ -290,12 +290,12 @@
+         except NameError:
+             have_unicode = 0
+ 
++        libname = sys.lib
+         # lib_dirs and inc_dirs are used to search for files;
+         # if a file is found in one of those directories, it can
+         # be assumed that no additional -I,-L directives are needed.
+         lib_dirs = self.compiler.library_dirs + [
+-            '/lib64', '/usr/lib64',
+-            '/lib', '/usr/lib',
++            libname, '/usr/'+libname
+             ]
+         inc_dirs = self.compiler.include_dirs + ['/usr/include']
+         exts = []
+@@ -496,11 +496,11 @@
+             elif self.compiler.find_library_file(lib_dirs, 'curses'):
+                 readline_libs.append('curses')
+             elif self.compiler.find_library_file(lib_dirs +
+-                                               ['/usr/lib/termcap'],
++                                               ['/usr' + libname + '/termcap'],
+                                                'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
+-                                   library_dirs=['/usr/lib/termcap'],
++                                   library_dirs=['/usr' + libname + 'termcap'],
+                                    extra_link_args=readline_extra_link_args,
+                                    libraries=readline_libs) )
+         if platform not in ['mac']:
+@@ -1244,8 +1244,8 @@
+             added_lib_dirs.append('/usr/openwin/lib')
+         elif os.path.exists('/usr/X11R6/include'):
+             include_dirs.append('/usr/X11R6/include')
+-            added_lib_dirs.append('/usr/X11R6/lib64')
+-            added_lib_dirs.append('/usr/X11R6/lib')
++            added_lib_dirs.append('/usr/X11R6/'+sys.lib)
++            #added_lib_dirs.append('/usr/X11R6/lib')
+         elif os.path.exists('/usr/X11R5/include'):
+             include_dirs.append('/usr/X11R5/include')
+             added_lib_dirs.append('/usr/X11R5/lib')

================================================================
Index: SOURCES/python30-noarch_to_datadir.patch
diff -u /dev/null SOURCES/python30-noarch_to_datadir.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-noarch_to_datadir.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,143 @@
+diff -Nur Python-2.5.orig/Lib/distutils/command/install.py Python-2.5/Lib/distutils/command/install.py
+--- Python-2.5.orig/Lib/distutils/command/install.py	2007-03-17 16:26:13.803357750 +0000
++++ Python-2.5/Lib/distutils/command/install.py	2007-03-17 16:26:50.821671250 +0000
+@@ -40,14 +40,14 @@
+ 
+ INSTALL_SCHEMES = {
+     'unix_prefix': {
+-        'purelib': '$base/lib/python$py_version_short/site-packages',
++        'purelib': '$base/share/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',
++        'purelib': '$base/share/python',
+         'platlib': '$base/'+libname+'/python',
+         'headers': '$base/include/python/$dist_name',
+         'scripts': '$base/bin',
+diff -Nur Python-2.5.orig/Lib/distutils/sysconfig.py Python-2.5/Lib/distutils/sysconfig.py
+--- Python-2.5.orig/Lib/distutils/sysconfig.py	2007-03-17 16:26:13.803357750 +0000
++++ Python-2.5/Lib/distutils/sysconfig.py	2007-03-17 16:26:50.821671250 +0000
+@@ -99,12 +99,12 @@
+         prefix = plat_specific and EXEC_PREFIX or PREFIX
+ 
+     if os.name == "posix":
+-        if plat_specific:
+-            lib = sys.lib
++        if plat_specific: 
++            libpython = os.path.join(prefix,
++                                 sys.lib, "python" + get_python_version())
+         else:
+-            lib = 'lib'
+-        libpython = os.path.join(prefix,
+-                                 lib, "python" + get_python_version())
++            libpython = os.path.join(prefix,
++                                 "share", "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
+diff -Nur Python-2.5.orig/Lib/site.py Python-2.5/Lib/site.py
+--- Python-2.5.orig/Lib/site.py	2007-03-17 16:26:13.803357750 +0000
++++ Python-2.5/Lib/site.py	2007-03-17 16:26:50.825671500 +0000
+@@ -185,13 +185,12 @@
+                                          sys.lib,
+                                          "python" + sys.version[:3],
+                                          "site-packages"),
+-                            os.path.join(prefix, sys.lib, "site-python")]
+-                if sys.lib != 'lib':
+-                    sitedirs.append(os.path.join(prefix,
+-                                                 'lib',
+-                                                 "python" + sys.version[:3],
+-                                                 "site-packages"))
+-                    sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
++                            os.path.join(prefix, sys.lib, "site-python"),
++                            os.path.join(prefix,
++                                         "share",
++                                         "python" + sys.version[:3],
++                                         "site-packages"),
++                            os.path.join(prefix, "share", "site-python")]
+             else:
+                 sitedirs = [prefix, os.path.join(prefix, sys.lib, "site-packages")]
+             if sys.platform == 'darwin':
+diff -Nur Python-2.5.orig/Makefile.pre.in Python-2.5/Makefile.pre.in
+--- Python-2.5.orig/Makefile.pre.in	2007-03-17 16:26:13.807358000 +0000
++++ Python-2.5/Makefile.pre.in	2007-03-17 16:26:50.821671250 +0000
+@@ -90,7 +90,7 @@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/$(LIB)
++SCRIPTDIR=	$(prefix)/share
+ 
+ # Detailed destination directories
+ BINLIBDEST=	$(LIBDIR)/python$(VERSION)
+diff -Nur Python-2.5.orig/Modules/getpath.c Python-2.5/Modules/getpath.c
+--- Python-2.5.orig/Modules/getpath.c	2007-03-17 16:26:13.807358000 +0000
++++ Python-2.5/Modules/getpath.c	2007-03-17 16:26:50.825671500 +0000
+@@ -126,7 +126,8 @@
+ 
+ #ifndef PYTHONPATH
+ #define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
+-              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
++              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:" \
++              PREFIX "/share/python" VERSION
+ #endif
+ 
+ #ifndef LANDMARK
+@@ -137,7 +138,8 @@
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+ static char lib_python[] = LIB_PYTHON VERSION;
++static char share_python[] = "share/python" VERSION;
+ 
+ static void
+ reduce(char *dir)
+@@ -275,7 +277,7 @@
+         delim = strchr(prefix, DELIM);
+         if (delim)
+             *delim = '\0';
+-        joinpath(prefix, lib_python);
++        joinpath(prefix, share_python);
+         joinpath(prefix, LANDMARK);
+         return 1;
+     }
+@@ -298,7 +300,7 @@
+     copy_absolute(prefix, argv0_path);
+     do {
+         n = strlen(prefix);
+-        joinpath(prefix, lib_python);
++        joinpath(prefix, share_python);
+         joinpath(prefix, LANDMARK);
+         if (ismodule(prefix))
+             return 1;
+@@ -308,7 +310,7 @@
+ 
+     /* Look at configure's PREFIX */
+     strncpy(prefix, PREFIX, MAXPATHLEN);
+-    joinpath(prefix, lib_python);
++    joinpath(prefix, share_python);
+     joinpath(prefix, LANDMARK);
+     if (ismodule(prefix))
+         return 1;
+@@ -519,7 +521,7 @@
+             fprintf(stderr,
+                 "Could not find platform independent libraries <prefix>\n");
+         strncpy(prefix, PREFIX, MAXPATHLEN);
+-        joinpath(prefix, lib_python);
++        joinpath(prefix, share_python);
+     }
+     else
+         reduce(prefix);
+@@ -532,7 +534,7 @@
+     }
+     else
+         strncpy(zip_path, PREFIX, MAXPATHLEN);
+-    joinpath(zip_path, "lib/python00.zip");
++    joinpath(zip_path, LIB_PYTHON "00.zip");
+     bufsz = strlen(zip_path);	/* Replace "00" with version */
+     zip_path[bufsz - 6] = VERSION[0];
+     zip_path[bufsz - 5] = VERSION[2];

================================================================
Index: SOURCES/python30-no_ndbm.patch
diff -u /dev/null SOURCES/python30-no_ndbm.patch:1.1
--- /dev/null	Sun Sep  2 20:37:52 2007
+++ SOURCES/python30-no_ndbm.patch	Sun Sep  2 20:37:47 2007
@@ -0,0 +1,62 @@
+diff -urN Python-3.0a1.org/Modules/dbmmodule.c Python-3.0a1/Modules/dbmmodule.c
+--- Python-3.0a1.org/Modules/dbmmodule.c	2007-08-14 18:29:22.000000000 +0200
++++ Python-3.0a1/Modules/dbmmodule.c	2007-09-02 20:09:52.356906353 +0200
+@@ -11,22 +11,12 @@
+ /* Some Linux systems install gdbm/ndbm.h, but not ndbm.h.  This supports
+  * whichever configure was able to locate.
+  */
+-#if defined(HAVE_NDBM_H)
+ #include <ndbm.h>
+ #if defined(PYOS_OS2) && !defined(PYCC_GCC)
+ static char *which_dbm = "ndbm";
+ #else
+ static char *which_dbm = "GNU gdbm";  /* EMX port of GDBM */
+ #endif
+-#elif defined(HAVE_GDBM_NDBM_H)
+-#include <gdbm/ndbm.h>
+-static char *which_dbm = "GNU gdbm";
+-#elif defined(HAVE_BERKDB_H)
+-#include <db.h>
+-static char *which_dbm = "Berkeley DB";
+-#else
+-#error "No ndbm.h available!"
+-#endif
+ 
+ typedef struct {
+ 	PyObject_HEAD
+diff -urN Python-3.0a1.org/setup.py Python-3.0a1/setup.py
+--- Python-3.0a1.org/setup.py	2007-08-29 00:24:48.000000000 +0200
++++ Python-3.0a1/setup.py	2007-09-02 20:09:34.579833964 +0200
+@@ -869,30 +869,8 @@
+ 
+         # The standard Unix dbm module:
+         if platform not in ['cygwin']:
+-            if find_file("ndbm.h", inc_dirs, []) is not None:
+-                # Some systems have -lndbm, others don't
+-                if self.compiler.find_library_file(lib_dirs, 'ndbm'):
+-                    ndbm_libs = ['ndbm']
+-                else:
+-                    ndbm_libs = []
+-                exts.append( Extension('dbm', ['dbmmodule.c'],
+-                                       define_macros=[('HAVE_NDBM_H',None)],
+-                                       libraries = ndbm_libs ) )
+-            elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
+-                  and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
+-                exts.append( Extension('dbm', ['dbmmodule.c'],
+-                                       define_macros=[('HAVE_GDBM_NDBM_H',None)],
+-                                       libraries = ['gdbm'] ) )
+-            elif db_incs is not None:
+-                exts.append( Extension('dbm', ['dbmmodule.c'],
+-                                       library_dirs=dblib_dir,
+-                                       runtime_library_dirs=dblib_dir,
+-                                       include_dirs=db_incs,
+-                                       define_macros=[('HAVE_BERKDB_H',None),
+-                                                      ('DB_DBM_HSEARCH',None)],
+-                                       libraries=dblibs))
+-            else:
+-                missing.append('dbm')
++            exts.append( Extension('dbm', ['dbmmodule.c'],
++                                   libraries = ['gdbm', 'gdbm_compat'] ) )
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list