1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

Automatically generate and install man page (bnc#471888).

This commit is contained in:
Michal Cihar 2009-05-06 11:47:53 +00:00
parent a30a1d595b
commit 427445a24d

View File

@ -1,7 +1,30 @@
#!/usr/bin/env python
from distutils.core import setup
import distutils.command.build
import distutils.command.install_data
import os.path
import osc.core
from osc import commandline
from osc import babysitter
class build_osc(distutils.command.build.build, object):
"""
Custom build command which generates man page.
"""
def build_man_page(self):
"""
"""
man_path = os.path.join('build', 'osc.1')
distutils.log.info('generating %s' % man_path)
outfile = file(man_path, 'w')
osccli = commandline.Osc(stdout = outfile)
osccli.main(argv = ['osc','man'])
def run(self):
self.build_man_page()
super(build_osc, self).run()
setup(name='osc',
version=osc.core.__version__,
@ -16,6 +39,11 @@ setup(name='osc',
packages=['osc', 'osc.util'],
scripts=['osc_hotshot.py', 'osc-wrapper.py'],
data_files=[(os.path.join('share','man','man1'), [os.path.join('build', 'osc.1')])],
# Override certain command classes with our own ones
cmdclass = {
'build': build_osc,
},
)