6 from distutils.core import setup
9 version = __import__('p2pool').__version__
11 if os.path.exists('INITBAK'):
13 os.rename(os.path.join('p2pool', '__init__.py'), 'INITBAK')
15 open(os.path.join('p2pool', '__init__.py'), 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep))
17 sys.argv[1:] = ['py2exe']
20 description='Peer-to-peer Bitcoin mining pool',
21 author='Forrest Voight',
22 author_email='forrest@forre.st',
23 url='http://p2pool.forre.st/',
27 'web-static/d3.v2.min.js',
28 'web-static/graphs.html',
32 console=['run_p2pool.py'],
33 options=dict(py2exe=dict(
35 dll_excludes=['w9xpopen.exe'],
36 includes=['twisted.web.resource', 'ltc_scrypt'],
41 os.remove(os.path.join('p2pool', '__init__.py'))
42 os.rename('INITBAK', os.path.join('p2pool', '__init__.py'))
44 dir_name = 'p2pool_win32_' + version
46 if os.path.exists(dir_name):
47 shutil.rmtree(dir_name)
48 os.rename('dist', dir_name)
50 with zipfile.ZipFile(dir_name + '.zip', 'w', zipfile.ZIP_DEFLATED) as zf:
51 for dirpath, dirnames, filenames in os.walk(dir_name):
52 for filename in filenames:
53 zf.write(os.path.join(dirpath, filename))