[TIC-CORE] Initial Import
[archive/20170607/tools/tic-core.git] / setup.py
1 #!/usr/bin/python
2 # Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3 #
4 # Contact: 
5 # @author Chulwoo Shin <cw1.shin@samsung.com>
6
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 # Contributors:
20 # - S-Core Co., Ltd
21
22 import os, sys
23 from distutils.core import setup
24 try:
25     import setuptools
26     # enable "setup.py develop", optional
27 except ImportError:
28     pass
29
30 MOD_NAME = 'tic'
31
32 version_path = 'VERSION'
33
34 if not os.path.isfile(version_path):
35     print('No VERSION file in topdir, abort')
36     sys.exit(1)
37
38 try:
39     # first line should be the version number
40     version = open(version_path).readline().strip()
41     if not version:
42         print('VERSION file is invalid, abort')
43         sys.exit(1)
44
45     ver_file = open('%s/__version__.py' % MOD_NAME, 'w')
46     ver_file.write("VERSION = \"%s\"\n" % version)
47     ver_file.close()
48 except IOError:
49     print('WARNING: Cannot write version number file')
50
51 setup(name=MOD_NAME,
52       version = version,
53       description='package dependency analyzer for image creation',
54       author='Chulwoo Shin',
55       author_email='cw1.shin@samsung.com',
56       url='https://',
57       scripts=['tools/tic-core'],
58       packages=['tic',
59                 'tic.parser',
60                 'tic.server',
61                 'tic.utils'] 
62      )