Permalink
Browse files

Add install script

* Rename package from source to monorail
* Add distutils setup script
  • Loading branch information...
1 parent c984341 commit 245cc81bfb76d90e40e194e09e20b84c6592147f Thomas Zimmermann committed Nov 23, 2012
Showing with 135 additions and 43 deletions.
  1. +30 −0 MANIFEST.in
  2. +4 −0 MysticMine
  3. +1 −0 README
  4. 0 {source/tests → monorail}/__init__.py
  5. BIN monorail/__init__.pyc
  6. 0 {source → monorail}/ai.c
  7. BIN {source → monorail}/ai.pyd
  8. 0 {source → monorail}/ai.pyx
  9. BIN monorail/ai.so
  10. 0 {source → monorail}/control.py
  11. 0 {source → monorail}/controlview.py
  12. 0 {source → monorail}/create_app.sh
  13. 0 {source → monorail}/create_exe.bat
  14. 0 {source → monorail}/create_freeze.sh
  15. 0 {source → monorail}/error_mm.log
  16. 0 {source → monorail}/event.py
  17. 0 {source → monorail}/eventview.py
  18. BIN {source → monorail}/fonts/freesansbold.ttf
  19. 0 {source → monorail}/frame.py
  20. 0 {source → monorail}/highscores.dic
  21. 0 {source → monorail}/hud.py
  22. BIN {source → monorail}/icon.icns
  23. BIN {source → monorail}/icon.ico
  24. 0 {source/koon/tests → monorail/koon}/__init__.py
  25. BIN monorail/koon/__init__.pyc
  26. 0 {source → monorail}/koon/app.py
  27. 0 {source → monorail}/koon/build.py
  28. BIN {source → monorail}/koon/build.pyc
  29. 0 {source → monorail}/koon/cfg.py
  30. BIN monorail/koon/cfg.pyc
  31. 0 {source → monorail}/koon/geo.py
  32. 0 {source → monorail}/koon/gfx.py
  33. 0 {source → monorail}/koon/gui.py
  34. 0 {source → monorail}/koon/input.py
  35. 0 {source → monorail}/koon/res.py
  36. 0 {source → monorail}/koon/snd.py
  37. 0 {source/koon → monorail/koon/tests}/__init__.py
  38. 0 {source → monorail}/koon/tests/test_cfg.py
  39. 0 {source → monorail}/koon/tests/test_geo.py
  40. 0 {source → monorail}/koon/tests/test_gfx.py
  41. 0 {source → monorail}/koon/tests/test_gui.py
  42. 0 {source → monorail}/koon/tests/test_input.py
  43. 0 {source → monorail}/koon/tests/test_res.py
  44. 0 {source → monorail}/koon/tests/test_snd.py
  45. 0 {source → monorail}/mac_ai/ai.c
  46. BIN {source → monorail}/mac_ai/ai.so
  47. 0 {source → monorail}/menu.py
  48. 0 {source → monorail}/monkey.py
  49. 0 {source → monorail}/monorail.py
  50. 0 {source → monorail}/pickups.py
  51. 0 {source → monorail}/pickupsview.py
  52. 0 {source → monorail}/player.py
  53. 0 {source → monorail}/playerview.py
  54. 0 {source → monorail}/profile.py
  55. BIN {source → monorail}/quest.stat
  56. 0 {source → monorail}/scenarios.py
  57. 0 {source → monorail}/settings.py
  58. 0 {source → monorail}/setup.py
  59. +1 −1 {source → monorail}/setup_py2app.py
  60. 0 {source → monorail}/setup_py2exe.py
  61. 0 {source → monorail}/sndman.py
  62. 0 {source → monorail/tests}/__init__.py
  63. BIN {source → monorail}/tests/levelTest.lvl
  64. +1 −1 {source → monorail}/tests/test_ai.py
  65. +5 −5 {source → monorail}/tests/test_control.py
  66. +2 −2 {source → monorail}/tests/test_frame.py
  67. +1 −1 {source → monorail}/tests/test_geo.py
  68. +1 −1 {source → monorail}/tests/test_menu.py
  69. +4 −4 {source → monorail}/tests/test_pickups.py
  70. +6 −6 {source → monorail}/tests/test_pickupsview.py
  71. +4 −4 {source → monorail}/tests/test_player.py
  72. +6 −6 {source → monorail}/tests/test_playerview.py
  73. +3 −3 {source → monorail}/tests/test_scenarios.py
  74. +2 −2 {source → monorail}/tests/test_settings.py
  75. +2 −2 {source → monorail}/tests/test_tiles.py
  76. +5 −5 {source → monorail}/tests/test_world.py
  77. 0 {source → monorail}/tiles.py
  78. 0 {source → monorail}/tilesview.py
  79. 0 {source → monorail}/world.py
  80. 0 {source → monorail}/worldview.py
  81. +57 −0 setup.py
  82. BIN source/__init__.pyc
  83. BIN source/ai.so
  84. BIN source/koon/__init__.pyc
  85. BIN source/koon/cfg.pyc
