2008-08-27 Laszlo (Laca) Peter <[email protected]>
authorlaca
Wed, 27 Aug 2008 05:51:36 +0000
changeset 13290 93b9e959e744
parent 13289 73fe5dbb792e
child 13291 3229b4d35efa
2008-08-27 Laszlo (Laca) Peter <[email protected]> * SUNWPython25.spec: (new) spec file for Python 2.5.2 - PSARC/2008/543 * SUNWlibffi.spec: (new) spec file for libffi - PSARC/2008/542 * base-specs/libffi.spec: (new) base spec for libffi * copyright/SUNWPython25.copyright: (new) license/copyright file for Python 2.5.2 * copyright/SUNWlibffi.copyright: (new) license/copyright file for libffi 3.0.5 * patches/Python25-01-solaris-lib-dirs.diff: (new) Solaris build patch ported from Python 2.4.4 * patches/Python25-02-pycc.diff: (new) identical with Python 2.4.4's pycc.diff patch * patches/Python25-03-distutils-pycc.diff: (new) Python 2.4.4's distutils-pycc patch ported to 2.5.2 * patches/Python25-04-distutils-log.diff: (new) identical with Python 2.4.4's distutils-log.diff * patches/Python25-05-isalibs.diff: (new) Python 2.4.4's isalibs.diff ported to 2.5.2 * patches/Python25-06-write_compiled_module-atomic.diff: (new) Python 2.4.4's write_compiled_module-atomic.diff ported to 2.5.2 * patches/Python25-07-dtrace.diff: (new) dtrace probes patch ported to 2.5.2 * patches/Python25-08-ctypes.diff: (new) build patch for the ctypes module * patches/Python25-09-ucred.diff: (new) ucred module ported from 2.4.4 * patches/Python25-10-gethostname.diff: (new) patch that deletes the duplicate definition of gethostname from pyport.h, fixes 6614467 (Python bug 837046) * patches/libffi-01-__i386__.diff: (new) trivial build patch for libffi
ChangeLog
SUNWPython25.spec
SUNWlibffi.spec
base-specs/libffi.spec
copyright/SUNWPython25.copyright
copyright/SUNWlibffi.copyright
patches/Python25-01-solaris-lib-dirs.diff
patches/Python25-02-pycc.diff
patches/Python25-03-distutils-pycc.diff
patches/Python25-04-distutils-log.diff
patches/Python25-05-isalibs.diff
patches/Python25-06-write_compiled_module-atomic.diff
patches/Python25-07-dtrace.diff
patches/Python25-08-ctypes.diff
patches/Python25-09-ucred.diff
patches/Python25-10-gethostname.diff
patches/libffi-01-__i386__.diff
--- a/ChangeLog	Wed Aug 27 03:21:49 2008 +0000
+++ b/ChangeLog	Wed Aug 27 05:51:36 2008 +0000
@@ -1,3 +1,35 @@
+2008-08-27  Laszlo (Laca) Peter  <[email protected]>
+
+	* SUNWPython25.spec: (new) spec file for Python 2.5.2 - PSARC/2008/543
+	* SUNWlibffi.spec: (new) spec file for libffi - PSARC/2008/542
+	* base-specs/libffi.spec: (new) base spec for libffi
+	* copyright/SUNWPython25.copyright: (new) license/copyright file for
+	  Python 2.5.2
+	* copyright/SUNWlibffi.copyright: (new) license/copyright file for
+	  libffi 3.0.5
+	* patches/Python25-01-solaris-lib-dirs.diff: (new) Solaris build patch
+	  ported from Python 2.4.4
+	* patches/Python25-02-pycc.diff: (new) identical with Python 2.4.4's
+	  pycc.diff patch
+	* patches/Python25-03-distutils-pycc.diff: (new) Python 2.4.4's
+	  distutils-pycc patch ported to 2.5.2
+	* patches/Python25-04-distutils-log.diff: (new) identical with Python
+	  2.4.4's distutils-log.diff
+	* patches/Python25-05-isalibs.diff: (new) Python 2.4.4's isalibs.diff
+	  ported to 2.5.2
+	* patches/Python25-06-write_compiled_module-atomic.diff: (new) Python
+	  2.4.4's write_compiled_module-atomic.diff ported to 2.5.2
+	* patches/Python25-07-dtrace.diff: (new) dtrace probes patch
+	  ported to 2.5.2
+	* patches/Python25-08-ctypes.diff: (new) build patch for the ctypes
+	  module
+	* patches/Python25-09-ucred.diff: (new) ucred module ported from
+	  2.4.4
+	* patches/Python25-10-gethostname.diff: (new) patch that deletes
+	  the duplicate definition of gethostname from pyport.h, fixes
+	  6614467 (Python bug 837046)
+	* patches/libffi-01-__i386__.diff: (new) trivial build patch for libffi
+
 2008-08-27  Wang Xin  <[email protected]>
 
 	Update default fonts for both OpenSolaris and Nevada.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SUNWPython25.spec	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,425 @@
