Merge pull request #45 from liuct/add-tizen-localmode
[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                 mode = os.stat(path)[ST_MODE]
30                 mode |= 066
31                 os.chmod(path, mode)
32
33
34 setup(
35     name = "testkit-lite",
36     description = "Test runner for test execution",
37     url = "https://github.com/testkit/testkit-lite",
38     author = "Shaofeng Tang",
39     author_email = "shaofeng.tang@intel.com",
40     version = "3.0.10",
41     include_package_data = True,
42     data_files = [('/opt/testkit/lite', ['VERSION', 'doc/testkit-lite_user_guide.pdf', 'doc/testkit-lite_tutorial.pdf', 'doc/test_definition_schema.pdf']),
43                   ('/opt/testkit/lite/commodule/', ['CONFIG']),
44                   ('/etc/dbus-1/system.d/', ['dbus/com.intel.testkit.conf'])],
45     scripts = ('testkit-lite', 'testkit-lite-dbus'),
46     packages = find_packages(),
47     cmdclass = {'install_data': post_install_cmd},
48 )