Automatically generate and install man page (bnc#471888).
[opensuse:osc.git] / setup.py
1 #!/usr/bin/env python
2
3 from distutils.core import setup
4 import distutils.command.build
5 import distutils.command.install_data
6 import os.path
7 import osc.core
8 from osc import commandline
9 from osc import babysitter
10
11 class build_osc(distutils.command.build.build, object):
12     """
13     Custom build command which generates man page.
14     """
15
16     def build_man_page(self):
17         """
18         """
19         man_path = os.path.join('build', 'osc.1')
20         distutils.log.info('generating %s' % man_path)
21         outfile = file(man_path, 'w')
22         osccli = commandline.Osc(stdout = outfile)
23         osccli.main(argv = ['osc','man'])
24
25     def run(self):
26         self.build_man_page()
27         super(build_osc, self).run()
28
29 setup(name='osc',
30       version=osc.core.__version__,
31       description='openSUSE (buildsystem) commander',
32       long_description='Commandline client for the openSUSE Build Service, which allows to access repositories in the openSUSE Build Service in similar way as Subversion repositories.',
33       author='openSUSE project',
34       author_email='opensuse-buildservice@opensuse.org',
35       license='GPL',
36       platforms = ['Linux'],
37       keywords = ['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'],
38       url='https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/python/osc/',
39
40       packages=['osc', 'osc.util'],
41       scripts=['osc_hotshot.py', 'osc-wrapper.py'],
42       data_files=[(os.path.join('share','man','man1'), [os.path.join('build', 'osc.1')])],
43
44       # Override certain command classes with our own ones
45       cmdclass = {
46         'build': build_osc,
47         },
48      )
49