+#
+# spec file for package SUNWPython
+#
+# includes module(s): Python
+#
+# Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Owner:laca
+# Bugdb:https://sourceforge.net/tracker/?func=detail&atid=305470&group_id=5470&aid=
+#
+%include Solaris.inc
+
+Name:                    SUNWPython25
+Summary:                 The Python interpreter, libraries and utilities
+Version:                 2.5.2
+%define majmin           2.5
+SUNW_BaseDir:            %{_basedir}
+SUNW_Copyright:          %{name}.copyright
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+Source:                  http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+# test script for the ucred module implemented in Python-xx-ucred.diff
+Source1:                 ucredtest.py
+# date:2005-10-27 owner:laca type:bug
+# upstreamable
+Patch1:                  Python25-01-solaris-lib-dirs.diff
+# date:2005-10-30 owner:laca type:feature
+Patch2:                  Python25-02-pycc.diff
+# date:2006-09-18 owner:laca type:feature
+Patch3:                  Python25-03-distutils-pycc.diff
+# date:2006-09-18 owner:laca type:bug
+# upstreamable
+Patch4:                  Python25-04-distutils-log.diff
+# date:2006-09-18 owner:laca type:feature
+# maybe upstreamable
+Patch5:                  Python25-05-isalibs.diff
+# date:2006-09-18 owner:laca type:bug bugster:6463378
+# maybe upstreamable
+Patch6:                  Python25-06-write_compiled_module-atomic.diff
+# date:2007-03-23 owner:laca type:feature
+# written by John.Levon ported to 2.5 by Peter C Norton
+Patch7:                  Python25-07-dtrace.diff
+# date:2008-05-23 owner:laca type:bug
+# upstreamable
+Patch8:                  Python25-08-ctypes.diff
+# date:2008-04-10 owner:laca type:feature bugster:6686506
+# 2008/243 Python interface to ucred_get(3C)/getpeercred(3C)
+# written by [email protected]
+# maybe upstreamable
+Patch9:                 Python25-09-ucred.diff
+# date:2008-06-06 owner:laca type:bug bugster:6614467 bugid:837046
+Patch10:                Python25-10-gethostname.diff
+
+%include default-depend.inc
+BuildRequires: SUNWTk
+BuildRequires: SUNWTcl
+BuildRequires: SUNWlexpt
+BuildRequires: SUNWsfwhea
+BuildRequires: SUNWopenssl-libraries
+BuildRequires: SUNWopenssl-include
+BuildRequires: SUNWaudh
+BuildRequires: SUNWlibffi-devel
+Requires: SUNWopenssl-libraries
+Requires: SUNWTk
+Requires: SUNWTcl
+Requires: SUNWlexpt
+Requires: SUNWxwplt
+Requires: SUNWbzip
+Requires: SUNWlibmsr
+Requires: SUNWlibms
+Requires: SUNWzlib
+Requires: SUNWsqlite3
+Requires: SUNWlibffi
+
+%package devel
+Summary:                 %{summary} - development files
+%include default-depend.inc
+Requires: %name
+
+%prep
+%setup -q -c -n %name-%version
+cd Python-%{version}
+%patch1 -p1 -b .solaris
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1 -b .isalibs
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+cd ..
+
+echo fixing python binary name/path in python scripts:
+cat > %{_builddir}/%name-%version/is_python_script <<EOF
+#!/bin/sh
+
+head -1 \$1 | egrep -s '^#!.*python$'
+EOF
+chmod +x %{_builddir}/%name-%version/is_python_script
+
+cat > %{_builddir}/%name-%version/set_python_interpreter <<EOF
+#!/bin/bash
+interp=\$1
+fname=\$2
+line1=\$(head -1 \$fname)
+echo "Changing '\$line1' to '\$interp' (\$fname)";
+chmod u+w \$fname
+sed -e "1s,^#!.*,#! \$interp," \$fname > \$fname.update-interp && \
+    cat \$fname.update-interp > \$fname && \
+    rm -f \$fname.update-interp || \
+    echo WARNING: set_python_interpreter failed for \$fname
+EOF
+chmod +x %{_builddir}/%name-%version/set_python_interpreter
+
+find Python-%{version}/Demo \
+     Python-%{version}/Tools \
+     Python-%{version}/Doc \
+     Python-%{version}/Lib \
+     -type f -exec %{_builddir}/%name-%version/is_python_script {} \; \
+     -exec %{_builddir}/%name-%version/set_python_interpreter %{_bindir}/python%{majmin} {} \;
+
+%ifarch sparcv9 amd64
+cp -pr Python-%{version} Python-%{version}-64
+%endif
+
+%build
+cd Python-%{version}
+autoheader
+autoconf
+export DFLAGS=-32
+export CC="$CC -xregs=no%frameptr"
+export CXX="$CXX -xregs=no%frameptr -norunpath -compat=5"
+export CFLAGS="%optflags -D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
+export CPPFLAGS="-D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
+
+./configure --prefix=%{_prefix} \
+  --libdir=%{_libdir} \
+  --mandir=%{_mandir} \
+  --datadir=%{_datadir} \
+  --infodir=%{_datadir}/info \
+  --enable-shared \
+  --with-system-ffi \
+  --disable-static %{?_with_pydebug}
+
+# These #define's break the build with gcc and cause problems when
+# building c99 compliant python modules
+perl -pi -e 's/^(#define _POSIX_C_SOURCE.*)/\/* $1 *\//' pyconfig.h
+perl -pi -e 's/^(#define _XOPEN_SOURCE.*)/\/* $1 *\//' pyconfig.h
+perl -pi -e 's/^(#define _XOPEN_SOURCE_EXTENDED.*)/\/* $1 *\//' pyconfig.h
+
+make
+cd ..
+
+%ifarch sparcv9 amd64
+cd Python-%{version}-64
+
+export CXXFLAGS="%cxx_optflags64"
+export CFLAGS="%optflags64 -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
+export CPPFLAGS="-D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
+export CC="$CC -m64 -xstrconst -m64 -Kpic -xregs=no%frameptr"
+export CXX="$CXX -m64 -xregs=no%frameptr -norunpath -compat=5"
+export DFLAGS=-64
+
+autoheader
+autoconf
+./configure --prefix=%{_prefix} \
+  --libdir=%{_libdir}/%{_arch64} \
+  --mandir=%{_mandir} \
+  --datadir=%{_datadir} \
+  --infodir=%{_datadir}/info \
+  --enable-shared \
+  --with-system-ffi \
+  --disable-static %{?_with_pydebug}
+
+# These #define's break the build with gcc and cause problems when
+# building c99 compliant python modules
+perl -pi -e 's/^(#define _POSIX_C_SOURCE.*)/\/* $1 *\//' pyconfig.h
+perl -pi -e 's/^(#define _XOPEN_SOURCE.*)/\/* $1 *\//' pyconfig.h
+perl -pi -e 's/^(#define _XOPEN_SOURCE_EXTENDED.*)/\/* $1 *\//' pyconfig.h
+
+make
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%ifarch sparcv9 amd64
+cd Python-%{version}-64
+make install DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir}/%{_arch64}
+rm -f $RPM_BUILD_ROOT%{_bindir}/%{_arch64}/idle
+rm -f $RPM_BUILD_ROOT%{_bindir}/%{_arch64}/pydoc
+rm -f $RPM_BUILD_ROOT%{_bindir}/%{_arch64}/smtpd.py
+cd ..
+%endif
+
+cd Python-%{version}
+make install DESTDIR=$RPM_BUILD_ROOT
+
+# FIXME: delete while 2.5 is not the default:
+rm $RPM_BUILD_ROOT%{_bindir}/smtpd.py
+#mkdir -p $RPM_BUILD_ROOT%{_prefix}/demo/python
+#mv $RPM_BUILD_ROOT%{_bindir}/smtpd.py $RPM_BUILD_ROOT%{_prefix}/demo/python/
+
+# FIXME: rename temporarily while 2.5 is not the default:
+mv $RPM_BUILD_ROOT%{_mandir}/man1/python.1 $RPM_BUILD_ROOT%{_mandir}/man1/python2.5.1
+
+# the pycc script is a C/C++ compiler wrapper to be used in
+# the distutils Makefile
+install -m 755 -D pycc $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/pycc
+(cd $RPM_BUILD_ROOT%{_libdir}/python%{majmin}; ln -s pycc pyCC)
+perl -pi -e 's|^(CC=\s*)/.*$|$1%{_libdir}/python%{majmin}/pycc|' \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e 's|^(CXX=\s*)/.*$|$1%{_libdir}/python%{majmin}/pyCC|' \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e 's|^(INSTALL=\s*)/.*$|$1install|' \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e 's|^(OPT=\s*).*$|$1-DNDEBUG|' \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e 's|^(RUNSHARED=\s*).*$|$1|' \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CC=)[^']*('.*)\$|\$1%{_libdir}/python%{majmin}/pycc\$2|" \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CFLAGS=)[^']*('.*)\$|\$1\$2|" \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CPP=)[^']*('.*)\$|\$1%{_libdir}/python%{majmin}/pycc -E\$2|" \
+    $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/config/Makefile
+
+# search for vendor packages in /usr/lib/python<version>/vendor-packages
+echo "import site; site.addsitedir('%{_libdir}/python%{majmin}/vendor-packages')" \
+    > $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/site-packages/vendor-packages.pth
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/vendor-packages
+
+# delete stuff that doesn't build/work on Solaris:
+rm $RPM_BUILD_ROOT%{_libdir}/python?.?/config/lib*.a
+rm -r $RPM_BUILD_ROOT%{_libdir}/python?.?/bsddb
+
+echo deleting pyo files
+find $RPM_BUILD_ROOT -name '*.pyo' -exec rm {} \;
+
+install -m 755 %SOURCE1 $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/test/
+
+# FIXME: because python 2.5 is not the default
+rm $RPM_BUILD_ROOT%{_bindir}/idle
+rm $RPM_BUILD_ROOT%{_bindir}/pydoc
+
+cd $RPM_BUILD_ROOT%{_bindir}
+rm python
+
+mkdir -p %{base_isa}
+mv python%{majmin} %{base_isa}/isapython%{majmin}
+ln -s %{base_isa}/isapython%{majmin} python%{majmin}
+
+%ifarch amd64 sparcv9
+cd %{_arch64}
+mv python%{majmin} isapython%{majmin}
+ln -s isapython%{majmin} python%{majmin}
+cd ..
+%endif
+
+ln -s ../lib/isaexec isapython%{majmin}
+# FIXME: because python 2.5 is not the default
+# 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}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/python%{majmin}
+%hard %{_bindir}/isapython%{majmin}
+%dir %attr (0755, root, bin) %{_bindir}/%{base_isa}
+%{_bindir}/%{base_isa}/isapython%{majmin}
+# FIXME
+#%{_prefix}/demo/python/smtpd.py
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/python?.?/LICENSE.txt
+%{_libdir}/python?.?/*.py*
+%{_libdir}/python?.?/*.doc
+%{_libdir}/python?.?/compiler
+%{_libdir}/python?.?/email
+%{_libdir}/python?.?/encodings
+%{_libdir}/python?.?/hotshot
+%{_libdir}/python?.?/idlelib
+%{_libdir}/python?.?/lib-dynload
+%{_libdir}/python?.?/lib-tk
+%{_libdir}/python?.?/logging
+%{_libdir}/python?.?/plat-*
+%{_libdir}/python?.?/site-packages
+%{_libdir}/python?.?/vendor-packages
+%{_libdir}/python?.?/xml
+%{_libdir}/python?.?/curses
+%{_libdir}/python?.?/sqlite3
+%{_libdir}/python?.?/wsgiref
+%{_libdir}/python?.?/wsgiref.egg-info
+%{_libdir}/python?.?/ctypes
+%{_libdir}/lib*.so*
+%ifarch sparcv9 amd64
+%dir %attr(0755, root, bin) %{_libdir}/%{_arch64}
+%{_libdir}/%{_arch64}/lib*.so*
+%dir %attr(0755, root, bin) %{_bindir}/%{_arch64}
+%{_bindir}/%{_arch64}/*
+%endif
+%dir %attr(0755, root, sys) %{_datadir}
+%dir %attr(0755, root, bin) %{_mandir}
+%dir %attr(0755, root, bin) %{_mandir}/*
+%{_mandir}/*/*
+
+%files devel
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/python*-config
+%dir %attr (0755, root, bin) %{_includedir}
+%{_includedir}/*
+%{_libdir}/python?.?/config
+%{_libdir}/python?.?/distutils
+%{_libdir}/python?.?/test
+%{_libdir}/python?.?/py[cC][cC]
+
+%changelog
+* Mon Aug 18 2008 - [email protected]
+- port remaining patches from 2.4
+* Wed Aug  8 2007 - [email protected]
+- add patch shared-expat.diff, fixes 6544688
+* Tue Mar 27 2007 - [email protected]
+- set DFLAGS to fix phelper.d build
+* Wed Mar 23 2007 - [email protected]
+- add patches dtrace.diff and pty-leak.diff
+* Wed Mar 15 2007 - [email protected]
+- Removed CC64. Not needed anymore
+* Mon Feb  5 2007 - [email protected]
+- add --with-pydebug configure option if --with-debug option (of pkgbuild)
+  is used
+* Mon Feb  5 2007 - [email protected]
+- restore some rm lines in %install that were accidentally deleted when
+  I removed Python 2.3
+* Mon Feb  5 2007 - [email protected]
+- Delete bsddb files if SUNWevolution-bdb-devel is not installed.
+* Sun Feb  4 2007 - [email protected]
+- remove python 2.3 as per PSARC/2006/666
+- define bsddb subpkg which gets built if SUNWevolution-bdb-devel is
+  installed
+* Tue Dec 05 2006 - [email protected]
+- Remove "-j$CPUS" from 'make' calls to fix (parallel) build errors.
+* Sat Nov  4 2006 - [email protected]
+- bump to 2.4.4.  (also fixes 6483597)
+- add the curses module to %files
+* Tue Oct  3 2006 - [email protected]
+- add patch Python-06-write_compiled_module-atomic.diff, fixes 6463378
+- make the patches not create .patch<n> backup files because some of them
+  ended up in the packages
+- fix the path to the python interpreter in the .py files before they
+  are compiled, fixes 6469243;
+* Mon Sep 18 2006 - [email protected]
+- 64-bit python changes
+- Python-01-solaris-lib-dirs.diff: (update) merge for 2.4.3 and fix ssl
+  libdir part so that it uses a 64-bit libdir when built in 64-bit mode
+- Python-02-pycc.diff: (update) reset IFS correctly; use = not ==;
+  add some hacks at the bottom to use the right gcc options, so 64-bit
+  can build
+- Python-03-distutils-pycc.diff: force using pycc/pyCC so that CC/CXX
+  CFLAGS/LDFLAGS are picked up from the environment
+- Python-04-distutils-log.diff: fix log.info commands so that they work
+  when the '%' char appears in a compiler flags
+- Python-05-isalibs.diff: (new) make .so's be generated as foo.so,
+  64/foo.so; some really nasty fixes to pyconfig.h: we cannot use the
+  compile-time version of SIZEOF, so we hack them in using _LP64.
+  We use PY_CHECK_SIZEOF to avoid autoconf automatically adding them
+  to pyconfig.h; in the Makefile, make python obey libdir for libpython,
+  but still put the generic stuff in /usr/lib/python2.4
+  (not /usr/lib/amd64/python2.4...)
+* Fri Jul 21 2006 - [email protected]
+- Bump to 2.4.3.
+* Tue Jun 20 2006 - [email protected]
+- Add BuildRequires of the openssl libraries package (already a 'Requires').
+* Tue May 09 2006 - [email protected]
+- merge -share pkg(s) into the base pkg(s)
+* Sun Oct 30 2005 - [email protected]
+- change interpreter in python scripts to full path to the appropriate
+  version (/usr/bin/python2.4 or /usr/sfw/bin/python2.3), fixes 6318475
+- set the C/C++ compiler in the distutils Makefile to the pycc/pyCC
+  wrapper scripts, fixes 6247860
+* Fri Oct 28 2005 - [email protected]
+- update to 2.4.2
+- build shared libpython and remove the static one, fixes 6199942
+- remove XOPEN/POSIX defines from pyconfig.h: fixes 6240077
+- add missing dependencies, fixes 6318436
+* Tue Sep 27 2005 - [email protected]
+- omit some unnecessary compiler flags
+- remove .pyo files
+- add a pth file to site-packages that tells python to search for modules
+  in the vendor-packages directory too
+- change default permissions to root:bin.
+* Wed Oct 19 2005 - [email protected]
+- Add another missing runtime dependency, SUNWlibmsr, fixes 6208617.
+- Move Pyrex to SUNWPython-extra.spec file.
+* Tue Sep 20 2005 - [email protected]
+- move python 2.4.1 to /usr and keep python 2.3 in /usr/sfw for backcompat
+- omit -xregs=no%frameptr as it breaks the build
+* Fri Aug 26 2005 - [email protected]
+- update to 2.4.1
+* Tue Aug 02 2005 - [email protected]
+- added SUNWsfwhea build dependency needed for expat headers
+* Tue Aug 02 2005 - [email protected]
+- Add SUNWlexpt dependency as the Expat library is required for building.
+* Fri Jul 29 2005 - [email protected]
+- Add missing runtime dependencies, fixes 6208617.
+* Sun Nov 14 2004 - [email protected]
+- add /usr/sfw/lib to RPATH
+* Fri Oct 22 2004 - [email protected]
+- remove bsddb bits (won't work without bsd db itself), fixes 6176600
+* Sat Oct 02 2004 - [email protected]
+- added %pkgbuild_postprocess
+* Sat Sep 18 2004 - [email protected]
+- move to /usr/sfw
+* Tue Jun 22 2004 - [email protected]
+- changed install location to /usr/lib and /usr/bin
+* Fri Mar 05 2005 - [email protected]
+- remove package root def'n
+* Thu Mar 04 2004 - [email protected]
+- initial version added to CVS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SUNWlibffi.spec	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,105 @@
+#
+# spec file for package SUNWlibffi
+#
+# includes module(s): libffi
+#
+# Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Owner: laca
+#
+%include Solaris.inc
+%ifarch amd64 sparcv9
+%include arch64.inc
+%use libffi_64 = libffi.spec
+%endif
+
+%include base.inc
+%use libffi = libffi.spec
+
+Name:                    SUNWlibffi
+Summary:                 %{libffi.summary}
+Version:                 %{libffi.version}
+SUNW_BaseDir:            %{_basedir}
+SUNW_Copyright:          %{name}.copyright
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+Requires: SUNWgccruntime
+
+%package devel
+Summary:                 %{summary} - development files
+SUNW_BaseDir:            %{_basedir}
+%include default-depend.inc
+
+%prep
+rm -rf %name-%version
+mkdir %name-%version
+
+%ifarch amd64 sparcv9
+mkdir %name-%version/%_arch64
+%libffi.prep -d %name-%version/%_arch64
+%endif
+
+mkdir %name-%version/%base_arch
+%libffi.prep -d %name-%version/%base_arch
+
+%build
+%if %cc_is_gcc
+%else
+export CXX="$CXX -norunpath"
+%endif
+
+%ifarch amd64 sparcv9
+%libffi_64.build -d %name-%version/%_arch64
+%endif
+
+%libffi.build -d %name-%version/%base_arch
+
+%install
+%ifarch amd64 sparcv9
+%libffi_64.install -d %name-%version/%_arch64
+%endif
+
+%libffi.install -d %name-%version/%base_arch
+
+rm $RPM_BUILD_ROOT%{_libdir}/lib*.la
+
+%ifarch amd64 sparcv9
+rm $RPM_BUILD_ROOT%{_libdir}/%_arch64/lib*.la
+%endif
+
+# FIXME
+rm -r $RPM_BUILD_ROOT%{_datadir}/info
+
+%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/lib*.so*
+%ifarch sparcv9 amd64
+%{_libdir}/%_arch64/lib*.so*
+%endif
+%dir %attr (0755, root, sys) %{_datadir}
+%dir %attr (0755, root, bin) %{_mandir}
+%{_mandir}/man3/*.3
+
+%files devel
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/libffi-%{libffi.version}
+%dir %attr (0755, root, other) %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/*
+%ifarch sparcv9 amd64
+%{_libdir}/%_arch64/libffi-%{libffi.version}
+%dir %attr (0755, root, other) %{_libdir}/%_arch64/pkgconfig
+%{_libdir}/%_arch64/pkgconfig/*
+%endif
+
+%changelog
+* Fri May 23 2008 - [email protected]
+- create
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base-specs/libffi.spec	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,51 @@
+#
+# spec file for package libffi
+#
+#
+# Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Owner: laca
+#
+Name:         libffi
+Group:        Development/Libraries/C and C++
+Summary:      Foreign Function Interface Library
+Version:      3.0.5
+BuildRoot:    %{_tmppath}/%{name}-%{version}-build
+Source0:      ftp://sources.redhat.com/pub/libffi/libffi-%{version}.tar.gz
+# owner:laca date:2008-03-23 type:bug
+Patch1:       libffi-01-__i386__.diff
+URL:          http://sourceware.org/libffi/
+
+%prep 
+%setup -q
+%patch1 -p1
+
+%build
+export CC="/usr/sfw/bin/gcc -static-libgcc"
+export LD="$CC"
+export CFLAGS="%gcc_optflags"
+export LDFLAGS="%_ldflags"
+
+aclocal-1.9 $ACLOCAL_FLAGS
+automake-1.9 -a -c -f
+autoconf
+./configure 			\
+		--prefix=%{_prefix}	\
+		--libdir=%{_libdir}	\
+		--disable-static
+
+echo '#define FFI_NO_RAW_API 1' >> fficonfig.h
+
+make
+
+%install
+make DESTDIR=${RPM_BUILD_ROOT} install
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+
+%changelog -n libffi
+* Fri Mar 23 2008 - [email protected]
+- initial spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/copyright/SUNWPython25.copyright	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,1156 @@
+Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+Use is subject to license terms.
+
+B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
+===============================================================
+
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+alone or in any derivative version, provided, however, that PSF's
+License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
+2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
+Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee.  This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/wsgiref/headers.py, Python-2.5.2/Lib/encodings/ascii.py, Python-2.5.2/Lib/encodings/utf_16.py:
+
+Much of this module is red-handedly pilfered from email.Message in the stdlib,
+so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
+written by Barry Warsaw.
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_cursesmodule.c:
+
+   Based on prior work by Lance Ellinghaus and Oliver Andrich
+   Version 1.2 of this module: Copyright 1994 by Lance Ellinghouse,
+    Cathedral City, California Republic, United States of America.
+
+   Version 1.5b1, heavily extended for ncurses by Oliver Andrich:
+   Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany.
+
+   Tidied for Python 1.6, and currently maintained by <[email protected]>.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this source file to use, copy, modify, merge, or publish it
+   subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or in any new file that contains a substantial portion of
+   this file.
+
+   THE  AUTHOR  MAKES  NO  REPRESENTATIONS ABOUT  THE  SUITABILITY  OF
+   THE  SOFTWARE FOR  ANY  PURPOSE.  IT IS  PROVIDED  "AS IS"  WITHOUT
+   EXPRESS OR  IMPLIED WARRANTY.  THE AUTHOR DISCLAIMS  ALL WARRANTIES
+   WITH  REGARD TO  THIS  SOFTWARE, INCLUDING  ALL IMPLIED  WARRANTIES
+   OF   MERCHANTABILITY,  FITNESS   FOR  A   PARTICULAR  PURPOSE   AND
+   NON-INFRINGEMENT  OF THIRD  PARTY  RIGHTS. IN  NO  EVENT SHALL  THE
+   AUTHOR  BE LIABLE  TO  YOU  OR ANY  OTHER  PARTY  FOR ANY  SPECIAL,
+   INDIRECT,  OR  CONSEQUENTIAL  DAMAGES  OR  ANY  DAMAGES  WHATSOEVER
+   WHETHER IN AN  ACTION OF CONTRACT, NEGLIGENCE,  STRICT LIABILITY OR
+   ANY OTHER  ACTION ARISING OUT OF  OR IN CONNECTION WITH  THE USE OR
+   PERFORMANCE OF THIS SOFTWARE.
+ 
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/timing.h:
+
+ Copyright (c) 1993 George V. Neville-Neil
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+    must display the following acknowledgement:
+	This product includes software developed by George V. Neville-Neil
+ 4. The name, George Neville-Neil may not be used to endorse or promote 
+    products derived from this software without specific prior 
+    written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_hashopenssl.c:
+
+ Copyright (C) 2005   Gregory P. Smith ([email protected])
+ Licensed to PSF under a Contributor Agreement.
+
+ Derived from a skeleton of shamodule.c containing work performed by:
+
+ Andrew Kuchling ([email protected])
+ Greg Stein ([email protected])
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py, Python-2.5.2/Tools/unicode/listcodecs.py:
+
+(c) Copyright 2005, Marc-Andre Lemburg ([email protected]).
+
+    Licensed to PSF under a Contributor Agreement.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/expat/utf8tab.h:
+ Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
+   See the file COPYING for copying permission.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/PC/os2emx/pythonpm.c:
+
+ Andrew MacIntyre <[email protected]>, August 2001.
+ Released under the terms of the Python 2.1.1 licence - see the LICENCE
+ file in the Python v2.1.1 (or later) source distribution.
+ Copyright assigned to the Python Software Foundation, 2001.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Objects/unicodeobject.c:
+
+Unicode implementation based on original code by Fredrik Lundh,
+modified by Marc-Andre Lemburg <[email protected]> according to the
+Unicode Integration Proposal (see file Misc/unicode.txt).
+
+Major speed upgrades to the method implementations at the Reykjavik
+NeedForSpeed sprint, by Fredrik Lundh and Andrew Dalke.
+
+Copyright (c) Corporation for National Research Initiatives.
+
+--------------------------------------------------------------------
+
+The original string type implementation is:
+
+    Copyright (c) 1999 by Secret Labs AB
+    Copyright (c) 1999 by Fredrik Lundh
+
+By obtaining, using, and/or copying this software and/or its
+associated documentation, you agree that you have read, understood,
+and will comply with the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its
+associated documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appears in all
+copies, and that both that copyright notice and this permission notice
+appear in supporting documentation, and that the name of Secret Labs
+AB or the author not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Tools/scripts/texcheck.py:
+
+   Written by Raymond D. Hettinger <python at rcn.com>
+   Copyright (c) 2003 Python Software Foundation.  All rights reserved.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/expat/pyexpatns.h:
+
+ Copyright (c) 2005-2006 ActiveState Software Inc.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Tools/unicode/gencodec.py:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+(c) Copyright Guido van Rossum, 2000.
+
+Table generation:
+(c) Copyright Marc-Andre Lemburg, 2005.
+    Licensed to PSF under a Contributor Agreement.
+
+--------------------------------------------------------------------
+Python-2.5.2/Modules/zlib/zlib.h:
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  [email protected]          [email protected]
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/zlib/inftrees.h:
+Python-2.5.2/Modules/zlib/minigzip.c:
+Python-2.5.2/Modules/zlib/infback.c, Python-2.5.2/Modules/zlib/inftrees.c:
+Python-2.5.2/Modules/zlib/inflate.c:
+Python-2.5.2/Modules/zlib/crc32.c:
+Python-2.5.2/Modules/zlib/inffast.c:
+Python-2.5.2/Modules/zlib/adler32.c
+
+ Copyright (C) 1995-2005 Mark Adler
+ For conditions of distribution and use, see copyright notice in zlib.h
+ 
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/zlib/deflate.c:
+Python-2.5.2/Modules/zlib/trees.c:
+Python-2.5.2/Modules/zlib/gzio.c:
+Python-2.5.2/Modules/zlib/deflate.h, Python-2.5.2/Modules/zlib/zutil.h:
+, Python-2.5.2/Modules/zlib/compress.c, Python-2.5.2/Modules/zlib/zutil.c, Python-2.5.2/Modules/zlib/zconf.in.h, Python-2.5.2/Modules/zlib/zconf.h, Python-2.5.2/Modules/zlib/example.c, Python-2.5.2/Modules/zlib/uncompr.c:
+
+ Copyright (C) 1995-2005 Jean-loup Gailly.
+ For conditions of distribution and use, see copyright notice in zlib.h
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py, Python-2.5.2/Lib/encodings/utf_16_be.py, Python-2.5.2/Lib/encodings/raw_unicode_escape.py:
+Python-2.5.2/Lib/encodings/__init__.py:
+Python-2.5.2/Lib/encodings/charmap.py, Python-2.5.2/Lib/encodings/unicode_internal.py:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/shamodule.c:
+ SHA module 
+
+ This module provides an interface to NIST's Secure Hash Algorithm 
+
+ See below for information about the original code this module was
+   based upon. Additional work performed by:
+
+   Andrew Kuchling ([email protected])
+   Greg Stein ([email protected])
+
+   Copyright (C) 2005   Gregory P. Smith ([email protected])
+   Licensed to PSF under a Contributor Agreement.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/ossaudiodev.c:
+
+ Originally written by Peter Bosch, March 2000, as linuxaudiodev.
+
+ Renamed to ossaudiodev and rearranged/revised/hacked up
+ by Greg Ward <[email protected]>, November 2002.
+ Mixer interface by Nicholas FitzRoy-Dale <[email protected]>, Dec 2002.
+
+ (c) 2000 Peter Bosch.  All Rights Reserved.
+ (c) 2002 Gregory P. Ward.  All Rights Reserved.
+ (c) 2002 Python Software Foundation.  All Rights Reserved.
+
+ XXX need a license statement
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_sqlite/module.c:
+
+     *
+     * Copyright (C) 2004-2006 Gerhard H�ring <[email protected]>
+     *
+     * This file is part of pysqlite.
+     *
+     * This software is provided 'as-is', without any express or implied
+     * warranty.  In no event will the authors be held liable for any damages
+     * arising from the use of this software.
+     *
+     * Permission is granted to anyone to use this software for any purpose,
+     * including commercial applications, and to alter it and redistribute it
+     * freely, subject to the following restrictions:
+     *
+     * 1. The origin of this software must not be misrepresented; you must not
+     *    claim that you wrote the original software. If you use this software
+     *    in a product, an acknowledgment in the product documentation would be
+     *    appreciated but is not required.
+     * 2. Altered source versions must be plainly marked as such, and must not be
+     *    misrepresented as being the original software.
+     * 3. This notice may not be removed or altered from any source distribution.
+--------------------------------------------------------------------
+
+Python-2.5.2/Mac/Modules/ColorPickermodule.c:
+
+Copyright 1998 by Just van Rossum, Den Haag, The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Just van Rossum not be 
+used in advertising or publicity pertaining to distribution of the 
+software without specific, written prior permission.
+
+JUST VAN ROSSUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 
+EVENT SHALL JUST VAN ROSSUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR 
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/parsermodule.c:
+
+  Copyright 1995-1996 by Fred L. Drake, Jr. and Virginia Polytechnic
+  Institute and State University, Blacksburg, Virginia, USA.
+  Portions copyright 1991-1995 by Stichting Mathematisch Centrum,
+  Amsterdam, The Netherlands.  Copying is permitted under the terms
+  associated with the main Python distribution, with the additional
+  restriction that this additional notice be included and maintained
+  on all distributed copies.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/PC/_subprocess.c:
+
+ Copyright (c) 2004 by Fredrik Lundh <[email protected]>
+ Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com
+ Copyright (c) 2004 by Peter Astrand <[email protected]>
+
+ By obtaining, using, and/or copying this software and/or its
+ associated documentation, you agree that you have read, understood,
+ and will comply with the following terms and conditions:
+
+ Permission to use, copy, modify, and distribute this software and
+ its associated documentation for any purpose and without fee is
+ hereby granted, provided that the above copyright notice appears in
+ all copies, and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of the
+ authors not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
+
+ THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Licensed to PSF under a Contributor Agreement. 
+ See http://www.python.org/2.4/license for licensing details. 
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/expat/winconfig.h, Python-2.5.2/Mac/PythonLauncher/MyDocument.h, Python-2.5.2/Modules/expat/macconfig.h:
+
+* Copyright 2000, Clark Cooper
+* All rights reserved.
+*
+* This is free software. You are permitted to copy, distribute, or modify
+* it under the terms of the MIT/X license (contained in the COPYING file
+* with this distribution.)
+  MyDocument.h
+  PythonLauncher
+
+  Created by Jack Jansen on Fri Jul 19 2002.
+  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+*
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/getnameinfo.c, Python-2.5.2/Modules/getaddrinfo.c, Python-2.5.2/Modules/addrinfo.h:
+ Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the project nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ 
+ GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN GAI_ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/SocketServer.py:
+
+  Copyright (C) 2000  Luke Kenneth Casson Leighton <[email protected]>
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/puremodule.c:
+
+ This module exports the C API to such Pure Software Inc. (tm) (now
+ called Pure Atria Corporation) products as Purify (tm) and Quantify
+ (tm).  Other packages could be added, but I didn't have those products
+ and thus lack the API documentation.
+
+ The actual purify.h and quantify.h files which embody the APIs are
+ copyrighted by Pure Software, Inc. and are only attainable through them.
+ This module assumes you have legally installed licenses of their
+ software.  Contact them on the Web via <http://www.pureatria.com/>
+
+ Author: Barry Warsaw <[email protected]>
+                      <[email protected]>
+ 
+
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/linuxaudiodev.c:
+ 
+ Author          : Peter Bosch
+ Created On      : Thu Mar  2 21:10:33 2000
+ 
+ Unless other notices are present in any part of this file
+ explicitly claiming copyrights for other people and/or 
+ organizations, the contents of this file is fully copyright 
+ (C) 2000 Peter Bosch, all rights reserved.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Doc/tools/html2texi.pl:
+
+ Michael Ernst <[email protected]>
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_localemodule.c:
+
+Copyright (C) 1997, 2002, 2003 Martin von Loewis
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies.
+
+This software comes with no warranty. Use at your own risk.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Objects/setobject.c, Python-2.5.2/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py:
+ set object implementation 
+   Written and maintained by Raymond D. Hettinger <[email protected]>
+   Derived from Lib/sets.py and Objects/dictobject.c.
+
+   Copyright (c) 2003-6 Python Software Foundation.
+   All rights reserved.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_bsddb.c:
+
+  Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
+  and Andrew Kuchling. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+    o Redistributions of source code must retain the above copyright
+      notice, this list of conditions, and the disclaimer that follows.
+
+    o Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions, and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    o Neither the name of Digital Creations nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+  IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL
+  CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+
+ Portions of this module, associated unit tests and build scripts are the
+ result of a contract with The Written Word (http://thewrittenword.com/)
+ Many thanks go out to them for causing me to raise the bar on quality and
+ functionality, resulting in a better bsddb3 package for all of us to use.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/robotparser.py:
+
+    Copyright (C) 2000  Bastian Kleineidam
+
+    You can choose between two licenses when using this package:
+    1) GNU GPLv2
+    2) PSF license for Python 2.2
+
+--------------------------------------------------------------------
+
+Python-2.5.2/PC/os2vacpp/config.c, Python-2.5.2/Modules/config.c:
+
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_codecsmodule.c:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+Copyright (c) Corporation for National Research Initiatives.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_sre.c:
+
+ Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
+
+ This version of the SRE library can be redistributed under CNRI's
+ Python 1.6 license.  For any other use, please contact Secret Labs
+ AB ([email protected]).
+
+ Portions of this engine have been developed in cooperation with
+ CNRI.  Hewlett-Packard provided funding for 1.6 integration and
+ other compatibility work.
+ 
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/sha512module.c, Python-2.5.2/Modules/sha256module.c:
+ SHA512 module 
+
+ See below for information about the original code this module was
+   based upon. Additional work performed by:
+
+   Andrew Kuchling ([email protected])
+   Greg Stein ([email protected])
+   Trevor Perrin ([email protected])
+
+   Copyright (C) 2005   Gregory P. Smith ([email protected])
+   Licensed to PSF under a Contributor Agreement.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/syslogmodule.c:
+
+Copyright 1994 by Lance Ellinghouse,
+Cathedral City, California Republic, United States of America.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of Lance Ellinghouse
+not be used in advertising or publicity pertaining to distribution 
+of the software without specific, written prior permission.
+
+LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL, 
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/cookielib.py:
+
+This module has (now fairly distant) origins in Gisle Aas' Perl module
+HTTP::Cookies, from the libwww-perl library.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Mac/Modules/cg/CFMLateImport.h, Python-2.5.2/Mac/Modules/cg/CFMLateImport.c:
+
+	Written by:	Quinn
+
+	Copyright:	Copyright � 1999 by Apple Computer, Inc., all rights reserved.
+	You may incorporate this Apple sample source code into your program(s) without
+	restriction. This Apple sample source code has been provided "AS IS" and the
+	responsibility for its operation is yours. You are not permitted to redistribute
+	this Apple sample source code as "Apple sample source code" after having made
+	changes. If you're going to re-distribute the source, we require that you make
+	it clear in the source that the code was descended from Apple sample source
+	code, but that you've made changes.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/encodings/mac_latin2.py, Python-2.5.2/Python/getcopyright.c, Python-2.5.2/Lib/encodings/latin_1.py, Python-2.5.2/Lib/encodings/utf_8.py, Python-2.5.2/Lib/encodings/ptcp154.py:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+(c) Copyright 2000 Guido van Rossum.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Doc/tools/prechm.py:
+
+    by [email protected]
+    no copyright and no responsabilities.
+
+    modified by Dale Nagata for Python 1.5.2
+
+    Renamed from make_chm.py to prechm.py, and checked into the Python
+    project, 19-Apr-2002 by Tim Peters.  Assorted modifications by Tim
+    and Fred Drake.  Obtained from Robin Dunn's .chm packaging of the
+    Python 2.2 docs, at <http://alldunn.com/python/>.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_ctypes/darwin/dlfcn_simple.c, Python-2.5.2/Modules/_ctypes/darwin/dlfcn.h:
+
+Copyright (c) 2002 Peter O'Gorman <[email protected]>
+
+Copyright (c) 2002 Jorge Acereda  <[email protected]> &
+                   Peter O'Gorman <[email protected]>
+                   
+Portions may be copyright others, see the AUTHORS file included with this
+distribution.
+
+Maintained by Peter O'Gorman <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/PC/winsound.c:
+
+ Author: Toby Dickenson <[email protected]>
+
+ Copyright (c) 1999 Toby Dickenson
+
+ Permission to use this software in any way is granted without
+ fee, provided that the copyright notice above appears in all
+ copies. This software is provided "as is" without any warranty.
+ 
+
+ Modified by Guido van Rossum 
+ Beep added by Mark Hammond 
+ Win9X Beep and platform identification added by Uncle Timmy 
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Python/codecs.c, Python-2.5.2/Modules/unicodedata.c:
+
+Written by Marc-Andre Lemburg ([email protected]).
+Modified for Python 2.0 by Fredrik Lundh ([email protected])
+Modified by Martin v. L�wis ([email protected])
+
+Copyright (c) Corporation for National Research Initiatives.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/dummy_thread.py, Python-2.5.2/Modules/bz2module.c:
+
+Copyright (c) 2002  Gustavo Niemeyer <[email protected]>
+Copyright (c) 2002  Python Software Foundation; All Rights Reserved
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_elementtree.c:
+
+ Copyright (c) 1999-2006 by Secret Labs AB.  All rights reserved.
+ Copyright (c) 1999-2006 by Fredrik Lundh.
+
+ [email protected]
+ http://www.pythonware.com
+ 
+ Licensed to PSF under a Contributor Agreement. 
+ See http://www.python.org/2.4/license for licensing details. 
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/encodings/mbcs.py, Python-2.5.2/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py:
+
+Cloned by Mark Hammond ([email protected]) from ascii.py,
+which was written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+Suite AppleScript Suite: Standard terms for AppleScript
+Level 1, version 1
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Python/getopt.c:
+
+ Copyright 1992-1994, David Gottner
+
+                    All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and its 
+ documentation for any purpose and without fee is hereby granted, 
+ provided that the above copyright notice, this permission notice and
+ the following disclaimer notice appear unmodified in all copies.
+
+ I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL I
+ BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Nevertheless, I would like to know about bugs in this library or
+ suggestions for improvment.  Send bug reports and feedback to
+ [email protected].
+
+ Modified to support --help and --version, as well as /? on Windows
+ * by Georg Brandl. 
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Objects/sliceobject.c:
+
+Written by Jim Hugunin and Chris Chase.
+
+Guido, feel free to do whatever you want in the way of copyrights
+for this file.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/PC/bdist_wininst/install.c:
+
+ Written by Thomas Heller, May 2000
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_tkinter.c:
+
+Copyright (C) 1994 Steen Lumholt.
+
+                        All Rights Reserved
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/expat/latin1tab.h:
+Python-2.5.2/Modules/expat/asciitab.h, Python-2.5.2/Modules/expat/iasciitab.h:
+
+ Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
+   See the file COPYING for copying permission.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/optparse.py:
+
+By Greg Ward <[email protected]>
+
+Originally distributed as Optik; see http://optik.sourceforge.net/ .
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/ucred.c:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal in the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ Use is subject to license terms.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Required.py, Python-2.5.2/Mac/PythonLauncher/FileSettings.h, Python-2.5.2/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py, Python-2.5.2/Lib/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py:
+
+  Created by Jack Jansen on Sun Jul 21 2002.
+  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/RISCOS/Python/dynload_riscos.c, Python-2.5.2/Mac/Modules/icgluemodule.c, Python-2.5.2/Mac/Modules/MacOS.c, Python-2.5.2/Mac/Modules/gestaltmodule.c, Python-2.5.2/PC/os2emx/config.c, Python-2.5.2/PC/os2emx/dlfcn.h, Python-2.5.2/PC/os2emx/dlfcn.c, Python-2.5.2/Mac/Modules/snd/_Sndihooks.c, Python-2.5.2/Mac/Modules/Nav.c, Python-2.5.2/RISCOS/Modules/config.c, Python-2.5.2/Python/mactoolboxglue.c:
+**********************************************************
+Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
+The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Stichting Mathematisch
+Centrum or CWI or Corporation for National Research Initiatives or
+CNRI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+While CWI is the initial source for this software, a modified version
+is made available by the Corporation for National Research Initiatives
+(CNRI) at the Internet address ftp://ftp.python.org.
+
+STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
+CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior permission.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/expat/expat_config.h, Python-2.5.2/Objects/unicodectype.c:
+ 
+   Written by Marc-Andre Lemburg ([email protected]).
+   Modified for Python 2.0 by Fredrik Lundh ([email protected])
+
+   Copyright (c) Corporation for National Research Initiatives.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_randommodule.c:
+
+   The code in this module was based on a download from:
+	  http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html
+
+   It was modified in 2002 by Raymond Hettinger as follows:
+
+	* the principal computational lines untouched except for tabbing.
+
+	* renamed genrand_res53() to random_random() and wrapped
+	  in python calling/return code.
+
+	* genrand_int32() and the helper functions, init_genrand()
+	  and init_by_array(), were declared static, wrapped in
+	  Python calling/return code.  also, their global data
+	  references were replaced with structure references.
+
+	* unused functions from the original were deleted.
+	  new, original C python code was added to implement the
+	  Random() interface.
+
+   The following are the verbatim comments from the original code:
+
+   A C-program for MT19937, with initialization improved 2002/1/26.
+   Coded by Takuji Nishimura and Makoto Matsumoto.
+
+   Before using, initialize the state by using init_genrand(seed)
+   or init_by_array(init_key, key_length).
+
+   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+     1. Redistributions of source code must retain the above copyright
+	notice, this list of conditions and the following disclaimer.
+
+     2. Redistributions in binary form must reproduce the above copyright
+	notice, this list of conditions and the following disclaimer in the
+	documentation and/or other materials provided with the distribution.
+
+     3. The names of its contributors may not be used to endorse or promote
+	products derived from this software without specific prior written
+	permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/sre.h, Python-2.5.2/Lib/shutil.py, Python-2.5.2/Modules/sre_constants.h:
+
+ Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
+
+ See the _sre.c file for information on usage and redistribution.
+ 
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/test/testcodec.py, Python-2.5.2/Lib/test/test_charmapcodec.py:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright 2000 Guido van Rossum.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/test/test_ucn.py, Python-2.5.2/Lib/codecs.py, Python-2.5.2/Lib/test/test_unicodedata.py:
+
+Written by Bill Tutt.
+Modified for Python 2.0 by Fredrik Lundh ([email protected])
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_ctypes/libffi:
+
+libffi - Copyright (c) 1996-2003  Red Hat, Inc.
+ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company
+ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2003, 2004 Red Hat, Inc.
+ffi.c - Copyright (c) 2000 Software AG
+ffi.c - Copyright (c) 2002  Bo Thorsen <[email protected]>
+ffi.c - Copyright (c) 1998 Geoffrey Keating
+ffi.c - Copyright (c) 2004  Renesas Technology
+ffi.c - Copyright (c) 1998 Cygnus Solutions
+        Copyright (c) 2004 Simon Posnjak
+	Copyright (c) 2005 Axis Communications AB
+        Copyright (c) 2002  Ranjit Mathew
+        Copyright (c) 2002  Roger Sayle
+ffi.c - Copyright (c) 2004  Anthony Green
+	Copyright (c) 2000 Hewlett Packard Company
+ffi.c - Copyright (c) 2002, 2003, 2004, 2005 Kaz Kojima
+asm.h - Copyright (c) 1998 Geoffrey Keating
+ffitarget.h - Copyright (c) 1996-2004  Red Hat, Inc.
+ffitarget.h - Copyright (c) 2004  Renesas Technology.
+ffitarget.h - Copyright (c) 1996-2003  Red Hat, Inc.
+ffi_common.h - Copyright (c) 1996  Red Hat, Inc.
+prep_cif.c - Copyright (c) 1996, 1998  Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Mac/PythonLauncher/doscript.h, Python-2.5.2/Tools/bgen/bgen/macsupport.py:
+
+  Created by Jack Jansen on Wed Jul 31 2002.
+  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Lib/encodings/undefined.py, Python-2.5.2/Lib/encodings/utf_16_le.py, Python-2.5.2/Lib/encodings/unicode_escape.py:
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/fpetestmodule.c, Python-2.5.2/Modules/fpectlmodule.c:
+
+     ---------------------------------------------------------------------  
+    /                       Copyright (c) 1996.                           \ 
+   |          The Regents of the University of California.                 |
+   |                        All rights reserved.                           |
+   |                                                                       |
+   |   Permission to use, copy, modify, and distribute this software for   |
+   |   any purpose without fee is hereby granted, provided that this en-   |
+   |   tire notice is included in all copies of any software which is or   |
+   |   includes  a  copy  or  modification  of  this software and in all   |
+   |   copies of the supporting documentation for such software.           |
+   |                                                                       |
+   |   This  work was produced at the University of California, Lawrence   |
+   |   Livermore National Laboratory under  contract  no.  W-7405-ENG-48   |
+   |   between  the  U.S.  Department  of  Energy and The Regents of the   |
+   |   University of California for the operation of UC LLNL.              |
+   |                                                                       |
+   |                              DISCLAIMER                               |
+   |                                                                       |
+   |   This  software was prepared as an account of work sponsored by an   |
+   |   agency of the United States Government. Neither the United States   |
+   |   Government  nor the University of California nor any of their em-   |
+   |   ployees, makes any warranty, express or implied, or  assumes  any   |
+   |   liability  or  responsibility  for the accuracy, completeness, or   |
+   |   usefulness of any information,  apparatus,  product,  or  process   |
+   |   disclosed,   or  represents  that  its  use  would  not  infringe   |
+   |   privately-owned rights. Reference herein to any specific  commer-   |
+   |   cial  products,  process,  or  service  by trade name, trademark,   |
+   |   manufacturer, or otherwise, does not  necessarily  constitute  or   |
+   |   imply  its endorsement, recommendation, or favoring by the United   |
+   |   States Government or the University of California. The views  and   |
+   |   opinions  of authors expressed herein do not necessarily state or   |
+   |   reflect those of the United States Government or  the  University   |
+   |   of  California,  and shall not be used for advertising or product   |
+    \  endorsement purposes.                                              / 
+     ---------------------------------------------------------------------  
+
+--------------------------------------------------------------------
+
+Python-2.5.2/Modules/_sqlite/prepare_protocol.h, Python-2.5.2/Modules/_sqlite/cursor.h, Python-2.5.2/Modules/_sqlite/microprotocols.c, Python-2.5.2/Modules/_sqlite/cache.h, Python-2.5.2/Modules/_sqlite/cursor.c, Python-2.5.2/Modules/_sqlite/statement.c, Python-2.5.2/Modules/_sqlite/module.h, Python-2.5.2/Modules/_sqlite/sqlitecompat.h, Python-2.5.2/Modules/md5.h, Python-2.5.2/Modules/_sqlite/connection.h, Python-2.5.2/Modules/_sqlite/microprotocols.h, Python-2.5.2/Modules/_sqlite/connection.c, Python-2.5.2/Modules/_sqlite/row.c, Python-2.5.2/Modules/_sqlite/row.h, Python-2.5.2/Modules/_sqlite/cache.c, Python-2.5.2/Modules/_sqlite/prepare_protocol.c, Python-2.5.2/Modules/md5.c, Python-2.5.2/Modules/_sqlite/util.c, Python-2.5.2/Modules/_sqlite/statement.h, Python-2.5.2/Modules/_sqlite/util.h:
+
+ Copyright (C) 2004-2006 Gerhard H�ring <[email protected]>
+ Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
+ Copyright (C) 2003-2004 Federico Di Gregorio <[email protected]>
+
+ This software is provided 'as-is', without any express or implied
+ warranty.  In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+    misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+ 
+--------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/copyright/SUNWlibffi.copyright	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,21 @@
+libffi - Copyright (c) 1996-2008  Red Hat, Inc and others.  
+See source files for details.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-01-solaris-lib-dirs.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,106 @@
+--- Python-2.5.1/setup.py.solaris	2007-02-14 07:53:41.000000000 -0500
++++ Python-2.5.1/setup.py	2007-08-08 23:58:54.294398000 -0400
+@@ -243,10 +243,10 @@
+         return sys.platform
+ 
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used
+-        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+-
++        if sys.platform != 'sunos5':
++            # Ensure that /usr/local is always used
++            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
+         # We must get the values from the Makefile and not the environment
+@@ -516,11 +516,22 @@
+         exts.append( Extension('_csv', ['_csv.c']) )
+ 
+         # socket(2)
++        socket_libs = []
++        if self.compiler.find_library_file(lib_dirs,
++                                           'socket'):
++            socket_libs.append('socket')
++        if self.compiler.find_library_file(lib_dirs,
++                                           'nsl'):
++            socket_libs.append('nsl')
++        if self.compiler.find_library_file(lib_dirs,
++                                           'resolv'):
++            socket_libs.append('resolv')
+         exts.append( Extension('_socket', ['socketmodule.c'],
+-                               depends = ['socketmodule.h']) )
++                               depends = ['socketmodule.h'],
++                               libraries = socket_libs) )
+         # Detect SSL support for the socket module (via _ssl)
+         search_for_ssl_incs_in = [
+-                              '/usr/local/ssl/include',
++                              '/usr/sfw/include',
+                               '/usr/contrib/ssl/include/'
+                              ]
+         ssl_incs = find_file('openssl/ssl.h', inc_dirs,
+@@ -531,8 +542,12 @@
+                                ['/usr/kerberos/include'])
+             if krb5_h:
+                 ssl_incs += krb5_h
++        if sys.maxint == 2147483647L:
++            sfw_libdir = '/usr/sfw/lib';
++        else:
++            sfw_libdir = '/usr/sfw/lib/64';
+         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+-                                     ['/usr/local/ssl/lib',
++                                     [sfw_libdir,
+                                       '/usr/contrib/ssl/lib/'
+                                      ] )
+ 
+@@ -541,6 +556,7 @@
+             exts.append( Extension('_ssl', ['_ssl.c'],
+                                    include_dirs = ssl_incs,
+                                    library_dirs = ssl_libs,
++                                   runtime_library_dirs = ssl_libs,
+                                    libraries = ['ssl', 'crypto'],
+                                    depends = ['socketmodule.h']), )
+ 
+@@ -1203,12 +1219,23 @@
+         # Assume we haven't found any of the libraries or include files
+         # The versions with dots are used on Unix, and the versions without
+         # dots on Windows, for detection by cygwin.
++        added_lib_dirs = []
++        tcl_tk_lib_dirs = ['/usr/sfw/lib']
++        tcl_tk_inc_dirs = ['/usr/sfw/include']
+         tcllib = tklib = tcl_includes = tk_includes = None
+         for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
+                         '82', '8.1', '81', '8.0', '80']:
+-            tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
+-            tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
++            tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
++            tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
++            if tklib and tcllib:
++                # Exit the loop when we've found the Tcl/Tk libraries
++                break
++
++            tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
++            tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
+             if tklib and tcllib:
++                # found the libs in a non-standard dir
++                added_lib_dirs.append(os.path.dirname(tcllib))
+                 # Exit the loop when we've found the Tcl/Tk libraries
+                 break
+ 
+@@ -1226,6 +1253,7 @@
+             for dir in inc_dirs:
+                 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+                 tk_include_sub += [dir + os.sep + "tk" + dotversion]
++            tcl_include_sub += tcl_tk_inc_dirs
+             tk_include_sub += tcl_include_sub
+             tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
+             tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
+@@ -1290,6 +1318,7 @@
+                         include_dirs = include_dirs,
+                         libraries = libs,
+                         library_dirs = added_lib_dirs,
++                        runtime_library_dirs = added_lib_dirs
+                         )
+         self.extensions.append(ext)
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-02-pycc.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,175 @@
+--- /dev/null	2007-01-09 14:33:27.000000000 -0500
++++ Python-2.4.4-new/pycc	2007-01-09 14:34:30.248866916 -0500
+@@ -0,0 +1,172 @@
++#!/bin/ksh
++#
++# Script for running the C/C++ compiler when building python modules
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms of the
++# Common Development and Distribution License, Version 1.0 only
++# (the "License").  You may not use this file except in compliance
++# with the License.
++#
++# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing permissions
++# and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL HEADER in each
++# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++# If applicable, add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your own identifying
++# information: Portions Copyright [yyyy] [name of copyright owner]
++#
++# CDDL HEADER END
++#
++#
++# Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
++# Use is subject to license terms.
++#
++
++MYNAME=`basename $0`
++
++# name of the compiler executable
++CCEXE='cc'
++# name of the GNU compiler executable
++GCCEXE='gcc'
++# name of the programming language
++CLANG='C'
++# name of the env variable for setting the compiler path
++CVAR='CC'
++
++if [ "x$PYCC_CC" != x ]; then
++    CC="$PYCC_CC"
++fi
++
++if [ "x$MYNAME" = xpyCC ]; then
++    CCEXE='CC'
++    GCCEXE='g++'
++    CLANG='C++'
++    CC="$CXX"
++    CVAR='CXX'
++    if [ "x$PYCC_CXX" != x ]; then
++        CC="$PYCC_CXX"
++    fi
++fi
++
++SAVED_IFS="$IFS"
++IFS=:
++
++# check if the CC env variable is set
++if [ "x$CC" != x ]; then
++    # verify that it doesn't point to this script
++    if /usr/bin/cmp -s "$CC" $0; then
++        echo "WARNING: "$CVAR" is set to this script; ignoring this value to avoid an infinite loop"
++	CC=
++    fi
++fi
++
++# check again if the CC env variable is set
++if [ "x$CC" != x ]; then
++    case "$CC" in
++	/* )
++	    # $CC is an absolute path name
++            # check if $CC exists
++	    if [ ! -e "$CC" ]; then
++		echo "WARNING: pycc: $CC not found" 1>&2
++		CC=
++	    else
++        # check if $CC is an executable
++		if [ ! -x "$CC" -o ! -f "$CC" ]; then
++		    echo "WARNING: pycc: $CC is not an executable" 1>&2
++		    CC=
++		fi
++	    fi
++	    ;;
++	* )
++	    # try to find $CC in the PATH
++	    NEW_CC=
++	    for dir in $PATH; do
++		if [ -x "$dir/$CC" ]; then
++		    NEW_CC="$dir/$CC"
++		    break
++		fi
++	    done
++	    if [ "x$NEW_CC" = x ]; then
++		echo "WARNING: pycc: $CC not found" 1>&2
++		CC=
++	    else
++		CC="$NEW_CC"
++	    fi
++	    ;;
++    esac
++fi
++
++if [ "x$CC" = x ]; then
++    # Look for the Sun Studio compiler in the PATH
++    for dir in $PATH; do
++	if [ -x "$dir/$CCEXE" ]; then
++	    CC="$dir/$CCEXE"
++	    break
++	fi
++    done
++fi
++
++if [ "x$CC" = x ]; then
++    # Look for gcc in the PATH
++    for dir in $PATH; do
++	if [ -x "$dir/$GCCEXE" ]; then
++	    CC="$dir/$GCCEXE"
++	    break
++	fi
++    done
++fi
++
++if [ "x$CC" = x ]; then
++    # Check for Sun Studio in /opt/SUNWspro (default install location)
++    if [ -x /opt/SUNWspro/bin/$CCEXE ]; then
++	CC=/opt/SUNWspro/bin/$CCEXE
++    fi
++fi
++
++if [ "x$CC" = x ]; then
++    # Check for the GNU compiler in /usr/sfw/bin
++    if [ -x /usr/sfw/bin/$GCCEXE ]; then
++	CC=/usr/sfw/bin/$GCCEXE
++    fi
++fi
++
++if [ "x$CC" = x ]; then
++    # Cannot continue without a C compiler
++    echo "ERROR: no $CLANG compiler not found; update your PATH or set the $CVAR env variable" 1>&2
++    exit 1
++fi
++
++IFS="$SAVED_IFS"
++
++# We need to make some modifications to adapt correctly to compiler options
++# that differ between GCC and Studio.
++
++extra_flags=
++
++is_gcc=no
++
++$CC --version >/dev/null 2>&1 && is_gcc=yes
++
++if [ "$is_gcc" = yes ]; then
++	for flag in "${@}"; do
++		# need -shared to link shared objects properly
++		if [ "$flag" = "-G" ]; then
++			extra_flags="$extra_flags -shared"
++		fi
++		# workaround for 6223255
++		if [ "$flag" = "-m64" ]; then
++			extra_flags="$extra_flags -R/usr/sfw/lib/amd64"
++		fi
++	done
++	# force PIC compilation
++	extra_flags="$extra_flags -fPIC -DPIC"
++else
++	extra_flags="$extra_flags -KPIC"
++fi
++
++exec "$CC" $extra_flags "${@}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-03-distutils-pycc.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,23 @@
+--- Python-2.5.1/Lib/distutils/sysconfig.py.pycc	2006-10-08 13:50:26.000000000 -0400
++++ Python-2.5.1/Lib/distutils/sysconfig.py	2007-08-08 20:47:51.288668000 -0400
+@@ -150,16 +150,10 @@
+             get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
+                             'CCSHARED', 'LDSHARED', 'SO')
+ 
+-        if os.environ.has_key('CC'):
+-            cc = os.environ['CC']
+-        if os.environ.has_key('CXX'):
+-            cxx = os.environ['CXX']
+-        if os.environ.has_key('LDSHARED'):
+-            ldshared = os.environ['LDSHARED']
+-        if os.environ.has_key('CPP'):
+-            cpp = os.environ['CPP']
+-        else:
+-            cpp = cc + " -E"           # not always
++        # On Solaris, we must always use pycc/pyCC, which will then look up
++        # $CC and $CXX
++        cpp = cc + " -E"
++
+         if os.environ.has_key('LDFLAGS'):
+             ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+         if os.environ.has_key('CFLAGS'):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-04-distutils-log.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,29 @@
+--- Python-2.4.2/Lib/distutils/spawn.py	2004-11-10 14:23:14.000000000 -0800
++++ Python-2.4.2-new/Lib/distutils/spawn.py	2006-08-22 08:33:41.430344000 -0700
+@@ -73,7 +73,7 @@
+     if search_path:
+         # either we find one or it stays the same
+         executable = find_executable(executable) or executable
+-    log.info(string.join([executable] + cmd[1:], ' '))
++    log.info("%s", string.join([executable] + cmd[1:], ' '))
+     if not dry_run:
+         # spawn for NT requires a full path to the .exe
+         try:
+@@ -98,7 +98,7 @@
+     if search_path:
+         # either we find one or it stays the same
+         executable = find_executable(executable) or executable
+-    log.info(string.join([executable] + cmd[1:], ' '))
++    log.info("%s", string.join([executable] + cmd[1:], ' '))
+     if not dry_run:
+         # spawnv for OS/2 EMX requires a full path to the .exe
+         try:
+@@ -119,7 +119,7 @@
+                   verbose=0,
+                   dry_run=0):
+ 
+-    log.info(string.join(cmd, ' '))
++    log.info("%s", string.join(cmd, ' '))
+     if dry_run:
+         return
+     exec_fn = search_path and os.execvp or os.execv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-05-isalibs.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,426 @@
+--- Python-2.5.2/Lib/distutils/command/build_ext.py.isalibs	2007-04-25 03:27:25.000000000 +1200
++++ Python-2.5.2/Lib/distutils/command/build_ext.py	2008-03-04 18:16:12.420109858 +1300
+@@ -626,7 +626,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 apply(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.5.2/configure.in.isalibs	2008-02-14 08:17:17.000000000 +1300
++++ Python-2.5.2/configure.in	2008-03-04 18:16:12.612245011 +1300
+@@ -14,8 +14,38 @@
+ AH_TOP([
+ #ifndef Py_PYCONFIG_H
+ #define Py_PYCONFIG_H
++
+ ])
+ AH_BOTTOM([
++
++#include <sys/isa_defs.h>
++
++/*
++ * Python originally defined these statically, which prevents a 32-64 python
++ * from working at all.
++ */
++
++#define SIZEOF_SHORT 2
++#define SIZEOF_INT 4
++#define SIZEOF_LONG_LONG 8
++#define SIZEOF_FPOS_T 8
++#define SIZEOF_OFF_T 8
++#define SIZEOF_PTHREAD_T 4
++
++#ifdef _LP64
++#define SIZEOF_LONG 8
++#define SIZEOF_UINTPTR_T 8
++#define SIZEOF_VOID_P 8
++#define SIZEOF_TIME_T 8
++#define SIZEOF_SIZE_T 8
++#else
++#define SIZEOF_LONG 4
++#define SIZEOF_UINTPTR_T 4
++#define SIZEOF_VOID_P 4
++#define SIZEOF_TIME_T 4
++#define SIZEOF_SIZE_T 4
++#endif
++
+ /* 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 */
+@@ -56,6 +86,26 @@
+ 
+ define_xopen_source=yes
+ 
++# AC_CHECK_SIZEOF without the AC_DEFINE_UNQUOTED
++AC_DEFUN([PY_CHECK_SIZEOF],
++[AS_LITERAL_IF([$1], [],
++               [AC_FATAL([$0: requires literal arguments])])dnl
++AC_CHECK_TYPE([$1], [], [], [$3])
++AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
++[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
++  # The cast to unsigned long works around a bug in the HP C Compiler
++  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++  # This bug is HP SR number 8606223364.
++  _AC_COMPUTE_INT([(long) (sizeof ($1))],
++                  [AS_TR_SH([ac_cv_sizeof_$1])],
++                  [AC_INCLUDES_DEFAULT([$3])],
++                  [AC_MSG_FAILURE([cannot compute sizeof ($1), 77])])
++else
++  AS_TR_SH([ac_cv_sizeof_$1])=0
++fi])dnl
++])# PY_CHECK_SIZEOF
++
+ # Arguments passed to configure.
+ AC_SUBST(CONFIG_ARGS)
+ CONFIG_ARGS="$ac_configure_args"
+@@ -1191,14 +1241,8 @@
+ 
+ # Sizes of various common basic types
+ # ANSI C requires sizeof(char) == 1, so no need to check it
+-AC_CHECK_SIZEOF(int, 4)
+-AC_CHECK_SIZEOF(long, 4)
+-AC_CHECK_SIZEOF(void *, 4)
+-AC_CHECK_SIZEOF(short, 2)
+-AC_CHECK_SIZEOF(float, 4)
+-AC_CHECK_SIZEOF(double, 8)
+-AC_CHECK_SIZEOF(fpos_t, 4)
+-AC_CHECK_SIZEOF(size_t, 4)
++AC_CHECK_SIZEOF(short)
++AC_CHECK_SIZEOF(long)
+ 
+ AC_MSG_CHECKING(for long long support)
+ have_long_long=no
+@@ -1207,107 +1251,28 @@
+   have_long_long=yes
+ ])
+ AC_MSG_RESULT($have_long_long)
+-if test "$have_long_long" = yes ; then
+-AC_CHECK_SIZEOF(long long, 8)
+-fi
+ 
+ AC_CHECK_TYPES(uintptr_t, 
+-   [AC_CHECK_SIZEOF(uintptr_t, 4)], 
++   [], 
+    [], [#ifdef HAVE_STDINT_H
+         #include <stdint.h>
+         #endif])
+ 
+ 
+-# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
+-AC_MSG_CHECKING(size of off_t)
+-AC_CACHE_VAL(ac_cv_sizeof_off_t,
+-[AC_TRY_RUN([#include <stdio.h>
++PY_CHECK_SIZEOF(off_t,4,[
++#include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+-main()
+-{
+-  FILE *f=fopen("conftestval", "w");
+-  if (!f) exit(1);
+-  fprintf(f, "%d\n", sizeof(off_t));
+-  exit(0);
+-}],
+-ac_cv_sizeof_off_t=`cat conftestval`,
+-ac_cv_sizeof_off_t=0,
+-ac_cv_sizeof_off_t=4)
+-])
+-AC_MSG_RESULT($ac_cv_sizeof_off_t)
+-AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
+-[The number of bytes in an off_t.])
+-
+-AC_MSG_CHECKING(whether to enable large file support)
+-if test "$have_long_long" = yes -a \
+-	"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
+-	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
+-  AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, 
+-  [Defined to enable large file support when an off_t is bigger than a long
+-   and long long is available and at least as big as an off_t. You may need
+-   to add some flags for configuration and compilation to enable this mode.
+-   (For Solaris and Linux, the necessary defines are already defined.)])
+-  AC_MSG_RESULT(yes)
+-else
+-  AC_MSG_RESULT(no)
+-fi
+-
+-# AC_CHECK_SIZEOF() doesn't include <time.h>.
+-AC_MSG_CHECKING(size of time_t)
+-AC_CACHE_VAL(ac_cv_sizeof_time_t,
+-[AC_TRY_RUN([#include <stdio.h>
+-#include <time.h>
+-main()
+-{
+-  FILE *f=fopen("conftestval", "w");
+-  if (!f) exit(1);
+-  fprintf(f, "%d\n", sizeof(time_t));
+-  exit(0);
+-}],
+-ac_cv_sizeof_time_t=`cat conftestval`,
+-ac_cv_sizeof_time_t=0,
+-ac_cv_sizeof_time_t=4)
+ ])
+-AC_MSG_RESULT($ac_cv_sizeof_time_t)
+-AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t, 
+-[The number of bytes in a time_t.])
+ 
++AC_MSG_CHECKING(whether to enable large file support)
+ 
+-# if have pthread_t then define SIZEOF_PTHREAD_T
+-ac_save_cc="$CC"
+-if test "$ac_cv_kpthread" = "yes"
+-then CC="$CC -Kpthread"
+-elif test "$ac_cv_kthread" = "yes"
+-then CC="$CC -Kthread"
+-elif test "$ac_cv_pthread" = "yes"
+-then CC="$CC -pthread"
+-fi
+-AC_MSG_CHECKING(for pthread_t)
+-have_pthread_t=no
+-AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
+-AC_MSG_RESULT($have_pthread_t)
+-if test "$have_pthread_t" = yes ; then
+-  # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
+-  AC_MSG_CHECKING(size of pthread_t)
+-  AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
+-  [AC_TRY_RUN([#include <stdio.h>
+-#include <pthread.h>
+-  main()
+-  {
+-    FILE *f=fopen("conftestval", "w");
+-    if (!f) exit(1);
+-    fprintf(f, "%d\n", sizeof(pthread_t));
+-    exit(0);
+-  }],
+-  ac_cv_sizeof_pthread_t=`cat conftestval`,
+-  ac_cv_sizeof_pthread_t=0,
+-  ac_cv_sizeof_pthread_t=4)
+-  ])
+-  AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
+-  AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
+-   [The number of bytes in a pthread_t.])
+-fi
+-CC="$ac_save_cc"
++AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, 
++[Defined to enable large file support when an off_t is bigger than a long
++ and long long is available and at least as big as an off_t. You may need
++ to add some flags for configuration and compilation to enable this mode.
++ (For Solaris and Linux, the necessary defines are already defined.)])
++AC_MSG_RESULT(yes)
+ 
+ AC_MSG_CHECKING(for --enable-toolbox-glue)
+ AC_ARG_ENABLE(toolbox-glue,
+@@ -1560,12 +1525,6 @@
+ if test -z "$CCSHARED"
+ then
+ 	case $ac_sys_system/$ac_sys_release in
+-	SunOS*) if test "$GCC" = yes;
+-		then CCSHARED="-fPIC";
+-		elif test `uname -p` = sparc;
+-		then CCSHARED="-xcode=pic32";
+-		else CCSHARED="-Kpic";
+-		fi;;
+ 	hp*|HP*) if test "$GCC" = yes;
+ 		 then CCSHARED="-fPIC";
+ 		 else CCSHARED="+z";
+@@ -2931,12 +2890,6 @@
+ wchar_h="no"
+ )
+ 
+-# determine wchar_t size
+-if test "$wchar_h" = yes
+-then
+-  AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
+-fi
+-
+ AC_MSG_CHECKING(for UCS-4 tcl)
+ have_ucs4_tcl=no
+ AC_TRY_COMPILE([
+@@ -2967,6 +2920,11 @@
+   ac_cv_wchar_t_signed=no,
+   ac_cv_wchar_t_signed=yes)])
+   AC_MSG_RESULT($ac_cv_wchar_t_signed)
++ 
++  PY_CHECK_SIZEOF(wchar_t, 4, [
++  #include <wchar.h>
++  #include <stdlib.h
++  ])
+ fi
+   
+ AC_MSG_CHECKING(what type to use for unicode)
+--- Python-2.5.2/Python/import.c.isalibs	2007-08-24 06:08:33.000000000 +1200
++++ Python-2.5.2/Python/import.c	2008-03-04 18:22:54.964187356 +1300
+@@ -1121,6 +1121,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)
+@@ -1138,11 +1189,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;
+ 
+@@ -1361,15 +1411,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)
+@@ -1410,21 +1464,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.5.2/Python/importdl.h.isalibs	2002-12-31 11:08:05.000000000 +1300
++++ Python-2.5.2/Python/importdl.h	2008-03-04 18:16:12.419417599 +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.5.2/Makefile.pre.in.isalibs	2007-12-06 09:43:57.000000000 +1300
++++ Python-2.5.2/Makefile.pre.in	2008-03-04 18:16:12.613496370 +1300
+@@ -87,18 +87,18 @@
+ 
+ # Expanded directories
+ BINDIR=		$(exec_prefix)/bin
+-LIBDIR=		$(exec_prefix)/lib
++LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+ SCRIPTDIR=	$(prefix)/lib
+ 
+ # Detailed destination directories
+-BINLIBDEST=	$(LIBDIR)/python$(VERSION)
+-LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY=	$(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(VERSION)
+-LIBP=		$(LIBDIR)/python$(VERSION)
++BINLIBDEST=		$(exec_prefix)/lib/python$(VERSION)
++LIBDEST=		$(SCRIPTDIR)/python$(VERSION)
++INCLUDEPY=		$(INCLUDEDIR)/python$(VERSION)
++CONFINCLUDEPY=		$(CONFINCLUDEDIR)/python$(VERSION)
++LIBP=			$(exec_prefix)/lib/python$(VERSION)
+ 
+ # Symbols used for using shared libraries
+ SO=		@SO@
+@@ -810,6 +810,7 @@
+ 
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
++
+ inclinstall:
+ 	@for i in $(INCLDIRSTOMAKE); \
+ 	do \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-06-write_compiled_module-atomic.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,80 @@
+--- Python-2.5.1/Python/import.c.atomic	2007-08-08 20:51:41.313394000 -0400
++++ Python-2.5.1/Python/import.c	2007-08-08 21:01:57.640451000 -0400
+@@ -858,19 +858,28 @@
+ 
+ /* Write a compiled module to a file, placing the time of last
+    modification of its source into the header.
+-   Errors are ignored, if a write error occurs an attempt is made to
+-   remove the file. */
++   Write to a temporary file first so that creating the file is atomic.
++   Errors are ignored, if a write/unlink/rename error occurs an attempt
++   is made to remove the temporary file. */
+ 
+ static void
+ write_compiled_module(PyCodeObject *co, char *cpathname, time_t mtime)
+ {
+ 	FILE *fp;
++	char *tmppathname;
+ 
+-	fp = open_exclusive(cpathname);
++	/* the temporary file is called cpathname + ".tmp" */
++        if ((tmppathname = PyMem_Malloc(strlen(cpathname) + strlen(".tmp") + 1))
++	    == NULL) {
++	  return;
++	}
++	sprintf (tmppathname, "%s.tmp", cpathname);
++	fp = open_exclusive(tmppathname);
+ 	if (fp == NULL) {
+ 		if (Py_VerboseFlag)
+ 			PySys_WriteStderr(
+-				"# can't create %s\n", cpathname);
++				"# can't create %s\n", tmppathname);
++		PyMem_Free(tmppathname);
+ 		return;
+ 	}
+ 	PyMarshal_WriteLongToFile(pyc_magic, fp, Py_MARSHAL_VERSION);
+@@ -879,10 +888,11 @@
+ 	PyMarshal_WriteObjectToFile((PyObject *)co, fp, Py_MARSHAL_VERSION);
+ 	if (fflush(fp) != 0 || ferror(fp)) {
+ 		if (Py_VerboseFlag)
+-			PySys_WriteStderr("# can't write %s\n", cpathname);
++			PySys_WriteStderr("# can't write %s\n", tmppathname);
+ 		/* Don't keep partial file */
+ 		fclose(fp);
+-		(void) unlink(cpathname);
++		(void) unlink(tmppathname);
++		PyMem_Free(tmppathname);
+ 		return;
+ 	}
+ 	/* Now write the true mtime */
+@@ -891,8 +901,30 @@
+ 	PyMarshal_WriteLongToFile((long)mtime, fp, Py_MARSHAL_VERSION);
+ 	fflush(fp);
+ 	fclose(fp);
++	/* Delete the old compiled file, if exists */
++	if (unlink (cpathname)) {
++		if ((errno != ENOENT)) {
++			/* the file exists but could not be deleted */
++			if (Py_VerboseFlag)
++				PySys_WriteStderr(
++					"# can't unlink %s\n", cpathname);
++			(void) unlink(tmppathname);
++			PyMem_Free(tmppathname);
++			return;
++		}
++	}
++	/* rename the tmp file to the real file name */
++	if (rename (tmppathname, cpathname)) {
++		if (Py_VerboseFlag)
++			PySys_WriteStderr(
++				"# can't rename %s to %s\n", tmppathname, cpathname);
++		(void) unlink(tmppathname);
++		PyMem_Free(tmppathname);
++		return;
++	}
+ 	if (Py_VerboseFlag)
+ 		PySys_WriteStderr("# wrote %s\n", cpathname);
++	PyMem_Free(tmppathname);
+ }
+ 
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-07-dtrace.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,412 @@
+diff -Nru Python-2.5.1/Include/frameobject.h Python-2.5.1+dtrace/Include/frameobject.h
+--- Python-2.5.1/Include/frameobject.h	2006-06-11 22:11:18.000000000 -0400
++++ Python-2.5.1+dtrace/Include/frameobject.h	2007-09-19 21:22:33.064323000 -0400
+@@ -41,6 +41,7 @@
+     /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
+        f_trace is set) -- at other times use PyCode_Addr2Line instead. */
+     int f_lineno;		/* Current line number */
++    int f_calllineno;		/* line number of call site */
+     int f_iblock;		/* index in f_blockstack */
+     PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
+     PyObject *f_localsplus[1];	/* locals+stack, dynamically sized */
+diff -Nru Python-2.5.1/Makefile.pre.in Python-2.5.1+dtrace/Makefile.pre.in
+--- Python-2.5.1/Makefile.pre.in	2006-12-08 15:46:13.000000000 -0500
++++ Python-2.5.1+dtrace/Makefile.pre.in	2007-09-19 21:12:36.809125000 -0400
+@@ -192,6 +192,7 @@
+ GRAMMAR_C=	$(srcdir)/Python/graminit.c
+ GRAMMAR_INPUT=	$(srcdir)/Grammar/Grammar
+ 
++DTRACE_OBJS=Python/dtrace.o Python/phelper.o
+ 
+ ##########################################################################
+ # Parser
+@@ -271,6 +272,7 @@
+ 		Python/getopt.o \
+ 		Python/pystrtod.o \
+ 		Python/$(DYNLOADFILE) \
++		$(DTRACE_OBJS) \
+ 		$(MACHDEP_OBJS) \
+ 		$(THREADOBJ)
+ 
+@@ -499,6 +501,17 @@
+ Objects/unicodectype.o:	$(srcdir)/Objects/unicodectype.c \
+ 				$(srcdir)/Objects/unicodetype_db.h
+ 
++Python/phelper.o: $(srcdir)/Python/phelper.d
++	dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d
++
++Python/python.h: $(srcdir)/Python/python.d
++	dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d
++
++Python/ceval.o: Python/python.h
++
++Python/dtrace.o: $(srcdir)/Python/python.d Python/ceval.o
++	dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/python.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+ 
+diff -Nru Python-2.5.1/Objects/frameobject.c Python-2.5.1+dtrace/Objects/frameobject.c
+--- Python-2.5.1/Objects/frameobject.c	2007-04-16 02:19:52.000000000 -0400
++++ Python-2.5.1+dtrace/Objects/frameobject.c	2007-09-19 22:18:36.084885000 -0400
+@@ -670,6 +670,7 @@
+ 	f->f_tstate = tstate;
+ 
+ 	f->f_lasti = -1;
++ 	f->f_calllineno = code->co_firstlineno;
+ 	f->f_lineno = code->co_firstlineno;
+ 	f->f_iblock = 0;
+ 
+--- Python-2.5.2/Python/ceval.c.orig	2008-08-27 16:12:16.153435885 +1200
++++ Python-2.5.2/Python/ceval.c	2008-08-27 16:16:12.703912419 +1200
+@@ -19,6 +19,11 @@
+ 
+ #include <ctype.h>
+ 
++#define HAVE_DTRACE
++#ifdef HAVE_DTRACE
++#include "python.h"
++#endif
++
+ #ifndef WITH_TSC
+ 
+ #define READ_TIMESTAMP(var)
+@@ -499,6 +504,55 @@
+ 			  NULL);
+ }
+ 
++#ifdef HAVE_DTRACE
++static void
++dtrace_entry(PyFrameObject *f)
++{
++	const char *filename;
++	const char *fname;
++	int lineno;
++	
++	filename = PyString_AsString(f->f_code->co_filename);
++	fname = PyString_AsString(f->f_code->co_name);
++	lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++
++	PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
++
++	/*
++	 * Currently a USDT tail-call will not receive the correct arguments.
++	 * Disable the tail call here.
++	 */
++#if defined(__sparc)
++	asm("nop");
++#endif
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++	const char *filename;
++	const char *fname;
++	int lineno;
++	
++	filename = PyString_AsString(f->f_code->co_filename);
++	fname = PyString_AsString(f->f_code->co_name);
++	lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++	PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
++
++	/*
++	 * Currently a USDT tail-call will not receive the correct arguments.
++	 * Disable the tail call here.
++	 */
++#if defined(__sparc)
++	asm("nop");
++#endif
++}
++#else
++#define	PYTHON_FUNCTION_ENTRY_ENABLED 0
++#define	PYTHON_FUNCTION_RETURN_ENABLED 0
++#define	dtrace_entry()
++#define	dtrace_return()
++#endif
+ 
+ /* Interpreter main loop */
+ 
+@@ -509,9 +563,84 @@
+ 	return PyEval_EvalFrameEx(f, 0);
+ }
+ 
++/*
++ * These shenanigans look like utter madness, but what we're actually doing is
++ * making sure that the ustack helper will see the PyFrameObject pointer on the
++ * stack. We have two tricky cases:
++ *
++ * amd64
++ *
++ * We use up the six registers for passing arguments, meaning the call can't
++ * use a register for passing 'f', and has to push it onto the stack in a known
++ * location.
++ *
++ * And how does "throwflag" figure in to this? -PN
++ *
++ * SPARC
++ *
++ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before
++ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved,
++ * it's just some junk value rather than the real first argument. So, instead,
++ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler won't
++ * decide to re-use %i0. We also need to defeat optimization of our proxy.
++ */
++
++#if defined(HAVE_DTRACE)
++
++#if defined(__amd64)
++PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long,
++    PyFrameObject *, int throwflag);
++
++
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++	volatile PyObject *f2;
++	f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag);
++	return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6,
++    PyFrameObject *f, int throwflag)
++{
++
++#elif defined(__sparc)
++
++PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag);
++
++volatile int dummy;
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++	volatile PyObject *f2;
++	f2 = PyEval_EvalFrameExReal(f, throwflag);
++	dummy = f->ob_refcnt;
++	return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag)
++{
++
++#else /* __amd64 || __sparc */
++
+ PyObject *
+ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
+ {
++
++#endif /* __amd64 || __sparc */
++
++#else /* don't HAVE_DTRACE */
++
++PyObject *
++PyEval_EvalFrameexEx(PyFrameObject *f, int throwflag))
++{
++
++#endif /* HAVE_DTRACE */
++
+ #ifdef DXPAIRS
+ 	int lastopcode = 0;
+ #endif
+@@ -729,6 +858,9 @@
+ 		}
+ 	}
+ 
++        if (PYTHON_FUNCTION_ENTRY_ENABLED())
++                dtrace_entry(f);
++
+ 	co = f->f_code;
+ 	names = co->co_names;
+ 	consts = co->co_consts;
+@@ -2266,6 +2398,10 @@
+ 			PyObject **sp;
+ 			PCALL(PCALL_ALL);
+ 			sp = stack_pointer;
++#ifdef HAVE_DTRACE
++			f->f_calllineno = PyCode_Addr2Line(f->f_code,
++							   f->f_lasti);
++#endif
+ #ifdef WITH_TSC
+ 			x = call_function(&sp, oparg, &intr0, &intr1);
+ #else
+@@ -2308,6 +2444,11 @@
+ 		    } else
+ 			    Py_INCREF(func);
+ 		    sp = stack_pointer;
++#ifdef HAVE_DTRACE
++		    f->f_calllineno = PyCode_Addr2Line(f->f_code,
++		                                       f->f_lasti);
++#endif
++
+ 		    READ_TIMESTAMP(intr0);
+ 		    x = ext_do_call(func, &sp, flags, na, nk);
+ 		    READ_TIMESTAMP(intr1);
+@@ -2599,6 +2740,8 @@
+ 
+ 	/* pop frame */
+     exit_eval_frame:
++        if (PYTHON_FUNCTION_RETURN_ENABLED())
++                dtrace_return(f);
+ 	Py_LeaveRecursiveCall();
+ 	tstate->frame = f->f_back;
+ 
+diff -Nru Python-2.5.1/Python/phelper.d Python-2.5.1+dtrace/Python/phelper.d
+--- Python-2.5.1/Python/phelper.d	1969-12-31 19:00:00.000000000 -0500
++++ Python-2.5.1+dtrace/Python/phelper.d	2007-09-19 21:12:36.874777000 -0400
+@@ -0,0 +1,138 @@
++
++/*
++ * Python ustack helper.  This relies on the first argument (PyFrame *) being
++ * on the stack; see Python/ceval.c for the contortions we go through to ensure
++ * this is the case.
++ *
++ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's
++ * eight.
++ */
++
++/*
++ * Yes, this is as gross as it looks. DTrace cannot handle static functions,
++ * and our stat_impl.h has them in ILP32.
++ */
++#define _SYS_STAT_H
++
++#include <stdio.h>
++#include <sys/types.h>
++
++#include "pyport.h"
++#include "object.h"
++#include "pystate.h"
++#include "pyarena.h"
++#include "pythonrun.h"
++#include "compile.h"
++#include "frameobject.h"
++#include "stringobject.h"
++
++#if defined(__i386)
++#define	startframe PyEval_EvalFrameEx
++#define	endframe PyEval_EvalCodeEx
++#elif defined(__amd64)
++#define	PyEval_EvalFrameEx PyEval_EvalFrameExReal
++#define	startframe PyEval_EvalFrameExReal
++#define	endframe PyEval_EvalCodeEx
++#elif defined(__sparc)
++#define	startframe PyEval_EvalFrameEx
++#define	endframe PyEval_EvalFrameExReal
++#endif
++
++#ifdef __sparcv9
++#define	STACK_BIAS (2048-1)
++#else
++#define	STACK_BIAS 0
++#endif
++
++/*
++ * Not defining PHELPER lets us test this code as a normal D script.
++ */
++#ifdef PHELPER
++
++#define	at_evalframe(addr) \
++    ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \
++     (uintptr_t)addr < ((uintptr_t)&``endframe))
++#define	probe dtrace:helper:ustack:
++#define	print_result(r) (r)
++
++#if defined(__i386) || defined(__amd64)
++#define	frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2)
++#elif defined(__sparc)
++#define	frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8)
++#else
++#error unknown architecture
++#endif
++
++#else /* PHELPER */
++
++#define	at_evalframe(addr) (1)
++#define	probe pid$target::PyEval_EvalFrame:entry
++#define print_result(r) (trace(r))
++
++#if defined(__i386) || defined(__amd64)
++#define	frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t))
++#elif defined(__sparc)
++/*
++ * Not implemented: we could just use R_I0, but what's the point?
++ */
++#else
++#error unknown architecture
++#endif
++
++#endif /* PHELPER */
++
++extern uintptr_t PyEval_EvalFrameEx;
++extern uintptr_t PyEval_EvalCodeEx;
++
++#define	copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj)))
++#define	pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval))
++#define	copyin_str(dest, addr, obj) \
++    (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest)))
++#define	add_str(addr, obj) \
++    copyin_str(this->result + this->pos, addr, obj); \
++    this->pos += obj->ob_size; \
++    this->result[this->pos] = '\0';
++#define	add_digit(nr, div) ((nr / div) ? \
++    (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \
++    (this->result[this->pos] = '\0'))
++#define	add_char(c) (this->result[this->pos++] = c)
++
++probe /at_evalframe(arg0)/ 
++{
++	this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t));
++	this->frameo = copyin_obj(this->framep, PyFrameObject);
++	this->codep = this->frameo->f_code;
++	this->lineno = this->frameo->f_calllineno;
++	this->codeo = copyin_obj(this->codep, PyCodeObject);
++	this->filenamep = this->codeo->co_filename;
++	this->fnamep = this->codeo->co_name;
++	this->filenameo = copyin_obj(this->filenamep, PyStringObject);
++	this->fnameo = copyin_obj(this->fnamep, PyStringObject);
++
++	this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 +
++	    this->fnameo->ob_size + 1 + 1;
++
++	this->result = (char *)alloca(this->len);
++	this->pos = 0;
++
++	add_char('@');
++	add_str(this->filenamep, this->filenameo);
++	add_char(':');
++	add_digit(this->lineno, 10000);
++	add_digit(this->lineno, 1000);
++	add_digit(this->lineno, 100);
++	add_digit(this->lineno, 10);
++	add_digit(this->lineno, 1);
++	add_char(' ');
++	add_char('(');
++	add_str(this->fnamep, this->fnameo);
++	add_char(')');
++	this->result[this->pos] = '\0';
++
++	print_result(stringof(this->result));
++}
++
++probe /!at_evalframe(arg0)/
++{
++	NULL;
++}
+diff -Nru Python-2.5.1/Python/python.d Python-2.5.1+dtrace/Python/python.d
+--- Python-2.5.1/Python/python.d	1969-12-31 19:00:00.000000000 -0500
++++ Python-2.5.1+dtrace/Python/python.d	2007-09-19 21:12:36.874963000 -0400
+@@ -0,0 +1,10 @@
++provider python {
++	probe function__entry(const char *, const char *, int);
++	probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-08-ctypes.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,26 @@
+--- Python-2.5.2/Modules/_ctypes/libffi/src/x86/ffitarget.h.orig	2008-05-23 11:09:36.671550047 +1200
++++ Python-2.5.2/Modules/_ctypes/libffi/src/x86/ffitarget.h	2008-05-23 11:09:49.536798101 +1200
+@@ -51,10 +51,10 @@
+ #endif
+ 
+   /* ---- Intel x86 and AMD x86-64 - */
+-#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) 
++#if !defined(X86_WIN32) && (defined(__i386__) || defined (__i386) || defined(__x86_64__)) 
+   FFI_SYSV,
+   FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
+-#ifdef __i386__
++#if defined (__i386__) || defined (__i386)
+   FFI_DEFAULT_ABI = FFI_SYSV,
+ #else
+   FFI_DEFAULT_ABI = FFI_UNIX64,
+--- Python-2.5.2/Modules/_ctypes/callproc.c.alloca	2008-06-05 23:48:27.578970813 +1200
++++ Python-2.5.2/Modules/_ctypes/callproc.c	2008-06-05 23:48:41.677662640 +1200
+@@ -73,6 +73,8 @@
+ #include <malloc.h>
+ #endif
+ 
++#include <alloca.h>
++
+ #include <ffi.h>
+ #include "ctypes.h"
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-09-ucred.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,410 @@
+--- Python-2.5.2/Modules/ucred.c	1969-12-31 16:00:00.000000000 -0800
++++ Python-new/Modules/ucred.c	2008-04-08 07:11:20.059630000 -0700
+@@ -0,0 +1,391 @@
++/*
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#include <Python.h>
++
++#include <stdio.h>
++#include <priv.h>
++#include <ucred.h>
++#include <ctype.h>
++#include <tsol/label.h>
++
++typedef struct {
++	PyObject_HEAD
++	ucred_t *ucred;
++} pyucred_t;
++
++#define pyucred_getlongid(name, type)				\
++	static PyObject *					\
++	pyucred_get##name(pyucred_t *uc)			\
++	{ 							\
++		type val;					\
++								\
++		if (uc->ucred == NULL) {			\
++			errno = EINVAL;				\
++			PyErr_SetFromErrno(PyExc_OSError);	\
++			return (NULL);				\
++		}						\
++								\
++		if ((val = ucred_get##name(uc->ucred)) == -1) {	\
++			PyErr_SetFromErrno(PyExc_OSError);	\
++			return (NULL);				\
++		}						\
++								\
++		return (Py_BuildValue("l", (long)val));		\
++	}
++
++pyucred_getlongid(euid, uid_t)
++pyucred_getlongid(ruid, uid_t)
++pyucred_getlongid(suid, uid_t)
++pyucred_getlongid(egid, gid_t)
++pyucred_getlongid(rgid, gid_t)
++pyucred_getlongid(sgid, gid_t)
++pyucred_getlongid(pid, pid_t)
++pyucred_getlongid(projid, projid_t)
++pyucred_getlongid(zoneid, zoneid_t)
++
++static PyObject *
++pyucred_getgroups(pyucred_t *uc)
++{
++	const gid_t *groups;
++	PyObject *list;
++	int len;
++	int i;
++
++	if (uc->ucred == NULL) {
++		errno = EINVAL;
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	if ((len = ucred_getgroups(uc->ucred, &groups)) == -1) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	if ((list = PyList_New(len)) == NULL)
++		return (NULL);
++
++	for (i = 0; i < len; i++) {
++		PyObject *gid = Py_BuildValue("l", (long)groups[i]);
++		if (PyList_SetItem(list, i, gid) == -1)
++			return (NULL);
++	}
++
++	return (list);
++}
++
++static PyObject *
++pyucred_getlabel(pyucred_t *uc)
++{
++	m_label_t *label;
++	PyObject *ret;
++	char *str;
++
++	if (uc->ucred == NULL) {
++		errno = EINVAL;
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	label = ucred_getlabel(uc->ucred);
++	if (label == NULL)
++		return (Py_BuildValue("s", ""));
++
++	if (label_to_str(label, &str, M_LABEL, DEF_NAMES) == -1) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	ret = Py_BuildValue("s", str);
++	free(str);
++	return (ret);
++}
++
++static PyObject *
++pyucred_getpflags(pyucred_t *uc, PyObject *args, PyObject *kwargs)
++{
++	static char *kwlist[] = { "flags", NULL };
++	uint_t flags;
++
++	if (uc->ucred == NULL) {
++		errno = EINVAL;
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++	    &flags))
++		return (NULL);
++
++	if ((flags = ucred_getpflags(uc->ucred, flags)) == (uint_t)-1) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	return (Py_BuildValue("i", flags));
++}
++
++static PyObject *
++pyucred_has_priv(pyucred_t *uc, PyObject *args, PyObject *kwargs)
++{
++	static char *kwlist[] = { "set", "priv", NULL };
++	const priv_set_t *privs;
++	const char *set;
++	const char *priv;
++
++	if (uc->ucred == NULL) {
++		errno = EINVAL;
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss", kwlist,
++	    &set, &priv))
++		return (NULL);
++
++	if ((privs = ucred_getprivset(uc->ucred, set)) == NULL) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	if (priv_ismember(privs, priv)) {
++		Py_INCREF(Py_True);
++		return Py_True;
++	}
++
++	Py_INCREF(Py_False);
++	return Py_False;
++}
++
++PyDoc_STRVAR(pyucred_getlabel_doc,
++    "getlabel() -> string\n"
++    "\n"
++    "Return the Trusted Extensions label string, or an "
++    "empty string if not available. The label string is "
++    "converted using the default name and M_LABEL (human-readable). "
++    "Raises OSError. See label_to_str(3TSOL).");
++PyDoc_STRVAR(pyucred_getpflags_doc,
++    "getpflags(flags) -> int\n"
++    "\n"
++    "Return the values of the specified privilege flags.");
++PyDoc_STRVAR(pyucred_has_priv_doc,
++    "has_priv(set, priv) -> bool\n"
++    "\n"
++    "Return true if the given privilege is set in the "
++    "specified set. Raises OSError if the set or privilege is "
++    "invalid, or a problem occurs.\n"
++    "\n"
++    "Currently, the following privilege sets are defined, as "
++    "described in privileges(5):\n"
++    "\n"
++    "Effective\n"
++    "Permitted\n"
++    "Inheritable\n"
++    "Limit\n");
++
++static PyMethodDef pyucred_methods[] = {
++	{ "geteuid", (PyCFunction)pyucred_geteuid, METH_NOARGS,
++	    "Return the effective user ID." },
++	{ "getruid", (PyCFunction)pyucred_getruid, METH_NOARGS,
++	    "Return the real user ID." },
++	{ "getsuid", (PyCFunction)pyucred_getsuid, METH_NOARGS,
++	    "Return the saved user ID." },
++	{ "getegid", (PyCFunction)pyucred_getegid, METH_NOARGS,
++	    "Return the effective group ID." },
++	{ "getrgid", (PyCFunction)pyucred_getrgid, METH_NOARGS,
++	    "Return the real group ID." },
++	{ "getsgid", (PyCFunction)pyucred_getsgid, METH_NOARGS,
++	    "Return the saved group ID." },
++	{ "getpid", (PyCFunction)pyucred_getpid, METH_NOARGS,
++	    "Return the effective user ID." },
++	{ "getprojid", (PyCFunction)pyucred_getprojid, METH_NOARGS,
++	    "Return the project ID." },
++	{ "getzoneid", (PyCFunction)pyucred_getzoneid, METH_NOARGS,
++	    "Return the zone ID." },
++	{ "getgroups", (PyCFunction)pyucred_getgroups, METH_NOARGS,
++	    "Return a list of group IDs." },
++	{ "getlabel", (PyCFunction)pyucred_getlabel, METH_NOARGS,
++	    pyucred_getlabel_doc },
++	{ "getpflags", (PyCFunction)pyucred_getpflags,
++	    METH_VARARGS|METH_KEYWORDS, pyucred_getpflags_doc },
++	{ "has_priv", (PyCFunction)pyucred_has_priv,
++	    METH_VARARGS|METH_KEYWORDS, pyucred_has_priv_doc },
++	{ NULL }
++};
++
++static int
++pyucred_init(PyObject *self, PyObject *args, PyObject *kwargs)
++{
++	pyucred_t *uc = (pyucred_t *)self;
++	uc->ucred = NULL;
++	return (0);
++}
++
++static void
++pyucred_dealloc(PyObject *self)
++{
++	pyucred_t *uc = (pyucred_t *)self;
++	if (uc->ucred != NULL)
++		ucred_free(uc->ucred);
++	self->ob_type->tp_free(self);
++}
++
++static PyTypeObject pyucred_type = {
++	PyObject_HEAD_INIT(NULL)
++	0,                         /*ob_size*/
++	"ucred.ucred",             /*tp_name*/
++	sizeof (pyucred_t),        /*tp_basicsize*/
++	0,                         /*tp_itemsize*/
++	pyucred_dealloc,           /*tp_dealloc*/
++	0,                         /*tp_print*/
++	0,                         /*tp_getattr*/
++	0,                         /*tp_setattr*/
++	0,                         /*tp_compare*/
++	0,                         /*tp_repr*/
++	0,                         /*tp_as_number*/
++	0,                         /*tp_as_sequence*/
++	0,                         /*tp_as_mapping*/
++	0,                         /*tp_hash */
++	0,                         /*tp_call*/
++	0,                         /*tp_str*/
++	0,                         /*tp_getattro*/
++	0,                         /*tp_setattro*/
++	0,                         /*tp_as_buffer*/
++	Py_TPFLAGS_DEFAULT,        /*tp_flags*/
++	"user credentials",        /*tp_doc */
++	0,		           /* tp_traverse */
++	0,		           /* tp_clear */
++	0,		           /* tp_richcompare */
++	0,		           /* tp_weaklistoffset */
++	0,		           /* tp_iter */
++	0,		           /* tp_iternext */
++	pyucred_methods,           /* tp_methods */
++	0,                         /* tp_members */
++	0,                         /* tp_getset */
++	0,                         /* tp_base */
++	0,                         /* tp_dict */
++	0,                         /* tp_descr_get */
++	0,                         /* tp_descr_set */
++	0,                         /* tp_dictoffset */
++	(initproc)pyucred_init,    /* tp_init */
++	0,                         /* tp_alloc */
++	0,                         /* tp_new */
++};
++
++static PyObject *
++pyucred_new(const ucred_t *uc)
++{
++	pyucred_t *self;
++
++	self = (pyucred_t *)PyObject_CallObject((PyObject *)&pyucred_type, NULL);
++
++	if (self == NULL)
++		return (NULL);
++
++	self->ucred = (ucred_t *)uc;
++
++	return ((PyObject *)self);
++}
++
++static PyObject *
++pyucred_get(PyObject *o, PyObject *args, PyObject *kwargs)
++{
++	static char *kwlist[] = { "pid", NULL };
++	ucred_t *ucred = NULL;
++	int pid;
++
++	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++	    &pid))
++		return (NULL);
++
++	ucred = ucred_get(pid);
++
++	if (ucred == NULL) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	return (pyucred_new(ucred));
++}
++
++static PyObject *
++pyucred_getpeer(PyObject *o, PyObject *args, PyObject *kwargs)
++{
++	static char *kwlist[] = { "fd", NULL };
++	ucred_t *ucred = NULL;
++	int fd;
++
++	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++	    &fd))
++		return (NULL);
++
++	if (getpeerucred(fd, &ucred) == -1) {
++		PyErr_SetFromErrno(PyExc_OSError);
++		return (NULL);
++	}
++
++	return (pyucred_new(ucred));
++}
++
++PyDoc_STRVAR(pyucred_get_doc,
++    "get(pid) -> ucred\n"
++    "\n"
++    "Return the credentials of the specified process ID. "
++    "Raises OSError. See ucred_get(3C).");
++PyDoc_STRVAR(pyucred_getpeer_doc,
++    "getpeer(fd) -> ucred\n"
++    "\n"
++    "Return the credentials of the peer endpoint of a "
++    "connection-oriented socket (SOCK_STREAM) or STREAM fd "
++    "at the time the endpoint was created or the connection "
++    "was established. Raises OSError. See getpeerucred(3C).");
++
++static struct PyMethodDef pyucred_module_methods[] = {
++	{ "get", (PyCFunction) pyucred_get,
++	  METH_VARARGS|METH_KEYWORDS, pyucred_get_doc },
++	{ "getpeer", (PyCFunction) pyucred_getpeer,
++	  METH_VARARGS|METH_KEYWORDS, pyucred_getpeer_doc },
++	{ NULL, NULL, 0, NULL }
++};
++
++PyDoc_STRVAR(pyucred_module_doc,
++    "This module provides an interface to the user credential access "
++    "methods, obtainable either by process ID or file descriptor.");
++   
++PyMODINIT_FUNC
++initucred(void)
++{
++	PyObject *m;
++
++	m = Py_InitModule3("ucred", pyucred_module_methods,
++	    pyucred_module_doc);
++
++	pyucred_type.tp_new = PyType_GenericNew;
++	if (PyType_Ready(&pyucred_type) < 0)
++		return;
++
++	Py_INCREF(&pyucred_type);
++
++	PyModule_AddObject(m, "ucred", (PyObject *)&pyucred_type);
++}
+--- Python-2.5.2/setup.py.ucred	2008-08-09 16:45:35.956504139 +1200
++++ Python-2.5.2/setup.py	2008-08-09 16:46:34.542441198 +1200
+@@ -1067,6 +1067,13 @@
+             if (dl_inc is not None) and (platform not in ['atheos']):
+                 exts.append( Extension('dl', ['dlmodule.c']) )
+ 
++        # ucred module (Solaris)
++        ucred_inc = find_file('ucred.h', [], inc_dirs)
++        tsol_inc = find_file('tsol/label.h', [], inc_dirs)
++        if ucred_inc is not None and tsol_inc is not None:
++            exts.append( Extension('ucred', ['ucred.c'],
++                                   libraries = ['tsol']) )
++
+         # Thomas Heller's _ctypes module
+         self.detect_ctypes(inc_dirs, lib_dirs)
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python25-10-gethostname.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,14 @@
+--- Python-2.4.4/Include/pyport.h.orig	2008-02-04 20:36:04.962673898 +1300
++++ Python-2.4.4/Include/pyport.h	2008-02-04 20:36:23.745132109 +1300
+@@ -376,11 +376,6 @@
+ in platform-specific #ifdefs.
+ **************************************************************************/
+ 
+-#ifdef SOLARIS
+-/* Unchecked */
+-extern int gethostname(char *, int);
+-#endif
+-
+ #ifdef __BEOS__
+ /* Unchecked */
+ /* It's in the libs, but not the headers... - [cjh] */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/libffi-01-__i386__.diff	Wed Aug 27 05:51:36 2008 +0000
@@ -0,0 +1,24 @@
+--- libffi-3.0.5/src/x86/ffitarget.h.patch2	2008-02-15 14:24:06.000000000 +1300
++++ libffi-3.0.5/src/x86/ffitarget.h	2008-06-06 00:19:04.440276530 +1200
+@@ -31,7 +31,7 @@
+ 
+ /* ---- System specific configurations ----------------------------------- */
+ 
+-#if defined (X86_64) && defined (__i386__)
++#if defined (X86_64) && (defined (__i386__) || defined (__i386))
+ #undef X86_64
+ #define X86
+ #endif
+@@ -54,10 +54,10 @@
+ #endif
+ 
+   /* ---- Intel x86 and AMD x86-64 - */
+-#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
++#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__) || defined (__i386))
+   FFI_SYSV,
+   FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
+-#ifdef __i386__
++#if defined (__i386__) || defined (__i386)
+   FFI_DEFAULT_ABI = FFI_SYSV,
+ #else
+   FFI_DEFAULT_ABI = FFI_UNIX64,