View
@@ -0,0 +1,30 @@
+include README README.md setup.py build.py LICENSE.txt MysticMine
+
+include locales/gettext.sh locales/messages.pot locales/de_DE.po locales/en_US.po locales/ru_RU.po
+
+include data/800x600/edmunds.ttf data/800x600/font_default.fnt data/800x600/font_default.png data/800x600/resources.cfg
+
+include monorail/fonts/freesansbold.ttf
+
+include monorail/__init__.py monorail/ai.pyx monorail/control.py monorail/controlview.py monorail/event.py
+include monorail/eventview.py monorail/frame.py monorail/hud.py monorail/menu.py monorail/monkey.py
+include monorail/monorail.py monorail/pickups.py monorail/pickupsview.py monorail/player.py
+include monorail/playerview.py monorail/profile.py monorail/scenarios.py monorail/settings.py
+include monorail/setup.py monorail/setup_py2app.py monorail/setup_py2exe.py monorail/sndman.py
+include monorail/tiles.py monorail/tilesview.py monorail/world.py monorail/worldview.py
+
+include monorail/koon/__init__.py monorail/koon/app.py monorail/koon/build.py monorail/koon/cfg.py monorail/koon/geo.py
+include monorail/koon/gfx.py monorail/koon/gui.py monorail/koon/input.py monorail/koon/res.py monorail/koon/snd.py
+
+include monorail/tests/__init__.py monorail/tests/test_ai.py monorail/tests/test_control.py monorail/tests/test_frame.py
+include monorail/tests/test_geo.py monorail/tests/test_menu.py monorail/tests/test_pickups.py monorail/tests/test_pickupsview.py
+include monorail/tests/test_player.py monorail/tests/test_playerview.py monorail/tests/test_scenarios.py
+include monorail/tests/test_settings.py monorail/tests/test_tiles.py monorail/tests/test_world.py
+
+recursive-include data/800x600/gfx *
+recursive-include data/800x600/levels *
+recursive-include data/800x600/locale *
+recursive-include data/800x600/music *
+recursive-include data/800x600/snd *
+
+recursive-include assets *
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+import monorail.monorail
+
+monorail.monorail.main()
View
File renamed without changes.
View
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@
APP = ['monorail.py']
DATA_FILES = ['error_mm.log', 'quest.stat']
OPTIONS = {'argv_emulation': True,
- 'iconfile': '/Users/koenwitters/monorail/source/icon.icns'}
+ 'iconfile': '/Users/koenwitters/monorail/monorail/icon.icns'}
setup(
app=APP,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import source.ai as ai
+import monorail.ai as ai
class SimpleNode (ai.Node):
"""AiNode for use in the unit tests
@@ -1,10 +1,10 @@
#!/usr/bin/env python
-from source.koon.geo import Vec3D
-from source.world import *
-from source.tiles import *
-import source.control as ctrl
-import source.ai as ai
+from monorail.koon.geo import Vec3D
+from monorail.world import *
+from monorail.tiles import *
+import monorail.control as ctrl
+import monorail.ai as ai
class TestGroundControl:
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-from source.koon.gfx import Surface
+from monorail.koon.gfx import Surface
-from source.frame import *
+from monorail.frame import *
def setup_module( module ):
resman.read("data/resources.cfg")
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from source.koon.geo import Vec3D
+from monorail.koon.geo import Vec3D
class TestVec3D:
def test_constructor( self ):
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from source.menu import *
+from monorail.menu import *
def setup_module( module ):
resman.read("data/resources.cfg")
@@ -2,11 +2,11 @@
import os
-from source.koon.res import resman
+from monorail.koon.res import resman
-from source.pickups import *
-from source.player import *
-from source.tiles import *
+from monorail.pickups import *
+from monorail.player import *
+from monorail.tiles import *
class TestFlag:
@@ -4,13 +4,13 @@
import pygame
-from source.koon.res import resman
-import source.koon.gfx as gfx
-import source.koon.geo as geo
+from monorail.koon.res import resman
+import monorail.koon.gfx as gfx
+import monorail.koon.geo as geo
-import source.pickups as pickups
-import source.pickupsview as pickupsview
-import source.frame as m_frame
+import monorail.pickups as pickups
+import monorail.pickupsview as pickupsview
+import monorail.frame as m_frame
def setup_module( module ):
resman.read("data/resources.cfg")
@@ -1,9 +1,9 @@
#!/usr/bin/env python
-from source.koon.geo import Vec3D
-from source.tiles import *
-from source.player import *
-from source.world import Level, Playfield
+from monorail.koon.geo import Vec3D
+from monorail.tiles import *
+from monorail.player import *
+from monorail.world import Level, Playfield
def setup_module( module ):
pygame.init()
@@ -4,13 +4,13 @@
import pygame
-from source.koon.res import resman
-import source.koon.gfx as gfx
-import source.koon.geo as geo
+from monorail.koon.res import resman
+import monorail.koon.gfx as gfx
+import monorail.koon.geo as geo
-import source.player as m_player
-import source.playerview as m_playerview
-import source.frame as m_frame
+import monorail.player as m_player
+import monorail.playerview as m_playerview
+import monorail.frame as m_frame
def setup_module( module ):
resman.read("data/resources.cfg")
@@ -2,9 +2,9 @@
import os
-from source.scenarios import *
-from source.world import Level
-from source.world import Playfield
+from monorail.scenarios import *
+from monorail.world import Level
+from monorail.world import Playfield
class TestQuestManager:
@@ -2,8 +2,8 @@
import os
-from source.settings import *
-from source.scenarios import *
+from monorail.settings import *
+from monorail.scenarios import *
class TestSettings:
@@ -2,8 +2,8 @@
import os
-from source.tiles import *
-from source.koon.geo import Vec3D
+from monorail.tiles import *
+from monorail.koon.geo import Vec3D
class TestDirection:
@@ -2,11 +2,11 @@
import os
-from source.koon.geo import Vec3D
-from source.tiles import Tile, Direction, Trail
-from source.world import Level, Playfield
-from source.player import *
-from source.pickups import *
+from monorail.koon.geo import Vec3D
+from monorail.tiles import Tile, Direction, Trail
+from monorail.world import Level, Playfield
+from monorail.player import *
+from monorail.pickups import *
class TestLevel:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+from distutils.core import Extension, setup
+from distutils.command.install import INSTALL_SCHEMES
+from Pyrex.Distutils import build_ext
+import os
+
+# http://stackoverflow.com/questions/1612733/including-non-python-files-with-setup-py
+for scheme in INSTALL_SCHEMES.values():
+ scheme['data'] = scheme['purelib']
+
+def find_data_files(srcdir, *wildcard):
+ file_list = []
+ if not srcdir.endswith('/'):
+ srcdir+='/'
+ for files in os.listdir(srcdir):
+ if files.endswith(wildcard):
+ file_list.append(srcdir+files)
+ return file_list
+
+gfx = find_data_files('data/800x600/gfx/', '.png')
+levels = find_data_files('data/800x600/levels/', '.lvl')
+music = find_data_files('data/800x600/music/', '.ogg')
+snd = find_data_files('data/800x600/snd/', '.wav')
+
+setup( name='MysticMine',
+ version='1.0.0',
+ author='koonsolo',
+ author_email='info@koonsolo.com',
+ description='A one switch game',
+ url='http://www.koonsolo.com/mysticmine/',
+ download_url='http://github.com/koonsolo/MysticMine',
+ license='LICENSE.txt',
+ scripts=['MysticMine'],
+ packages=['monorail','monorail.koon','monorail.tests'],
+ data_files=[('monorail/fonts',['monorail/fonts/freesansbold.ttf']),
+ ('monorail/data',['data/800x600/edmunds.ttf','data/800x600/font_default.fnt',
+ 'data/800x600/font_default.png','data/800x600/resources.cfg',
+ ]
+ ),
+ ('monorail/data/locale/en_US/LC_MESSAGES/',['data/800x600/locale/en_US/LC_MESSAGES/monorail.mo']),
+ ('monorail/data/locale/de_DE/LC_MESSAGES/',['data/800x600/locale/de_DE/LC_MESSAGES/monorail.mo']),
+ ('monorail/data/locale/ru_RU/LC_MESSAGES/',['data/800x600/locale/ru_RU/LC_MESSAGES/monorail.mo']),
+ ('monorail/data/gfx',gfx),
+ ('monorail/data/levels',levels),
+ ('monorail/data/music',music),
+ ('monorail/data/snd',snd),
+ ],
+ ext_modules=[
+ Extension("monorail.ai", ["monorail/ai.pyx"])
+ ],
+ cmdclass = {'build_ext': build_ext},
+ install_requires=[
+ "pygame",
+ "numpy",
+ "pyrex",
+ ],
+)
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.

0 comments on commit 245cc81

Please sign in to comment.