2009-12-03 Laszlo (Laca) Peter <[email protected]>
authorlaca
Sat, 05 Dec 2009 10:44:19 +0000
changeset 17126 ab01a33ed216
parent 17125 abd1cb880ce5
child 17127 e5a35e353382
2009-12-03 Laszlo (Laca) Peter <[email protected]> * SUNWPython.spec: delete /usr/bin/python, now points to python2.6 * SUNWPython26.spec: add /usr/bin/python symlink to python2.6; bump to 2.6.4; add patch readline.diff to enable the readline module * patches/Python26-05-isalibs.diff: merge * patches/Python26-06-write_compiled_module-atomic.diff: merge * patches/Python26-18-readline.diff: (new) enable building the readline module
ChangeLog
SUNWPython.spec
SUNWPython26.spec
patches/Python26-05-isalibs.diff
patches/Python26-06-write_compiled_module-atomic.diff
patches/Python26-18-readline.diff
--- a/ChangeLog	Sat Dec 05 03:52:03 2009 +0000
+++ b/ChangeLog	Sat Dec 05 10:44:19 2009 +0000
@@ -1,3 +1,13 @@
+2009-12-03  Laszlo (Laca) Peter  <[email protected]>
+
+	* SUNWPython.spec: delete /usr/bin/python, now points to python2.6
+	* SUNWPython26.spec: add /usr/bin/python symlink to python2.6;
+	  bump to 2.6.4; add patch readline.diff to enable the readline module
+	* patches/Python26-05-isalibs.diff: merge
+	* patches/Python26-06-write_compiled_module-atomic.diff: merge
+	* patches/Python26-18-readline.diff: (new) enable building the
+	  readline module
+
 2009-12-04  Brian Cameron  <[email protected]>
 
 	* base-specs/gnome-power-manager.spec, 
--- a/SUNWPython.spec	Sat Dec 05 03:52:03 2009 +0000
+++ b/SUNWPython.spec	Sat Dec 05 10:44:19 2009 +0000
@@ -278,11 +278,11 @@
 cd %{_arch64}
 mv python2.4 isapython2.4
 ln -s isapython2.4 python2.4
+rm python
 cd ..
 %endif
 
 ln -s ../lib/isaexec isapython2.4
-ln -s python2.4 python
 
 %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
 
@@ -297,7 +297,6 @@
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/idle
 %{_bindir}/pydoc
-%{_bindir}/python
 %{_bindir}/python2.4
 %{_bindir}/%{base_isa}/isapython2.4
 %hard %{_bindir}/isapython2.4
@@ -342,6 +341,9 @@
 %{_libdir}/python?.?/py[cC][cC]
 
 %changelog
+* Thu Dec  3 2009 - [email protected]
+- delete /usr/bin/python, it now points to python2.6 and is delivered in the
+  SUNWPython26 package
 * Tue Dec  1 2009 - [email protected]
 - add a nicer fix for the netpacket/packet.h build issue
 * Wed Nov 25 2009 - [email protected]
--- a/SUNWPython26.spec	Sat Dec 05 03:52:03 2009 +0000
+++ b/SUNWPython26.spec	Sat Dec 05 10:44:19 2009 +0000
@@ -16,7 +16,7 @@
 
 Name:                    SUNWPython26
 Summary:                 The Python interpreter, libraries and utilities
-Version:                 2.6.2
+Version:                 2.6.4
 %define majmin           2.6
 SUNW_BaseDir:            %{_basedir}
 SUNW_Copyright:          %{name}.copyright
@@ -78,6 +78,9 @@
 # netpacket/packet.h on Solaris is incompatible with
 # python's socketmodule.c
 Patch17:                 Python26-17-netpacket-packet-h.diff
+# date:2009-12-02 owner:laca type:bug
+# enable readline support on Solaris
+Patch18:                 Python26-18-readline.diff
 
 %include default-depend.inc
 BuildRequires: SUNWTk
