From 9e6a003a8d2f72f3db09404b726c4abad5316e29 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sat, 26 Aug 2017 21:42:15 +0100 Subject: Add man page for virt-bootstrap --- setup.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 0f617e4..bca9955 100755 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ import os import sys import subprocess import setuptools +from setuptools.command.install import install # pylint: disable=import-error, wrong-import-position sys.path.insert(0, 'src') # noqa: E402 @@ -26,6 +27,27 @@ def read(fname): return fobj.read() +class PostInstallCommand(install): + """ + Post-installation commands. + """ + def run(self): + """ + Post install script + """ + cmd = [ + 'pod2man', + '--center=Container bootstrapping tool', + '--name=VIRT-BOOTSTRAP', + '--release=%s' % virtBootstrap.__version__, + 'man/virt-bootstrap.pod', + 'man/virt-bootstrap.1' + ] + if subprocess.call(cmd) != 0: + raise RuntimeError("Building man pages has failed") + install.run(self) + + class CheckPylint(setuptools.Command): """ Check python source files with pylint and pycodestyle. @@ -114,9 +136,14 @@ setuptools.setup( ], cmdclass={ + 'install': PostInstallCommand, 'pylint': CheckPylint }, + data_files=[ + ("share/man/man1", ['man/virt-bootstrap.1']) + ], + tests_require=['mock>=2.0'], extras_require={ -- cgit