fixups to setup.py to include some extra required modules, bundle everything
authorForrest Voight <forrest@forre.st>
Sat, 14 Jan 2012 02:29:58 +0000 (18:29 -0800)
committerForrest Voight <forrest@forre.st>
Sat, 14 Jan 2012 02:29:58 +0000 (18:29 -0800)
into one file, copy the READMEs, and insert a computed version into the
source

setup.py

index f0204d5..06d7240 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,21 @@
+import os
+import sys
+
 from distutils.core import setup
+import py2exe
 
-try:
-    import py2exe
-except ImportError:
-    print 'missing py2exe'
+def get_version():
+    root_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
+    git_dir = os.path.join(root_dir, '.git')
+    head = open(os.path.join(git_dir, 'HEAD')).read().strip()
+    prefix = 'ref: '
+    if head.startswith(prefix):
+        path = head[len(prefix):].split('/')
+        return open(os.path.join(git_dir, *path)).read().strip()[:7]
+    else:
+        return head[:7]
 
+open('p2pool/__init__.py', 'wb').write('__version__ = %r\r\n\r\nDEBUG = False\r\n' % get_version())
 
 setup(name='p2pool',
     version='1.0',
@@ -12,6 +23,13 @@ setup(name='p2pool',
     author='Forrest Voight',
     author_email='forrest@forre.st',
     url='http://p2pool.forre.st/',
+    data_files=[('', ['README', 'README-Litecoin'])],
     
     console=['run_p2pool.py'],
+    options=dict(py2exe=dict(
+        bundle_files=1,
+        dll_excludes=['w9xpopen.exe'],
+        includes=['twisted.web.resource', 'ltc_scrypt'],
+    )),
+    zipfile=None,
 )