aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
blob: f5dc14610ae4b77e5d36d384a22768d301014cb0 (plain)
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
#!/usr/bin/python
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from os.path import isfile, join
import glob, os, shutil, gzip


# Get PYTHONLIB with no prefix so --prefix installs work.
PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages')

# Tiny hack to make rteval-cmd become a rteval when building/installing the package
try:
    os.mkdir('dist', 0755)
    distcreated = True
except OSError, 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)
man = open('doc/rteval.8', 'r')
mangz.writelines(man)
man.close()
mangz.close()


# Do the distutils stuff
setup(name="rteval",
      version = RTEVAL_VERSION,
      description = "Evaluate system performance for Realtime",
      author = "Clark Williams, David Sommerseth",
      author_email = "williams@redhat.com, davids@redhat.com",
      url = "https://git.kernel.org/?p=linux/kernel/git/clrkwllms/rteval.git;a=summary",
      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')
os.unlink('dist/__init__.pyc')

if distcreated:
    try:
        os.rmdir('dist')
    except OSError:
        # Ignore any errors
        pass