New port numbers
[electrum-nvc.git] / setup-release.py
index 8db07f7..a598fec 100644 (file)
@@ -1,5 +1,5 @@
 """
-py2app/py2exe build script for Electrum Litecoin
+py2app/py2exe build script for Electrum Novacoin
 
 Usage (Mac OS X):
      python setup.py py2app
@@ -8,16 +8,20 @@ Usage (Windows):
      python setup.py py2exe
 """
 
-import sys, os, shutil, re
 from setuptools import setup
-from lib.version import ELECTRUM_VERSION as version
+import os
+import re
+import shutil
+import sys
+
 from lib.util import print_error
+from lib.version import ELECTRUM_VERSION as version
 
 
-name = "Electrum"
-mainscript = 'electrum'
+name = "Electrum-NVC"
+mainscript = 'electrum-nvc'
 
-if sys.version_info[:3] < (2,6,0):
+if sys.version_info[:3] < (2, 6, 0):
     print_error("Error: " + name + " requires Python version >= 2.6.0...")
     sys.exit(1)
 
@@ -32,10 +36,10 @@ if sys.platform == 'darwin':
         setup_requires=['py2app'],
         app=[mainscript],
         options=dict(py2app=dict(argv_emulation=True,
-                                 includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip'],
-                                 packages = ['lib', 'gui', 'plugins'],
+                                 includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'PyQt4.QtWebKit', 'PyQt4.QtNetwork', 'sip'],
+                                 packages=['lib', 'gui', 'plugins'],
                                  iconfile='electrum.icns',
-#                                 plist=plist,
+                                 plist=plist,
                                  resources=["data", "icons"])),
     )
 elif sys.platform == 'win32':
@@ -51,8 +55,8 @@ else:
     )
 
 setup(
-    name = name,
-    version = version,
+    name=name,
+    version=version,
     **extra_options
 )
 from distutils import dir_util
@@ -66,16 +70,20 @@ if sys.platform == 'darwin':
     # Try to locate qt_menu
     # Let's try the port version first!
     if os.path.isfile("/opt/local/lib/Resources/qt_menu.nib"):
-      qt_menu_location = "/opt/local/lib/Resources/qt_menu.nib"
+        qt_menu_location = "/opt/local/lib/Resources/qt_menu.nib"
     else:
-      # No dice? Then let's try the brew version
-      qt_menu_location = os.popen("find /usr/local/Cellar -name qt_menu.nib | tail -n 1").read()
-      qt_menu_location = re.sub('\n','', qt_menu_location)
+        # No dice? Then let's try the brew version
+        if os.path.exists("/usr/local/Cellar"):
+            qt_menu_location = os.popen("find /usr/local/Cellar -name qt_menu.nib | tail -n 1").read()
+        # no brew, check /opt/local
+        else:
+            qt_menu_location = os.popen("find /opt/local -name qt_menu.nib | tail -n 1").read()
+        qt_menu_location = re.sub('\n', '', qt_menu_location)
 
-    if(len(qt_menu_location) == 0):
-      print "Sorry couldn't find your qt_menu.nib this probably won't work"
+    if (len(qt_menu_location) == 0):
+        print "Sorry couldn't find your qt_menu.nib this probably won't work"
     else:
-      print "Found your qib: " + qt_menu_location
+        print "Found your qib: " + qt_menu_location
 
     # Need to include a copy of qt_menu.nib
     shutil.copytree(qt_menu_location, resource + "qt_menu.nib")