@@ -103,6 +106,7 @@
 Requires: SUNWsqlite3
 Requires: SUNWlibffi
 Requires: SUNWncurses
+Requires: SUNWgnu-readline
 
 %package devel
 Summary:                 %{summary} - development files
@@ -129,6 +133,7 @@
 %patch15 -p1
 %patch16 -p1
 %patch17 -p1
+%patch18 -p1 -b .readline
 cd ..
 
 echo fixing python binary name/path in python scripts:
@@ -174,7 +179,7 @@
 export CXX="$CXX -xregs=no%frameptr -norunpath -compat=5"
 export CFLAGS="-I/usr/include/ncurses %optflags -D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
 export CPPFLAGS="-D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
-export LDFLAGS="%_ldflags -L."
+export LDFLAGS="%_ldflags -L. -L/usr/gnu/lib"
 
 ./configure --prefix=%{_prefix} \
   --libdir=%{_libdir} \
@@ -198,12 +203,12 @@
 cd Python-%{version}-64
 
 export CXXFLAGS="%cxx_optflags64"
-export CFLAGS="-I/usr/include/ncurses  %optflags64 -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
-export CPPFLAGS="-I/usr/include/ncurses -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
+export CFLAGS="-I/usr/include/ncurses  %optflags64 -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/%{_arch64} pkg-config --cflags libffi`"
+export CPPFLAGS="-I/usr/include/ncurses -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/%{_arch64} pkg-config --cflags libffi`"
 export CC="$CC %optflags64"
 export CXX="$CXX %cxx_optflags64"
 export DFLAGS=-64
-export LDFLAGS="%_ldflags -L."
+export LDFLAGS="%_ldflags -L. -L/usr/gnu/lib/%{_arch64}"
 
 autoheader
 autoconf
@@ -301,23 +306,33 @@
 rm python-config
 mv python%{majmin} isapython%{majmin}
 ln -s isapython%{majmin} python%{majmin}
+# this is the default python
+ln -s python%{majmin} python
 # don't need a 64-bit version of this tool
 rm 2to3
 cd ..
 %endif
 
+# this becomes a hard link in the pkgmap, due to %hard
 ln -s ../lib/isaexec isapython%{majmin}
-# FIXME: because python 2.5 is not the default
-# ln -s python%{majmin} python
-rm python-config
+
+# this is the default python
+ln -s python%{majmin} python
 
 %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
 
 # sanity check: verify that some tricky modules were successfully built:
 for f in _ctypes.so _curses.so _curses_panel.so _elementtree.so \
     _multiprocessing.so _sqlite3.so _ssl.so _tkinter.so crypt.so \
-    pyexpat.so sunaudiodev.so zlib.so dlpi.so ucred.so bz2.so\
-    64/_ctypes.so 64/_curses.so 64/_curses_panel.so 64/_elementtree.so \
+    pyexpat.so sunaudiodev.so zlib.so dlpi.so ucred.so bz2.so; do
+    test -f $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/lib-dynload/$f || {
+	echo ERROR: required module $f missing
+	exit 1
+    }
+done
+
+%ifarch amd64 sparcv9
+for f in 64/_ctypes.so 64/_curses.so 64/_curses_panel.so 64/_elementtree.so \
     64/_multiprocessing.so 64/_sqlite3.so 64/_ssl.so 64/_tkinter.so \
     64/crypt.so 64/dlpi.so 64/ucred.so 64/pyexpat.so 64/bz2.so 64/zlib.so \
     64/sunaudiodev.so; do
@@ -326,6 +341,7 @@
 	exit 1
     }
 done
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -334,6 +350,8 @@
 %defattr (-, root, bin)
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/python%{majmin}
+%{_bindir}/python-config
+%{_bindir}/python
 # hard link to isaexec
 %hard %{_bindir}/isapython%{majmin}
 %dir %attr (0755, root, bin) %{_bindir}/%{base_isa}
