Ticket #7414: setup-data-files-macos-r7732.diff
File setup-data-files-macos-r7732.diff, 2.2 KB (added by , 16 years ago) |
---|
-
setup.py
1 1 from distutils.core import setup 2 from distutils.command.install_data import install_data 2 3 from distutils.command.install import INSTALL_SCHEMES 3 4 import os 4 5 import sys 5 6 7 # On MacOS the plattform specific lib dir is /System/Library/Framework/Python/.../ which is wrong. 8 # Python 2.5 supplied with MacOS 10.5 has an Aplle specific fix for this in distutils.command.install_data#306 9 # It fixes install_lib but not install_data, which is why we roll our own install_data class. 10 11 class django_install_data( install_data ): 12 # By the time finalize_options is called install.install_lib is set to the fixed directory. 13 # so we set the installdir for to install_lib, the install_data class uses ('install_data', 'install_dir') instead. 14 def finalize_options (self): 15 self.set_undefined_options('install', 16 ('install_lib', 'install_dir') 17 ) 18 install_data.finalize_options(self) 19 6 20 def fullsplit(path, result=None): 7 21 """ 8 22 Split a pathname into components (the opposite of os.path.join) in a … … 17 31 return result 18 32 return fullsplit(head, [tail] + result) 19 33 34 # On darwin we nee to use the django specific install_data class so the data_files are installed into the correct location. 35 # On the other platform we use the default class. 36 if sys.platform == "darwin": 37 cmdclasses = {'install_data': django_install_data } 38 else: 39 cmdclasses = {'install_data': install_data } 40 20 41 # Tell distutils to put the data_files in platform-specific installation 21 42 # locations. See here for an explanation: 22 43 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb … … 55 76 author_email = 'foundation@djangoproject.com', 56 77 description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.', 57 78 packages = packages, 79 cmdclass = cmdclasses, 58 80 data_files = data_files, 59 81 scripts = ['django/bin/django-admin.py'], 60 82 )