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',
29 'web-static/index.html',
30 'web-static/share.html',
34 console=['run_p2pool.py'],
35 options=dict(py2exe=dict(
37 dll_excludes=['w9xpopen.exe'],
38 includes=['twisted.web.resource', 'ltc_scrypt'],
43 os.remove(os.path.join('p2pool', '__init__.py'))
44 os.rename('INITBAK', os.path.join('p2pool', '__init__.py'))
46 dir_name = 'p2pool_win32_' + version
48 if os.path.exists(dir_name):
49 shutil.rmtree(dir_name)
50 os.rename('dist', dir_name)
52 with zipfile.ZipFile(dir_name + '.zip', 'w', zipfile.ZIP_DEFLATED) as zf:
53 for dirpath, dirnames, filenames in os.walk(dir_name):
54 for filename in filenames:
55 zf.write(os.path.join(dirpath, filename))