-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·70 lines (59 loc) · 2.01 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
#!/usr/bin/env python
# Use distutils as setuptools tries to be too smart and confuses
# everying.
from distutils.core import setup
from distutils import sysconfig
import shutil
import sys
import os.path
import sys
print sys.path
print sysconfig.get_config_var('prefix')
# add cwd to installed single player XML file
import fileinput
of = open("daneel-ai.xml", 'w')
for line in fileinput.FileInput("daneel-ai.xml.in"):
if 'PREFIX' in line:
line = line.replace('PREFIX', sysconfig.get_config_var('prefix'))
of.write(line)
of.close()
extra_arguments = {}
if sys.platform == 'win32':
from setuptools import setup
import py2exe
if os.path.exists("dist"):
shutil.rmtree("dist")
if os.path.exists("tp"):
shutil.rmtree("tp")
shutil.copytree(os.path.join('libtpproto-py', 'tp', 'netlib'), os.path.join('tp', 'netlib'))
shutil.copytree(os.path.join('libtpclient-py', 'tp', 'client'), os.path.join('tp', 'client'))
open(os.path.join('tp', "__init__.py"), 'w').close()
extra_arguments = dict(
options={
"py2exe": {
"dll_excludes": [],
"packages": ["tp.netlib", "tp.client"],
"includes": ["daneel.*"],
"excludes": ["Tkconstants", "Tkinter", "tcl", "pydoc" ],
"optimize": 2,
"compressed": 0,
}
},
)
setup(
name = "daneel-ai",
version = "0.0.3",
license = "GPL",
description = "An advanced rule based AI for Thousand Parsec.",
long_description = "",
author = "Vincent Verhoeven",
author_email = "verhoevenv@gmail.com",
url = "http://www.thousandparsec.net",
scripts = ["daneel-ai"],
console = ["daneel-ai"],
packages = ["daneel"],
data_files = [("share/daneel-ai", ("LICENSE", "COPYING", "README")),
("share/daneel-ai/rules", ("rules/rfts", "rules/risk")),
("share/tp", ("daneel-ai.xml",))],
**extra_arguments
)