@@ -370,6 +388,7 @@
 %{_libdir}/%{_arch64}/lib*.so*
 %dir %attr(0755, root, bin) %{_bindir}/%{_arch64}
 %{_bindir}/%{_arch64}/python%{majmin}
+%{_bindir}/%{_arch64}/python
 %{_bindir}/%{_arch64}/isapython%{majmin}
 %endif
 %dir %attr(0755, root, sys) %{_datadir}
@@ -398,6 +417,10 @@
 %{_libdir}/python?.?/py[cC][cC]
 
 %changelog
+* Thu Dec  3 2009 - [email protected]
+- bump to 2.6.4
+- add patch readline.diff for enabling the build of the readline module
+- point /usr/bin/python to python2.6
 * Tue Dec  1 2009 - [email protected]
 - add a nicer fix for the netpacket/packet.h build issue
 * Thu Nov 19 2009 - [email protected]
--- a/patches/Python26-05-isalibs.diff	Sat Dec 05 03:52:03 2009 +0000
+++ b/patches/Python26-05-isalibs.diff	Sat Dec 05 10:44:19 2009 +0000
@@ -1,5 +1,163 @@
---- Python-2.6/configure.in.isalibs	2008-09-08 07:18:16.000000000 +1200
-+++ Python-2.6/configure.in	2008-12-02 23:22:30.760662011 +1300
+--- Python-2.6.4/Lib/distutils/command/build_ext.py.isalibs	2009-10-14 10:17:34.000000000 +1300
++++ Python-2.6.4/Lib/distutils/command/build_ext.py	2009-12-02 15:52:48.646454213 +1300
+@@ -636,6 +636,8 @@
+         modpath = fullname.split('.')
+         filename = self.get_ext_filename(ext_name)
+         filename = os.path.split(filename)[-1]
++        if sys.maxint != 2147483647L:
++            filename = os.path.join("64", filename)
+ 
+         if not self.inplace:
+             # no further work needed
+@@ -677,7 +679,13 @@
+         so_ext = get_config_var('SO')
+         if os.name == 'nt' and self.debug:
+             return apply(os.path.join, ext_path) + '_d' + so_ext
+-        return os.path.join(*ext_path) + so_ext
++        # .so extensions are word-size specific
++        path = apply(os.path.join, ext_path)
++        if sys.maxint == 2147483647L:
++            return path + so_ext
++        dirname = os.path.dirname(path);
++        basename = os.path.basename(path);
++        return os.path.join(dirname, "64", basename + so_ext)
+ 
+     def get_export_symbols (self, ext):
+         """Return the list of symbols that a shared extension has to
+--- Python-2.6.4/Python/import.c.isalibs	2009-09-17 08:06:36.000000000 +1200
++++ Python-2.6.4/Python/import.c	2009-12-02 15:46:25.143803213 +1300
+@@ -1191,6 +1191,57 @@
+ static int find_init_module(char *); /* Forward */
+ static struct filedescr importhookdescr = {"", "", IMP_HOOK};
+ 
++#ifdef HAVE_STAT
++static char *
++insert_64dir(char *buf, size_t buflen)
++{
++	char *base;
++	char *cp;
++	size_t blen;
++
++	if ((blen = strlen(buf)) == 0)
++		return (NULL);
++
++	cp = &buf[blen - 1];
++	while (cp != buf && *cp != SEP)
++		cp--;
++
++	if (cp != buf)
++		cp++;
++
++	if (blen + strlen("64/") + 1 >= buflen)
++		return NULL;
++
++	base = strdup(cp);
++	sprintf(cp, "64%c%s", SEP, base);
++	free(base);
++
++	return buf;
++}
++
++/*
++ * If we're on a 64-bit platform, modify lookups for shared object files.
++ */
++static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
++{
++	struct stat statbuf;
++
++	if (sizeof(void *) != 8)
++		return 0;
++
++	if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
++		return 0;
++
++	if (fdp->type != C_EXTENSION)
++		return 0;
++
++	if (insert_64dir(buf, buflen) == NULL)
++		return 0;
++
++	return strlen("64/");
++}
++#endif
++
+ static struct filedescr *
+ find_module(char *fullname, char *subname, PyObject *path, char *buf,
+ 	    size_t buflen, FILE **p_fp, PyObject **p_loader)
+@@ -1208,11 +1259,10 @@
+ 	static struct filedescr fd_builtin = {"", "", C_BUILTIN};
+ 	static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
+ 	char name[MAXPATHLEN+1];
+-#if defined(PYOS_OS2)
+ 	size_t saved_len;
+ 	size_t saved_namelen;
+ 	char *saved_buf = NULL;
+-#endif
++
+ 	if (p_loader != NULL)
+ 		*p_loader = NULL;
+ 
+@@ -1431,15 +1481,19 @@
+ 		}
+ #endif
+ #endif
+-#if defined(PYOS_OS2)
++
+ 		/* take a snapshot of the module spec for restoration
+ 		 * after the 8 character DLL hackery
+ 		 */
+ 		saved_buf = strdup(buf);
+ 		saved_len = len;
+ 		saved_namelen = namelen;
+-#endif /* PYOS_OS2 */
++
+ 		for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
++#ifdef HAVE_STAT
++                        len += modify_path(fdp, buf, buflen);
++#endif
++
+ #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
+ 			/* OS/2 limits DLLs to 8 character names (w/o
+ 			   extension)
+@@ -1480,21 +1534,18 @@
+ 					fp = NULL;
+ 				}
+ 			}
+-#if defined(PYOS_OS2)
++
+ 			/* restore the saved snapshot */
+ 			strcpy(buf, saved_buf);
+ 			len = saved_len;
+ 			namelen = saved_namelen;
+-#endif
+ 		}
+-#if defined(PYOS_OS2)
+ 		/* don't need/want the module name snapshot anymore */
+ 		if (saved_buf)
+ 		{
+ 			free(saved_buf);
+ 			saved_buf = NULL;
+ 		}
+-#endif
+ 		Py_XDECREF(copy);
+ 		if (fp != NULL)
+ 			break;
+--- Python-2.6.4/Python/importdl.h.isalibs	2002-12-31 11:08:05.000000000 +1300
++++ Python-2.6.4/Python/importdl.h	2009-12-02 15:46:25.144470995 +1300
+@@ -31,8 +31,9 @@
+ extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
+ 					     FILE *);
+ 
+-/* Max length of module suffix searched for -- accommodates "module.slb" */
+-#define MAXSUFFIXSIZE 12
++/* Max length of module suffix searched for -- accommodates "module.slb"
++   and "64/" */
++#define MAXSUFFIXSIZE 15
+ 
+ #ifdef MS_WINDOWS
+ #include <windows.h>
+--- Python-2.6.4/configure.in.isalibs	2009-09-30 02:01:59.000000000 +1300
++++ Python-2.6.4/configure.in	2009-12-02 15:46:25.140023688 +1300
 @@ -17,8 +17,44 @@
  AH_TOP([
  #ifndef Py_PYCONFIG_H
@@ -45,7 +203,7 @@
  /* Define the macros needed if on a UnixWare 7.x system. */
  #if defined(__USLC__) && defined(__SCO_VERSION__)
  #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
-@@ -65,6 +99,26 @@
+@@ -65,6 +101,26 @@
  
  define_xopen_source=yes
  
@@ -72,7 +230,7 @@
  # Arguments passed to configure.
  AC_SUBST(CONFIG_ARGS)
  CONFIG_ARGS="$ac_configure_args"
-@@ -1332,14 +1386,10 @@
+@@ -1377,14 +1433,10 @@
  
  # Sizes of various common basic types
  # ANSI C requires sizeof(char) == 1, so no need to check it
@@ -88,7 +246,7 @@
  AC_CHECK_SIZEOF(pid_t, 4)
  
  AC_MSG_CHECKING(for long long support)
-@@ -1349,9 +1396,6 @@
+@@ -1394,9 +1446,6 @@
    have_long_long=yes
  ])
  AC_MSG_RESULT($have_long_long)
@@ -98,7 +256,7 @@
  
  AC_MSG_CHECKING(for long double support)
  have_long_double=no
-@@ -1359,10 +1403,6 @@
+@@ -1404,10 +1453,6 @@
    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
    have_long_double=yes
  ])
@@ -109,7 +267,7 @@
  
  AC_MSG_CHECKING(for _Bool support)
  have_c99_bool=no
-@@ -1376,102 +1416,26 @@
+@@ -1421,102 +1466,26 @@
  fi
  
  AC_CHECK_TYPES(uintptr_t, 
@@ -223,7 +381,7 @@
  
  AC_MSG_CHECKING(for --enable-toolbox-glue)
  AC_ARG_ENABLE(toolbox-glue,
-@@ -1716,12 +1680,6 @@
+@@ -1810,12 +1779,6 @@
  if test -z "$CCSHARED"
  then
  	case $ac_sys_system/$ac_sys_release in
@@ -236,7 +394,7 @@
  	hp*|HP*) if test "$GCC" = yes;
  		 then CCSHARED="-fPIC";
  		 else CCSHARED="+z";
-@@ -3177,12 +3135,6 @@
+@@ -3308,12 +3271,6 @@
  wchar_h="no"
  )
  
@@ -249,7 +407,7 @@
  AC_MSG_CHECKING(for UCS-4 tcl)
  have_ucs4_tcl=no
  AC_TRY_COMPILE([
-@@ -3213,6 +3165,11 @@
+@@ -3344,6 +3301,11 @@
    ac_cv_wchar_t_signed=no,
    ac_cv_wchar_t_signed=yes)])
    AC_MSG_RESULT($ac_cv_wchar_t_signed)
@@ -261,155 +419,6 @@
  fi
    
  AC_MSG_CHECKING(what type to use for unicode)
---- Python-2.6/Lib/distutils/command/build_ext.py.isalibs	2008-08-17 16:16:04.000000000 +1200
-+++ Python-2.6/Lib/distutils/command/build_ext.py	2008-12-02 20:21:28.414086096 +1300
-@@ -679,7 +679,13 @@
-         so_ext = get_config_var('SO')
-         if os.name == 'nt' and self.debug:
-             return apply(os.path.join, ext_path) + '_d' + so_ext
--        return os.path.join(*ext_path) + so_ext
-+        # .so extensions are word-size specific
-+        path = apply(os.path.join, ext_path)
-+        if sys.maxint == 2147483647L:
-+            return path + so_ext
-+        dirname = os.path.dirname(path);
-+        basename = os.path.basename(path);
-+        return os.path.join(dirname, "64", basename + so_ext)
- 
-     def get_export_symbols (self, ext):
-         """Return the list of symbols that a shared extension has to
---- Python-2.6/Python/import.c.isalibs	2008-09-02 02:18:30.000000000 +1200
-+++ Python-2.6/Python/import.c	2008-12-02 20:07:11.756648109 +1300
-@@ -1147,6 +1147,57 @@
- static int find_init_module(char *); /* Forward */
- static struct filedescr importhookdescr = {"", "", IMP_HOOK};
- 
-+#ifdef HAVE_STAT
-+static char *
-+insert_64dir(char *buf, size_t buflen)
-+{
-+	char *base;
-+	char *cp;
-+	size_t blen;
-+
-+	if ((blen = strlen(buf)) == 0)
-+		return (NULL);
-+
-+	cp = &buf[blen - 1];
-+	while (cp != buf && *cp != SEP)
-+		cp--;
-+
-+	if (cp != buf)
-+		cp++;
-+
-+	if (blen + strlen("64/") + 1 >= buflen)
-+		return NULL;
-+
-+	base = strdup(cp);
-+	sprintf(cp, "64%c%s", SEP, base);
-+	free(base);
-+
-+	return buf;
-+}
-+
-+/*
-+ * If we're on a 64-bit platform, modify lookups for shared object files.
-+ */
-+static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
-+{
-+	struct stat statbuf;
-+
-+	if (sizeof(void *) != 8)
-+		return 0;
-+
-+	if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
-+		return 0;
-+
-+	if (fdp->type != C_EXTENSION)
-+		return 0;
-+
-+	if (insert_64dir(buf, buflen) == NULL)
-+		return 0;
-+
-+	return strlen("64/");
-+}
-+#endif
-+
- static struct filedescr *
- find_module(char *fullname, char *subname, PyObject *path, char *buf,
- 	    size_t buflen, FILE **p_fp, PyObject **p_loader)
-@@ -1164,11 +1215,10 @@
- 	static struct filedescr fd_builtin = {"", "", C_BUILTIN};
- 	static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
- 	char name[MAXPATHLEN+1];
--#if defined(PYOS_OS2)
- 	size_t saved_len;
- 	size_t saved_namelen;
- 	char *saved_buf = NULL;
--#endif
-+
- 	if (p_loader != NULL)
- 		*p_loader = NULL;
- 
-@@ -1387,15 +1437,19 @@
- 		}
- #endif
- #endif
--#if defined(PYOS_OS2)
-+
- 		/* take a snapshot of the module spec for restoration
- 		 * after the 8 character DLL hackery
- 		 */
- 		saved_buf = strdup(buf);
- 		saved_len = len;
- 		saved_namelen = namelen;
--#endif /* PYOS_OS2 */
-+
- 		for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
-+#ifdef HAVE_STAT
-+                        len += modify_path(fdp, buf, buflen);
-+#endif
-+
- #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
- 			/* OS/2 limits DLLs to 8 character names (w/o
- 			   extension)
-@@ -1436,21 +1490,18 @@
- 					fp = NULL;
- 				}
- 			}
--#if defined(PYOS_OS2)
-+
- 			/* restore the saved snapshot */
- 			strcpy(buf, saved_buf);
- 			len = saved_len;
- 			namelen = saved_namelen;
--#endif
- 		}
--#if defined(PYOS_OS2)
- 		/* don't need/want the module name snapshot anymore */
- 		if (saved_buf)
- 		{
- 			free(saved_buf);
- 			saved_buf = NULL;
- 		}
--#endif
- 		Py_XDECREF(copy);
- 		if (fp != NULL)
- 			break;
---- Python-2.6/Python/importdl.h.isalibs	2002-12-31 11:08:05.000000000 +1300
-+++ Python-2.6/Python/importdl.h	2008-12-02 20:07:11.757304598 +1300
-@@ -31,8 +31,9 @@
- extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
- 					     FILE *);
- 
--/* Max length of module suffix searched for -- accommodates "module.slb" */
--#define MAXSUFFIXSIZE 12
-+/* Max length of module suffix searched for -- accommodates "module.slb"
-+   and "64/" */
-+#define MAXSUFFIXSIZE 15
- 
- #ifdef MS_WINDOWS
- #include <windows.h>
 --- Python-2.6/Makefile.pre.in.isalibs	2008-09-06 10:59:17.000000000 +1200
 +++ Python-2.6/Makefile.pre.in	2008-12-02 20:07:11.758494722 +1300
 @@ -87,18 +87,18 @@
