7 from distutils.core import setup
8 from distutils.sysconfig import get_python_lib
11 version = __import__('p2pool').__version__
12 im64 = '64' in platform.architecture()[0]
14 if os.path.exists('INITBAK'):
16 os.rename(os.path.join('p2pool', '__init__.py'), 'INITBAK')
18 open(os.path.join('p2pool', '__init__.py'), 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep))
19 mfcdir = get_python_lib() + '\pythonwin\\'
20 mfcfiles = [os.path.join(mfcdir, i) for i in ["mfc90.dll", "mfc90u.dll", "mfcm90.dll", "mfcm90u.dll", "Microsoft.VC90.MFC.manifest"]]
24 sys.argv[1:] = ['py2exe']
27 description='Peer-to-peer Bitcoin mining pool',
28 author='Forrest Voight',
29 author_email='forrest@forre.st',
30 url='http://p2pool.forre.st/',
33 ("Microsoft.VC90.MFC", mfcfiles),
35 'web-static/d3.v2.min.js',
36 'web-static/favicon.ico',
37 'web-static/graphs.html',
38 'web-static/index.html',
39 'web-static/share.html',
43 console=['run_p2pool.py'],
44 options=dict(py2exe=dict(
46 dll_excludes=['w9xpopen.exe', "mswsock.dll", "MSWSOCK.dll"],
47 includes=['twisted.web.resource', 'ltc_scrypt'],
52 os.remove(os.path.join('p2pool', '__init__.py'))
53 os.rename('INITBAK', os.path.join('p2pool', '__init__.py'))
59 dir_name = 'p2pool_win' + win + '_' + version
61 if os.path.exists(dir_name):
62 shutil.rmtree(dir_name)
63 os.rename('dist', dir_name)
65 with zipfile.ZipFile(dir_name + '.zip', 'w', zipfile.ZIP_DEFLATED) as zf:
66 for dirpath, dirnames, filenames in os.walk(dir_name):
67 for filename in filenames:
68 zf.write(os.path.join(dirpath, filename))