From ef199fec2499ab1f07c2b70b3979975ba24d5b86 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 27 Mar 2012 17:42:09 +0100 Subject: Make setup.py build manpage --- setup.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 14fc1d0a..9ff424d8 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ from distutils.core import setup from distutils.cmd import Command +from distutils.command.build import build from distutils.command.clean import clean import glob import os @@ -29,6 +30,18 @@ import subprocess import morphlib +class GenerateManpage(build): + + def run(self): + build.run(self) + print 'building manpages' + for x in ['morph']: + with open('%s.1' % x, 'w') as f: + subprocess.check_call(['python', x, + '--generate-manpage=%s.1.in' % x, + '--output=%s.1' % x], stdout=f) + + class Clean(clean): clean_files = [ @@ -95,6 +108,7 @@ FIXME packages=['morphlib'], data_files=[('share/man/man1', glob.glob('*.[1-8]'))], cmdclass={ + 'build': GenerateManpage, 'check': Check, 'clean': Clean, }, -- cgit v1.2.1