fix retry issue
[test/tools/testkit-lite.git] / setup.py
1 #!/usr/bin/python
2 #
3 # Copyright (C) 2012 Intel Corporation
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # Authors:
16 #              Yuanyuan,Zou  <yuanyuanx.zou@intel.com>
17
18 from setuptools import setup, find_packages
19 import os
20 from stat import ST_MODE, S_ISDIR
21 from distutils.command.install_data import install_data
22
23
24 class post_install_cmd(install_data):
25     def run (self):
26         install_data.run(self)
27         if os.name == 'posix':
28             for path in ['/opt/testkit/lite','/opt/testkit/lite/commodule/']:
29                 try:
30                     mode = os.stat(path)[ST_MODE]
31                     mode |= 066
32                     os.chmod(path, mode)
33                 except OSError as err:
34                     pass
35
36
37 setup(
38     name = "testkit-lite",
39     description = "Test runner for test execution",
40     url = "https://github.com/testkit/testkit-lite",
41     author = "Shaofeng Tang",
42     author_email = "shaofeng.tang@intel.com",
43     version = "3.1.7",
44     include_package_data = True,
45     data_files = [('/opt/testkit/lite', ['VERSION', 'doc/testkit-lite_user_guide.pdf', 'doc/testkit-lite_tutorial.pdf', 'doc/test_definition_schema.pdf']),
46                   ('/opt/testkit/lite/commodule/', ['CONFIG']),
47                   ('/opt/testkit/lite', ['resource/mh.html']),
48                   ('/etc/dbus-1/system.d/', ['dbus/com.intel.testkit.conf'])],
49     scripts = ('testkit-lite', 'dbus/testkit-lite-dbus'),
50     packages = find_packages(),
51     cmdclass = {'install_data': post_install_cmd},
52 )