[TIC-CORE] supports new recipe
[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
25 MOD_NAME = 'tic'
26
27 version_path = 'VERSION'
28
29 if not os.path.isfile(version_path):
30     print('No VERSION file in topdir, abort')
31     sys.exit(1)
32
33 try:
34     # first line should be the version number
35     version = open(version_path).readline().strip()
36     if not version:
37         print('VERSION file is invalid, abort')
38         sys.exit(1)
39
40     ver_file = open('%s/__version__.py' % MOD_NAME, 'w')
41     ver_file.write("VERSION = \"%s\"\n" % version)
42     ver_file.close()
43 except IOError:
44     print('WARNING: Cannot write version number file')
45
46 setup(name=MOD_NAME,
47       version=version,
48       description='package dependency analyzer for image creation',
49       author='Chulwoo Shin',
50       author_email='cw1.shin@samsung.com',
51       url='https://',
52       scripts=['tools/tic-core'],
53       packages=['tic',
54                 'tic.parser',
55                 'tic.server',
56                 'tic.utils'] 
57      )