forked from Rav3nPL/p2pool-rav
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes to get version and py2exe working on windows
- Loading branch information
Showing
2 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
import os | ||
import subprocess | ||
import shutil | ||
import sys | ||
|
||
subprocess.check_call(['git', 'checkout', 'p2pool/__init__.py']) | ||
version = __import__('p2pool').__version__ | ||
open('p2pool/__init__.py', 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep)) | ||
import zipfile | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
sys.argv[1:] = ['py2exe'] | ||
setup(name='p2pool', | ||
version=version, | ||
description='Peer-to-peer Bitcoin mining pool', | ||
author='Forrest Voight', | ||
author_email='[email protected]', | ||
url='http://p2pool.forre.st/', | ||
data_files=[('', ['README'])], | ||
version = __import__('p2pool').__version__ | ||
|
||
old_contents = open('p2pool/__init__.py', 'rb').read() | ||
try: | ||
open('p2pool/__init__.py', 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep)) | ||
|
||
console=['run_p2pool.py'], | ||
options=dict(py2exe=dict( | ||
bundle_files=1, | ||
dll_excludes=['w9xpopen.exe'], | ||
includes=['twisted.web.resource', 'ltc_scrypt'], | ||
)), | ||
zipfile=None, | ||
) | ||
sys.argv[1:] = ['py2exe'] | ||
setup(name='p2pool', | ||
version=version, | ||
description='Peer-to-peer Bitcoin mining pool', | ||
author='Forrest Voight', | ||
author_email='[email protected]', | ||
url='http://p2pool.forre.st/', | ||
data_files=[('', ['README'])], | ||
|
||
console=['run_p2pool.py'], | ||
options=dict(py2exe=dict( | ||
bundle_files=1, | ||
dll_excludes=['w9xpopen.exe'], | ||
includes=['twisted.web.resource', 'ltc_scrypt'], | ||
)), | ||
zipfile=None, | ||
) | ||
finally: | ||
open('p2pool/__init__.py', 'wb').write(old_contents) | ||
|
||
dir_name = 'p2pool_win32_' + version | ||
print dir_name | ||
|
||
if os.path.exists(dir_name): | ||
shutil.rmtree(dir_name) | ||
os.rename('dist', dir_name) | ||
|
||
with zipfile.ZipFile(dir_name + '.zip', 'w', zipfile.ZIP_DEFLATED) as zf: | ||
for dirpath, dirnames, filenames in os.walk(dir_name): | ||
for filename in filenames: | ||
zf.write(os.path.join(dirpath, filename)) | ||
|
||
print dir_name |