X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=setup.py;h=95547831bddcd871ab8a229156c7254e9ceeabdf;hb=354ec22a175fe03cd3cd3487426bb1df338d6b5c;hp=cc32e46b6ff55795dd6d37a684ef7b060e7b3d6b;hpb=2ee86ef5379028eac2a7a0dbb8a746e6a7e50212;p=p2pool.git diff --git a/setup.py b/setup.py index cc32e46..9554783 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,25 @@ import os import shutil import sys import zipfile +import platform from distutils.core import setup +from distutils.sysconfig import get_python_lib import py2exe version = __import__('p2pool').__version__ +im64 = '64' in platform.architecture()[0] -old_contents = open('p2pool/__init__.py', 'rb').read() +if os.path.exists('INITBAK'): + os.remove('INITBAK') +os.rename(os.path.join('p2pool', '__init__.py'), 'INITBAK') try: - open('p2pool/__init__.py', 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep)) - + open(os.path.join('p2pool', '__init__.py'), 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep)) + mfcdir = get_python_lib() + '\pythonwin\\' + mfcfiles = [os.path.join(mfcdir, i) for i in ["mfc90.dll", "mfc90u.dll", "mfcm90.dll", "mfcm90u.dll", "Microsoft.VC90.MFC.manifest"]] + bundle = 1 + if im64: + bundle = bundle + 2 sys.argv[1:] = ['py2exe'] setup(name='p2pool', version=version, @@ -19,20 +28,35 @@ try: author='Forrest Voight', author_email='forrest@forre.st', url='http://p2pool.forre.st/', - data_files=[('', ['README'])], - + data_files=[ + ('', ['README.md']), + ("Microsoft.VC90.MFC", mfcfiles), + ('web-static', [ + 'web-static/d3.v2.min.js', + 'web-static/favicon.ico', + 'web-static/graphs.html', + 'web-static/index.html', + 'web-static/share.html', + ]), + ], + console=['run_p2pool.py'], options=dict(py2exe=dict( - bundle_files=1, - dll_excludes=['w9xpopen.exe'], + bundle_files=bundle, + dll_excludes=['w9xpopen.exe', "mswsock.dll", "MSWSOCK.dll"], includes=['twisted.web.resource', 'ltc_scrypt'], )), zipfile=None, ) finally: - open('p2pool/__init__.py', 'wb').write(old_contents) + os.remove(os.path.join('p2pool', '__init__.py')) + os.rename('INITBAK', os.path.join('p2pool', '__init__.py')) + +win = '32' +if im64: + win = '64' -dir_name = 'p2pool_win32_' + version +dir_name = 'p2pool_win' + win + '_' + version if os.path.exists(dir_name): shutil.rmtree(dir_name)