-
Notifications
You must be signed in to change notification settings - Fork 3
/
rpm-setup.py
executable file
·76 lines (70 loc) · 2.43 KB
/
rpm-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
#!/usr/bin/python
# setup.py
import glob
import os.path
from distutils.command.install import install
from distutils.core import setup
from exe.engine import version
g_files = { '/usr/share/exe': ["README",
"COPYING",
"NEWS",
"ChangeLog",
"exe/webui/mr_x.gif"]}
g_oldBase = "exe/webui"
g_newBase = "/usr/share/exe"
def dataFiles(dirs, excludes=[]):
"""Recursively get all the files in these directories"""
import os.path
import glob
global dataFiles, g_oldBase, g_newBase, g_files
for file in dirs:
if not os.path.basename(file[0]).startswith("."):
if os.path.isfile(file) and file not in excludes:
path = file[len(g_oldBase)+1:]
dir = g_newBase + "/" + os.path.dirname(path)
if dir in g_files:
g_files[dir].append(file)
else:
g_files[dir] = [file]
elif os.path.isdir(file):
dataFiles(glob.glob(file+"/*"))
dataFiles(["exe/webui/style",
"exe/webui/css",
"exe/webui/docs",
"exe/webui/images",
"exe/webui/schemas",
"exe/webui/scripts",
"exe/webui/templates",
"exe/webui/linux-profile",
"exe/webui/firefox"],
excludes = ["mimetex.64.cgi", "mimetex-darwin.cgi", "mimetex.exe"])
g_oldBase = "exe"
g_newBase = "/usr/share/exe"
dataFiles(["exe/locale"])
g_oldBase = "exe/xului"
g_newBase = "/usr/share/exe"
dataFiles(["exe/xului/scripts",
"exe/xului/templates"])
opts = {
"bdist_rpm": {
"requires": ["python-imaging",]
}
}
setup(name = version.project,
version = version.release,
description = "eLearning XHTML editor",
long_description = """\
The eXe project is an authoring environment to enable teachers to publish
web content without the need to become proficient in HTML or XML markup.
Content generated using eXe can be used by any Learning Management System.
""",
url = "http://exelearning.org",
author = "eXe Project",
author_email = "[email protected]",
license = "GPL",
scripts = ["exe/exe"],
packages = ["exe", "exe.webui", "exe.xului",
"exe.engine", "exe.export"],
data_files = g_files.items(),
options = opts
)