-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
75 lines (59 loc) · 2.26 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from distutils.core import setup
import os
import sys
from os.path import join
NAME = 'LibRPG'
VERSION = '0.5'
def recursive_list_dir(dir):
data = []
for path, _, files in os.walk(join('librpg', dir)):
for filename in files:
p = path.split('\\')
data.append(join('\\'.join(p[1:]), filename))
return data
def get_data_files(test, tools):
data = []
data.extend(recursive_list_dir('data'))
if test:
data.append(join('test', '*.*'))
data.append(join('test', 'worldtest', '*.*'))
if tools:
data.append(join('tools', 'charset', '*.scm'))
data.append(join('tools', 'charset', '*.py'))
data.append(join('tools', 'tileset', '*.py'))
return data
def main():
# if sys.version < '2.6':
# sys.exit('ERROR: Sorry, python 2.6 is required for LibRPG.')
if '--complete' in sys.argv:
data = get_data_files(test=True, tools=True)
sys.argv.remove('--complete')
else:
data = get_data_files(test=False, tools=False)
setup(name=NAME,
version=VERSION,
provides=['librpg'],
author='Henrique Nakashima',
author_email='[email protected]',
url='http://code.google.com/p/librpg/',
license='LGPL',
description='A framework over Pygame for developing 2D RPGs',
long_description='A framework based on Pygame for developing \
old-school 2D tile-based RPGs.',
packages = ['librpg', 'librpg.menu', 'librpg.collection'],
package_dir={'librpg': 'librpg',
'librpg.menu': os.path.join('librpg', 'menu'),
'librpg.collection': os.path.join('librpg', 'collection')},
package_data={'librpg': data})
if __name__ == '__main__':
main()
# To install
# python setup.py install
# To build a .zip
# python setup.py bdist --format=zip
# To build an .exe Windows installer
# python setup.py bdist --formats=wininst
# To build an .exe Windows 64-bit installer
# python setup.py build --plat-name=win-amd64 bdist_wininst
# To include tests/ and tools/ in any dist
# Add '--complete' to the end of the command line