mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 05:46:13 +01:00
Automatically generate and install man page (bnc#471888).
This commit is contained in:
parent
a30a1d595b
commit
427445a24d
28
setup.py
28
setup.py
@ -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,
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user