Index: setup.py
===================================================================
--- setup.py	(revision 7737)
+++ setup.py	(working copy)
@@ -1,8 +1,22 @@
 from distutils.core import setup
+from distutils.command.install_data import install_data
 from distutils.command.install import INSTALL_SCHEMES
 import os
 import sys
 
+# On MacOS the plattform specific lib dir is /System/Library/Framework/Python/.../ which is wrong.
+# Python 2.5 supplied with MacOS 10.5 has an Aplle specific fix for this in distutils.command.install_data#306
+# It fixes install_lib but not install_data, which is why we roll our own install_data class.
+
+class django_install_data( install_data ):
+#   By the time finalize_options is called install.install_lib is set to the fixed directory.
+#   so we set the installdir for to install_lib, the install_data class uses ('install_data', 'install_dir') instead.
+    def finalize_options (self):
+        self.set_undefined_options('install',
+                                    ('install_lib', 'install_dir')
+                                   )
+        install_data.finalize_options(self)
+
 def fullsplit(path, result=None):
     """
     Split a pathname into components (the opposite of os.path.join) in a
@@ -17,6 +31,13 @@
         return result
     return fullsplit(head, [tail] + result)
 
+# On darwin we nee to use the django specific install_data class so the data_files are installed into the correct location.
+# On the other platform we use the default class.
+if sys.platform == "darwin":
+    cmdclasses = {'install_data': django_install_data }
+else:
+    cmdclasses = {'install_data': install_data }
+
 # Tell distutils to put the data_files in platform-specific installation
 # locations. See here for an explanation:
 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
@@ -55,6 +76,7 @@
     author_email = 'foundation@djangoproject.com',
     description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
     packages = packages,
+    cmdclass = cmdclasses,
     data_files = data_files,
     scripts = ['django/bin/django-admin.py'],
 )
