1999-09-13 03:10:25 +00:00
|
|
|
"""install_ext
|
|
|
|
|
|
|
|
Implement the Distutils "install_ext" command to install extension modules."""
|
|
|
|
|
|
|
|
# created 1999/09/12, Greg Ward
|
|
|
|
|
|
|
|
__rcsid__ = "$Id$"
|
|
|
|
|
|
|
|
from distutils.core import Command
|
|
|
|
from distutils.util import copy_tree
|
|
|
|
|
|
|
|
class InstallExt (Command):
|
|
|
|
|
2000-01-30 18:34:15 +00:00
|
|
|
description = "install C/C++ extension modules"
|
|
|
|
|
1999-09-29 12:38:18 +00:00
|
|
|
options = [('install-dir=', 'd', "directory to install to"),
|
1999-09-13 03:10:25 +00:00
|
|
|
('build-dir=','b', "build directory (where to install from)"),
|
|
|
|
]
|
|
|
|
|
|
|
|
def set_default_options (self):
|
|
|
|
# let the 'install' command dictate our installation directory
|
1999-09-29 12:38:18 +00:00
|
|
|
self.install_dir = None
|
1999-09-13 03:10:25 +00:00
|
|
|
self.build_dir = None
|
|
|
|
|
|
|
|
def set_final_options (self):
|
|
|
|
self.set_undefined_options ('install',
|
|
|
|
('build_platlib', 'build_dir'),
|
1999-09-29 12:38:18 +00:00
|
|
|
('install_site_platlib', 'install_dir'))
|
1999-09-13 03:10:25 +00:00
|
|
|
|
|
|
|
def run (self):
|
|
|
|
|
2000-01-30 15:07:56 +00:00
|
|
|
# Make sure we have built all extension modules first
|
|
|
|
self.run_peer ('build_ext')
|
|
|
|
|
1999-09-13 03:10:25 +00:00
|
|
|
# Dump the entire "build/platlib" directory (or whatever it really
|
|
|
|
# is; "build/platlib" is the default) to the installation target
|
|
|
|
# (eg. "/usr/local/lib/python1.5/site-packages"). Note that
|
|
|
|
# putting files in the right package dir is already done when we
|
|
|
|
# build.
|
1999-09-29 12:38:18 +00:00
|
|
|
outfiles = self.copy_tree (self.build_dir, self.install_dir)
|
1999-09-13 03:10:25 +00:00
|
|
|
|
|
|
|
# class InstallExt
|