tests: test case for internal service errors
[services/obs-service-git-buildpackage.git] / setup.py
1 #!/usr/bin/python
2 # vim:fileencoding=utf-8:et:ts=4:sw=4:sts=4
3 #
4 # Copyright (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """Setup script"""
21
22 from setuptools import setup
23
24
25 def tag_from_spec(tag):
26     """Get value of an rpm tag from the spec file"""
27     with open('packaging/obs-service-git-buildpackage.spec', 'r') as spec:
28         for line in spec.readlines():
29             if line.lower().startswith(tag.lower() + ':'):
30                 return line.split(':', 1)[1].strip()
31     raise Exception("ERROR: unable to parse '%s' from spec file" % tag)
32
33 setup(name='obs_service_gbp',
34       version=tag_from_spec('Version'),
35       description=tag_from_spec('Summary'),
36       author='Markus Lehtonen',
37       author_email='markus.lehtonen@linux.intel.com',
38       url=tag_from_spec('URL'),
39       license=tag_from_spec('License'),
40       packages=['obs_service_gbp', 'obs_service_gbp_utils', 'gbp_repocache'],
41       data_files=[('/usr/lib/obs/service', ['service/git-buildpackage',
42                     'service/git-buildpackage.service']),
43                   ('/etc/obs/services', ['config/git-buildpackage'])],
44      )