@@ -437,11 +446,3 @@
  
  # Symbols used for using shared libraries
  SO=		@SO@
-@@ -909,6 +909,7 @@
- 
- # Install the include files
- INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-+
- inclinstall:
- 	@for i in $(INCLDIRSTOMAKE); \
- 	do \
--- a/patches/Python26-06-write_compiled_module-atomic.diff	Sat Dec 05 03:52:03 2009 +0000
+++ b/patches/Python26-06-write_compiled_module-atomic.diff	Sat Dec 05 10:44:19 2009 +0000
@@ -1,6 +1,6 @@
---- Python-2.6.2/Python/import.c.atomic	2009-08-24 14:11:50.131956433 +1200
-+++ Python-2.6.2/Python/import.c	2009-08-24 14:19:04.832835328 +1200
-@@ -871,8 +871,9 @@
+--- Python-2.6.4/Python/import.c.import	2009-12-02 14:16:47.286400577 +1300
++++ Python-2.6.4/Python/import.c	2009-12-02 14:26:08.955429879 +1300
+@@ -866,8 +866,9 @@
  
  /* Write a compiled module to a file, placing the time of last
     modification of its source into the header.
@@ -12,16 +12,16 @@
  
  static void
  write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
-@@ -880,12 +881,21 @@
- 	FILE *fp;
- 	time_t mtime = srcstat->st_mtime;
- 	mode_t mode = srcstat->st_mode;
+@@ -879,12 +880,21 @@
+ #else
+ 	mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+ #endif 
 +	char *tmppathname;
-+
++ 
 +	/* the temporary file is called cpathname + ".tmp" */
