Changeset 4912
- Timestamp:
- 04/03/07 07:28:19 (1 year ago)
- Files:
-
- django/trunk/MANIFEST.in (modified) (1 diff)
- django/trunk/scripts/rpm-install.sh (modified) (2 diffs)
- django/trunk/setup.cfg (modified) (1 diff)
- django/trunk/setup.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/MANIFEST.in
r4490 r4912 1 include README 1 2 include AUTHORS 2 3 include INSTALL 3 4 include LICENSE 5 include MANIFEST.in 4 6 recursive-include docs * 5 7 recursive-include scripts * 8 recursive-include examples * 9 recursive-include extras * 6 10 recursive-include django/conf/locale * 7 11 recursive-include django/contrib/admin/templates * django/trunk/scripts/rpm-install.sh
r4490 r4912 1 1 #! /bin/sh 2 2 # 3 # this file is *inserted* into the install section of the generated 4 # spec file 3 # This file becomes the install section of the generated spec file. 5 4 # 6 5 7 # this is, what dist.py normally does6 # This is what dist.py normally does. 8 7 python setup.py install --root=${RPM_BUILD_ROOT} --record="INSTALLED_FILES" 9 8 9 # Sort the filelist so that directories appear before files. This avoids 10 # duplicate filename problems on some systems. 11 touch DIRS 10 12 for i in `cat INSTALLED_FILES`; do 11 13 if [ -f ${RPM_BUILD_ROOT}/$i ]; then … … 17 19 done 18 20 19 cat DIRS FILES >INSTALLED_FILES 21 # Make sure we match foo.pyo and foo.pyc along with foo.py (but only once each) 22 sed -e "/\.py[co]$/d" -e "s/\.py$/.py*/" DIRS FILES >INSTALLED_FILES 23 django/trunk/setup.cfg
r4490 r4912 1 1 [bdist_rpm] 2 doc_files = docs /*.txt2 doc_files = docs examples extras AUTHORS INSTALL LICENSE README 3 3 install-script = scripts/rpm-install.sh 4 4 django/trunk/setup.py
r4550 r4912 3 3 import os 4 4 import sys 5 6 def fullsplit(path, result=None): 7 """ 8 Split a pathname into components (the opposite of os.path.join) in a 9 platform-neutral way. 10 """ 11 if result is None: 12 result = [] 13 head, tail = os.path.split(path) 14 if head == '': 15 return [tail] + result 16 if head == path: 17 return result 18 return fullsplit(head, [tail] + result) 5 19 6 20 # Tell distutils to put the data_files in platform-specific installation … … 14 28 packages, data_files = [], [] 15 29 root_dir = os.path.dirname(__file__) 16 len_root_dir = len(root_dir)17 30 django_dir = os.path.join(root_dir, 'django') 31 pieces = fullsplit(root_dir) 32 if pieces[-1] == '': 33 len_root_dir = len(pieces)- 1 34 else: 35 len_root_dir = len(pieces) 18 36 19 37 for dirpath, dirnames, filenames in os.walk(django_dir): … … 22 40 if dirname.startswith('.'): del dirnames[i] 23 41 if '__init__.py' in filenames: 24 package = dirpath[len_root_dir:].lstrip('/').replace('/', '.') 25 packages.append(package) 26 else: 42 packages.append('.'.join(fullsplit(dirpath)[len_root_dir:])) 43 elif filenames: 27 44 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) 28 45 29 # Small hack for working with bdist_wininst.30 # See http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html31 if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':32 for file_info in data_files:33 file_info[0] = '/PURELIB/%s' % file_info[0]34 35 46 # Dynamically calculate the version based on django.VERSION. 36 version = "%d.%d-%s" % (__import__('django').VERSION) 47 version_tuple = __import__('django').VERSION 48 if version_tuple[2] is not None: 49 version = "%d.%d_%s" % version_tuple 50 else: 51 version = "%d.%d" % version_tuple[:2] 37 52 38 53 setup(
