Ticket #3203: bdist_wininst_fix.diff

File bdist_wininst_fix.diff, 1.1 KB (added by ymasuda <ymasuda@…>, 8 years ago)

Fixing bdist_wininst to place package data files correctly

  • setup.py

     
    11from distutils.core import setup
    22from distutils.command.install import INSTALL_SCHEMES
    3 import os
     3import os, sys
    44
    55# Tell distutils to put the data_files in platform-specific installation
    66# locations. See here for an explanation:
     
    2323        package = dirpath[len_root_dir:].lstrip('/').replace('/', '.')
    2424        packages.append(package)
    2525    else:
    26         data_files.append((dirpath, [os.path.join(dirpath, f) for f in filenames]))
     26        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
    2727
     28# Small hack for working with bdist_wininst. Borrowed from:
     29# http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
     30if sys.argv[1] == 'bdist_wininst':
     31     for fileInfo in data_files:
     32         fileInfo[0] = '/PURELIB/%s' % fileInfo[0]
     33
    2834# Dynamically calculate the version based on django.VERSION.
    2935version = "%d.%d-%s" % (__import__('django').VERSION)
    3036
Back to Top