-+	  if ((tmppathname = PyMem_Malloc(strlen(cpathname) + strlen(".tmp") + 1))
-+	    == NULL) {
-+	  return;
++	if ((tmppathname = PyMem_Malloc(strlen(cpathname) + strlen(".tmp") + 1))
++		== NULL) {
++		return;
 +	}
 +	sprintf (tmppathname, "%s.tmp", cpathname);
 +	fp = open_exclusive(tmppathname, mode);
@@ -36,7 +36,7 @@
  		return;
  	}
  	PyMarshal_WriteLongToFile(pyc_magic, fp, Py_MARSHAL_VERSION);
-@@ -894,10 +904,11 @@
+@@ -893,10 +903,11 @@
  	PyMarshal_WriteObjectToFile((PyObject *)co, fp, Py_MARSHAL_VERSION);
  	if (fflush(fp) != 0 || ferror(fp)) {
  		if (Py_VerboseFlag)
@@ -50,7 +50,7 @@
  		return;
  	}
  	/* Now write the true mtime */
-@@ -906,8 +917,30 @@
+@@ -905,8 +916,30 @@
  	PyMarshal_WriteLongToFile((long)mtime, fp, Py_MARSHAL_VERSION);
  	fflush(fp);
  	fclose(fp);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python26-18-readline.diff	Sat Dec 05 10:44:19 2009 +0000
