Skip to content

Commit

Permalink
Add install script
Browse files Browse the repository at this point in the history
* Rename package from source to monorail
* Add distutils setup script
  • Loading branch information
Thomas Zimmermann committed Nov 23, 2012
1 parent c984341 commit 245cc81
Show file tree
Hide file tree
Showing 85 changed files with 135 additions and 43 deletions.
30 changes: 30 additions & 0 deletions MANIFEST.in
@@ -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 *
4 changes: 4 additions & 0 deletions MysticMine
@@ -0,0 +1,4 @@
#!/usr/bin/env python
import monorail.monorail

monorail.monorail.main()
1 change: 1 addition & 0 deletions README
File renamed without changes.
Binary file added monorail/__init__.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added monorail/ai.so
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.
Binary file added monorail/koon/__init__.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added monorail/koon/cfg.pyc
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.
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.
2 changes: 1 addition & 1 deletion source/setup_py2app.py → monorail/setup_py2app.py
Expand Up @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion source/tests/test_ai.py → monorail/tests/test_ai.py
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions source/tests/test_control.py → monorail/tests/test_control.py
@@ -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:

Expand Down
4 changes: 2 additions & 2 deletions source/tests/test_frame.py → monorail/tests/test_frame.py
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion source/tests/test_geo.py → monorail/tests/test_geo.py
@@ -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 ):
Expand Down
2 changes: 1 addition & 1 deletion source/tests/test_menu.py → monorail/tests/test_menu.py
@@ -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")
Expand Down
Expand Up @@ -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:

Expand Down
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions source/tests/test_player.py → monorail/tests/test_player.py
@@ -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()
Expand Down
Expand Up @@ -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")
Expand Down
Expand Up @@ -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:

Expand Down
Expand Up @@ -2,8 +2,8 @@

import os

from source.settings import *
from source.scenarios import *
from monorail.settings import *
from monorail.scenarios import *


class TestSettings:
Expand Down
4 changes: 2 additions & 2 deletions source/tests/test_tiles.py → monorail/tests/test_tiles.py
Expand Up @@ -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:

Expand Down
10 changes: 5 additions & 5 deletions source/tests/test_world.py → monorail/tests/test_world.py
Expand Up @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions setup.py
@@ -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",
],
)
Binary file removed source/__init__.pyc
Binary file not shown.
Binary file removed source/ai.so
Binary file not shown.
Binary file removed source/koon/__init__.pyc
Binary file not shown.
Binary file removed source/koon/cfg.pyc
Binary file not shown.

0 comments on commit 245cc81

Please sign in to comment.