-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
38 lines (30 loc) · 1.04 KB
/
Copy pathsetup.py
File metadata and controls
38 lines (30 loc) · 1.04 KB
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
#!/usr/bin/env python
"""GBS setup."""
import os, sys
import re
from distutils.core import setup
MOD_NAME = 'gitbuildsys'
def get_version(mod_name):
"""Get version from module __init__.py"""
path = os.path.join(mod_name, "__init__.py")
if not os.path.isfile(path):
print 'No %s version file found' % path
sys.exit(1)
content = open(path).read()
match = re.search(r'^__version__\s*=\s*[\x22\x27]([^\x22\x27]+)[\x22\x27]',
content, re.M)
if match:
return match.group(1)
print 'Unable to find version in %s' % path
sys.exit(1)
setup(name='gbs',
version=get_version(MOD_NAME),
description='The command line tools for Tizen package developers',
author='Jian-feng Ding, Huaxu Wan',
author_email='jian-feng.ding@intel.com, huaxu.wan@intel.com',
url='https://git.tizen.org/',
scripts=['tools/gbs'],
data_files=[('/etc/bash_completion.d/', ['data/gbs.sh']),
('/etc/zsh_completion.d/', ['data/_gbs'])],
packages=[MOD_NAME],
)