@@ -0,0 +1,30 @@
+--- Python-2.6.2/setup.py.readline	2009-12-02 01:06:23.106365511 +1300
++++ Python-2.6.2/setup.py	2009-12-02 14:10:21.572167660 +1300
+@@ -572,6 +572,14 @@
+                 # This way a staticly linked custom readline gets picked up
+                 # before the (broken) dynamic library in /usr/lib.
+                 readline_extra_link_args = ('-Wl,-search_paths_first',)
++            elif sys.platform == 'sunos5':
++                if sys.maxint != 9223372036854775807L:
++                    readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib,-R/usr/gnu/lib,-lreadline,-lncurses',)
++                else:
++                    if os.path.exists('/usr/gnu/lib/sparcv9'):
++                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/sparcv9,-R/usr/gnu/lib/sparcv9,-lreadline,-lncurses',)
++                    else:
++                        readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/amd64,-R/usr/gnu/lib/amd64,-lreadline,-lncurses',)
+             else:
+                 readline_extra_link_args = ()
+ 
+@@ -588,6 +596,12 @@
+                                                ['/usr/lib/termcap'],
+                                                'termcap'):
+                 readline_libs.append('termcap')
++
++            if sys.platform == 'sunos5':
++                # ugly hack to make the build respect -zrecord set in
++                # readline_extra_link_args above
++                readline_libs = []
++
+             exts.append( Extension('readline', ['readline.c'],
+                                    library_dirs=['/usr/lib/termcap'],
+                                    extra_link_args=readline_extra_link_args,