-
Notifications
You must be signed in to change notification settings - Fork 3
/
win-setup.py
executable file
·93 lines (80 loc) · 2.65 KB
/
win-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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/python
# setup.py
import glob
import os
import subprocess
from distutils.core import setup
import py2exe
# update the svn revision number
REVISION_FILE = 'exe/engine/version_svn.py'
try:
os.unlink(REVISION_FILE)
except OSError:
pass
try:
psvn = subprocess.Popen('svnversion', stdout=subprocess.PIPE)
psvn.wait()
revision = psvn.stdout.read().strip()
open(REVISION_FILE, 'wt').write('revision = "%s"\n' % revision)
except OSError:
print "*** Warning: 'svnversion' tool not available to update revision number"
from exe.engine import version
g_files = { '.': ["README",
"COPYING",
"NEWS",
"ChangeLog",
"eXe_icon.ico",
"exe/webui/mr_x.gif",
"exe/msvcr71.dll",
"installs/windows/exeLicense.txt",]}
g_oldBase = "exe/webui"
g_newBase = "."
def dataFiles(dirs, excludes=[]):
"""Recursively get all the files in these directories"""
for file in dirs:
if not os.path.basename(file[0]).startswith("."):
if os.path.isfile(file):
path = file[len(g_oldBase)+1:]
dir = os.path.join(g_newBase, os.path.dirname(path))
if os.path.basename(path) not in excludes:
if dir in g_files:
g_files[dir].append(file)
else:
g_files[dir] = [file]
elif os.path.isdir(file):
dataFiles(glob.glob(file+"/*"), excludes)
dataFiles(["exe/webui/style",
"exe/webui/css",
"exe/webui/images",
"exe/webui/docs",
"exe/webui/linux-profile",
"exe/webui/scripts",
"exe/webui/schemas",
"exe/webui/templates"],
excludes = ['mimetex.cgi', 'mimetex.64.cgi', 'mimetex-darwin.cgi'])
g_oldBase = "exe"
g_newBase = "."
dataFiles(["exe/locale"])
g_oldBase = "exe/xului"
g_newBase = "."
dataFiles(["exe/xului/templates",
"exe/xului/scripts"])
opts = {
"py2exe": {
"packages": ["encodings", "nevow", "nevow.flat"],
"includes": ["PngImagePlugin", "JpegImagePlugin", "GifImagePlugin",
"IcoImagePlugin", "BmpImagePlugin"],
}
}
setup(windows=["exe/exe"],
version=version.build,
packages=["exe", "exe.engine", "exe.webui", "exe.export", "exe.xului"],
description = "eLearning XHTML editor",
url = "http://exelearning.org",
author = "eXe Project",
author_email = "[email protected]",
license = "GPL",
scripts = ["exe/exe",],
options = opts,
data_files = g_files.items(),
)