-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
94 lines (83 loc) · 3.13 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0-or-later
""" install rteval """
import sysconfig
from os.path import relpath
import os
import shutil
import gzip
from setuptools import setup
# Get PYTHONLIB with no prefix so --prefix installs work.
SCHEME = 'rpm_prefix'
if SCHEME not in sysconfig.get_scheme_names():
SCHEME = 'posix_prefix'
PYTHONLIB = relpath(sysconfig.get_path('platlib', SCHEME), '/usr')
# Tiny hack to make rteval-cmd become a rteval when building/installing the package
try:
os.mkdir('dist', 0o755)
distcreated = True
except OSError as e:
if e.errno == 17:
# If it already exists, ignore this error
distcreated = False
else:
raise e
shutil.copy('rteval-cmd','dist/rteval')
# Hack to avoid importing libxml2 and a lot of other stuff
# when getting the rteval version. These are modules which
# might not be available on the build box.
shutil.copy('rteval/version.py','dist/__init__.py')
from dist import RTEVAL_VERSION
# Compress the man page, so distutil will only care for the compressed file
mangz = gzip.GzipFile('dist/rteval.8.gz', 'w', 9)
with open('doc/rteval.8', 'rb') as man:
mangz.writelines(man)
mangz.close()
# Do the setup stuff
setup(name="rteval",
version = RTEVAL_VERSION,
description = "Evaluate system performance for Realtime",
author = "Clark Williams, David Sommerseth",
author_email = "[email protected], [email protected]",
url = "https://git.kernel.org/pub/scm/utils/rteval/rteval.git",
license = "GPLv2",
long_description =
"""\
The rteval script is used to judge the behavior of a hardware
platform while running a Realtime Linux kernel under a moderate
to heavy load.
Provides control logic for starting a system load and then running a
response time measurement utility (cyclictest) for a specified amount
of time. When the run is finished, the sample data from cyclictest is
analyzed for standard statistical measurements (i.e mode, median, range,
mean, variance and standard deviation) and a report is generated.
""",
packages = ["rteval",
"rteval.modules",
"rteval.modules.loads",
"rteval.modules.measurement",
"rteval.sysinfo"],
package_dir = { "rteval": "rteval",
"rteval.modules": "rteval/modules",
"rteval.modules.loads": "rteval/modules/loads",
"rteval.modules.measurement": "rteval/modules/measurement",
"rteval.sysinfo": "rteval/sysinfo"
},
data_files = [("share/rteval", ["rteval/rteval_dmi.xsl",
"rteval/rteval_histogram_raw.xsl",
"rteval/rteval_text.xsl"]),
("/etc", ["rteval.conf"]),
("share/man/man8", ["dist/rteval.8.gz"])
],
scripts = ["dist/rteval"]
)
# Clean-up from our little hack
os.unlink('dist/rteval')
os.unlink('dist/rteval.8.gz')
os.unlink('dist/__init__.py')
if distcreated:
try:
os.rmdir('dist')
except OSError:
# Ignore any errors
pass