diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -17,20 +17,26 @@ '''Setup.py for lorry.''' +import compileall from distutils.core import setup from distutils.cmd import Command from distutils.command.build import build from distutils.command.clean import clean +from distutils.command.install import install +import distutils.dir_util import glob import os import shutil import subprocess -class GenerateManpage(build): +class Build(build): def run(self): build.run(self) + + compileall.compile_dir('hg-fast-export/plugins') + print('building manpages') for x in ['lorry']: with open('%s.1' % x, 'w') as f: @@ -48,6 +54,7 @@ class Clean(clean): ] clean_globs = [ '*/*.py[co]', + 'hg-fast-export/plugins/*/__pycache__', ] def run(self): @@ -77,6 +84,17 @@ class Check(Command): subprocess.check_call(['./check']) +class Install(install): + def run(self): + install.run(self) + + # Install hg-fast-export plugins in a private directory + distutils.dir_util.copy_tree( + 'hg-fast-export/plugins', + os.path.join(self.install_data, + 'share/lorry/hg-fast-export/plugins')) + + setup(name='lorry', description='FIXME', long_description='''\ @@ -89,7 +107,8 @@ FIXME 'lorry.zip-importer', 'lorry-ssh-wrapper'], data_files=[('share/man/man1', glob.glob('*.[1-8]'))], cmdclass={ - 'build': GenerateManpage, + 'build': Build, 'check': Check, 'clean': Clean, + 'install': Install, }) |