Make chess puzzle level (Kasparov to F3) winnable.
[naja.git] / setup.py
index e8042f9e8b1d5ae967bed2da00bbeda10a72a98c..abbfcb43079918e648ca7a7498191d5cdcfcdd31 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,9 +2,13 @@
 # -*- coding: utf8 -*-
 # vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
 
-"""Setuptools setup.py file for naja."""
+"""Setuptools setup.py file for Robolock II."""
 
 from setuptools import setup, find_packages
+from setuptools.command.sdist import sdist
+from setuptools.command.install import install
+
+from tools import gen_json
 
 try:
     import py2exe
@@ -12,28 +16,44 @@ try:
 except ImportError:
     pass
 
+
 # This should probably be pulled from constants.py
+# These two constants are used by darwin-py2app.sh.
 VERSION_STR = "0.1"
+NAME_STR = "robolock-II"
+
+
+class NajaSdist(sdist):
+    def run(self):
+        gen_json.main()
+        sdist.run(self)
+
+
+class NajaInstall(install):
+    def run(self):
+        gen_json.main(update=False)
+        install.run(self)
+
 
 setup(
-    name="naja",
+    name=NAME_STR,
     version=VERSION_STR,
-    description="naja: Game for PyWeek 18",
+    description="Robolock II - a puzzle game",
 
     author=(", ".join([
         "Simon Cross",
         "Neil Muller",
-        "Adrianna Pinska",
+        "Adrianna Pińska",
         "Stefano Rivera",
         "David Sharpe",
         "Jeremy Thurgood",
     ])),
     author_email="ctpug@googlegroups.com",
 
-    maintainer="Naja Team",
+    maintainer="Team Naja (CTPUG)",
     maintainer_email="ctpug@googlegroups.com",
 
-    url="http://ctpug.org.za/",
+    url="http://robolock.org/",
     download_url="http://ctpug.org.za/git/naja",
 
     license="MIT",
@@ -63,6 +83,9 @@ setup(
     # Dependencies
     install_requires=[
         'pygame',
+    ],
+
+    setup_requires=[
         'PyYAML',
     ],
 
@@ -72,6 +95,11 @@ setup(
         'scripts/naja',
     ],
 
+    cmdclass={
+        'sdist': NajaSdist,
+        'install': NajaInstall,
+    },
+
     # py2exe
     windows=[{
         'script': 'scripts/naja',
@@ -89,10 +117,10 @@ setup(
                 'pygame',
             ],
             'excludes': [
-                'numpy', 'pygame.sdlmain_osx', 'winreg', 'AppKit', 'Foundation',
-                'Numeric', 'OpenGL.GL', '_scproxy', '_sysconfigdata',
-                'copyreg', 'dummy.Process', 'pkg_resources', 'queue',
-                'win32evtlog', 'win32evtlogutil',
+                'numpy', 'pygame.sdlmain_osx', 'winreg', 'AppKit',
+                'Foundation', 'Numeric', 'OpenGL.GL', '_scproxy',
+                '_sysconfigdata', 'copyreg', 'dummy.Process', 'pkg_resources',
+                'queue', 'win32evtlog', 'win32evtlogutil',
             ],
             'ignores': [
                 # all database modules
@@ -111,7 +139,7 @@ setup(
         'py2app': {
             'app': ['run_game.py'],
             'argv_emulation': True,
-            'iconfile': 'data/icons/program/icon.icns',
+            'iconfile': 'data/icons/robolock.icns',
             'packages': [
                 'logging', 'encodings', 'pygame', 'naja', 'data',
             ],