install.py 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. """distutils.command.install
  2. Implements the Distutils 'install' command."""
  3. from distutils import log
  4. # This module should be kept compatible with Python 2.1.
  5. __revision__ = "$Id$"
  6. import sys, os, string
  7. from types import *
  8. from distutils.core import Command
  9. from distutils.debug import DEBUG
  10. from distutils.sysconfig import get_config_vars
  11. from distutils.errors import DistutilsPlatformError
  12. from distutils.file_util import write_file
  13. from distutils.util import convert_path, subst_vars, change_root
  14. from distutils.util import get_platform
  15. from distutils.errors import DistutilsOptionError
  16. from site import USER_BASE
  17. from site import USER_SITE
  18. libname = sys.lib
  19. if sys.version < "2.2":
  20. WINDOWS_SCHEME = {
  21. 'purelib': '$base',
  22. 'platlib': '$base',
  23. 'headers': '$base/Include/$dist_name',
  24. 'scripts': '$base/Scripts',
  25. 'data' : '$base',
  26. }
  27. else:
  28. WINDOWS_SCHEME = {
  29. 'purelib': '$base/Lib/site-packages',
  30. 'platlib': '$base/Lib/site-packages',
  31. 'headers': '$base/Include/$dist_name',
  32. 'scripts': '$base/Scripts',
  33. 'data' : '$base',
  34. }
  35. INSTALL_SCHEMES = {
  36. 'unix_prefix': {
  37. 'purelib': '$base/lib/python$py_version_short/site-packages',
  38. 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
  39. 'headers': '$base/include/python$py_version_short/$dist_name',
  40. 'scripts': '$base/bin',
  41. 'data' : '$base',
  42. },
  43. 'unix_home': {
  44. 'purelib': '$base/lib/python',
  45. 'platlib': '$base/lib/python',
  46. 'headers': '$base/include/python/$dist_name',
  47. 'scripts': '$base/bin',
  48. 'data' : '$base',
  49. },
  50. 'unix_user': {
  51. 'purelib': '$usersite',
  52. 'platlib': '$usersite',
  53. 'headers': '$userbase/include/python$py_version_short/$dist_name',
  54. 'scripts': '$userbase/bin',
  55. 'data' : '$userbase',
  56. },
  57. 'nt': WINDOWS_SCHEME,
  58. 'nt_user': {
  59. 'purelib': '$usersite',
  60. 'platlib': '$usersite',
  61. 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
  62. 'scripts': '$userbase/Scripts',
  63. 'data' : '$userbase',
  64. },
  65. 'os2': {
  66. 'purelib': '$base/Lib/site-packages',
  67. 'platlib': '$base/Lib/site-packages',
  68. 'headers': '$base/Include/$dist_name',
  69. 'scripts': '$base/Scripts',
  70. 'data' : '$base',
  71. },
  72. 'os2_home': {
  73. 'purelib': '$usersite',
  74. 'platlib': '$usersite',
  75. 'headers': '$userbase/include/python$py_version_short/$dist_name',
  76. 'scripts': '$userbase/bin',
  77. 'data' : '$userbase',
  78. },
  79. }
  80. # The keys to an installation scheme; if any new types of files are to be
  81. # installed, be sure to add an entry to every installation scheme above,
  82. # and to SCHEME_KEYS here.
  83. SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')
  84. class install (Command):
  85. description = "install everything from build directory"
  86. user_options = [
  87. # Select installation scheme and set base director(y|ies)
  88. ('prefix=', None,
  89. "installation prefix"),
  90. ('exec-prefix=', None,
  91. "(Unix only) prefix for platform-specific files"),
  92. ('home=', None,
  93. "(Unix only) home directory to install under"),
  94. ('user', None,
  95. "install in user site-package '%s'" % USER_SITE),
  96. # Or, just set the base director(y|ies)
  97. ('install-base=', None,
  98. "base installation directory (instead of --prefix or --home)"),
  99. ('install-platbase=', None,
  100. "base installation directory for platform-specific files " +
  101. "(instead of --exec-prefix or --home)"),
  102. ('root=', None,
  103. "install everything relative to this alternate root directory"),
  104. # Or, explicitly set the installation scheme
  105. ('install-purelib=', None,
  106. "installation directory for pure Python module distributions"),
  107. ('install-platlib=', None,
  108. "installation directory for non-pure module distributions"),
  109. ('install-lib=', None,
  110. "installation directory for all module distributions " +
  111. "(overrides --install-purelib and --install-platlib)"),
  112. ('install-headers=', None,
  113. "installation directory for C/C++ headers"),
  114. ('install-scripts=', None,
  115. "installation directory for Python scripts"),
  116. ('install-data=', None,
  117. "installation directory for data files"),
  118. # Byte-compilation options -- see install_lib.py for details, as
  119. # these are duplicated from there (but only install_lib does
  120. # anything with them).
  121. ('compile', 'c', "compile .py to .pyc [default]"),
  122. ('no-compile', None, "don't compile .py files"),
  123. ('optimize=', 'O',
  124. "also compile with optimization: -O1 for \"python -O\", "
  125. "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
  126. # Miscellaneous control options
  127. ('force', 'f',
  128. "force installation (overwrite any existing files)"),
  129. ('skip-build', None,
  130. "skip rebuilding everything (for testing/debugging)"),
  131. # Where to install documentation (eventually!)
  132. #('doc-format=', None, "format of documentation to generate"),
  133. #('install-man=', None, "directory for Unix man pages"),
  134. #('install-html=', None, "directory for HTML documentation"),
  135. #('install-info=', None, "directory for GNU info files"),
  136. ('record=', None,
  137. "filename in which to record list of installed files"),
  138. ]
  139. boolean_options = ['compile', 'force', 'skip-build', 'user']
  140. negative_opt = {'no-compile' : 'compile'}
  141. def initialize_options (self):
  142. # High-level options: these select both an installation base
  143. # and scheme.
  144. self.prefix = None
  145. self.exec_prefix = None
  146. self.home = None
  147. self.user = 0
  148. # These select only the installation base; it's up to the user to
  149. # specify the installation scheme (currently, that means supplying
  150. # the --install-{platlib,purelib,scripts,data} options).
  151. self.install_base = None
  152. self.install_platbase = None
  153. self.root = None
  154. # These options are the actual installation directories; if not
  155. # supplied by the user, they are filled in using the installation
  156. # scheme implied by prefix/exec-prefix/home and the contents of
  157. # that installation scheme.
  158. self.install_purelib = None # for pure module distributions
  159. self.install_platlib = None # non-pure (dists w/ extensions)
  160. self.install_headers = None # for C/C++ headers
  161. self.install_lib = None # set to either purelib or platlib
  162. self.install_scripts = None
  163. self.install_data = None
  164. self.install_userbase = USER_BASE
  165. self.install_usersite = USER_SITE
  166. self.compile = None
  167. self.optimize = None
  168. # These two are for putting non-packagized distributions into their
  169. # own directory and creating a .pth file if it makes sense.
  170. # 'extra_path' comes from the setup file; 'install_path_file' can
  171. # be turned off if it makes no sense to install a .pth file. (But
  172. # better to install it uselessly than to guess wrong and not
  173. # install it when it's necessary and would be used!) Currently,
  174. # 'install_path_file' is always true unless some outsider meddles
  175. # with it.
  176. self.extra_path = None
  177. self.install_path_file = 1
  178. # 'force' forces installation, even if target files are not
  179. # out-of-date. 'skip_build' skips running the "build" command,
  180. # handy if you know it's not necessary. 'warn_dir' (which is *not*
  181. # a user option, it's just there so the bdist_* commands can turn
  182. # it off) determines whether we warn about installing to a
  183. # directory not in sys.path.
  184. self.force = 0
  185. self.skip_build = 0
  186. self.warn_dir = 1
  187. # These are only here as a conduit from the 'build' command to the
  188. # 'install_*' commands that do the real work. ('build_base' isn't
  189. # actually used anywhere, but it might be useful in future.) They
  190. # are not user options, because if the user told the install
  191. # command where the build directory is, that wouldn't affect the
  192. # build command.
  193. self.build_base = None
  194. self.build_lib = None
  195. # Not defined yet because we don't know anything about
  196. # documentation yet.
  197. #self.install_man = None
  198. #self.install_html = None
  199. #self.install_info = None
  200. self.record = None
  201. # -- Option finalizing methods -------------------------------------
  202. # (This is rather more involved than for most commands,
  203. # because this is where the policy for installing third-
  204. # party Python modules on various platforms given a wide
  205. # array of user input is decided. Yes, it's quite complex!)
  206. def finalize_options (self):
  207. # This method (and its pliant slaves, like 'finalize_unix()',
  208. # 'finalize_other()', and 'select_scheme()') is where the default
  209. # installation directories for modules, extension modules, and
  210. # anything else we care to install from a Python module
  211. # distribution. Thus, this code makes a pretty important policy
  212. # statement about how third-party stuff is added to a Python
  213. # installation! Note that the actual work of installation is done
  214. # by the relatively simple 'install_*' commands; they just take
  215. # their orders from the installation directory options determined
  216. # here.
  217. # Check for errors/inconsistencies in the options; first, stuff
  218. # that's wrong on any platform.
  219. if ((self.prefix or self.exec_prefix or self.home) and
  220. (self.install_base or self.install_platbase)):
  221. raise DistutilsOptionError, \
  222. ("must supply either prefix/exec-prefix/home or " +
  223. "install-base/install-platbase -- not both")
  224. if self.home and (self.prefix or self.exec_prefix):
  225. raise DistutilsOptionError, \
  226. "must supply either home or prefix/exec-prefix -- not both"
  227. if self.user and (self.prefix or self.exec_prefix or self.home or
  228. self.install_base or self.install_platbase):
  229. raise DistutilsOptionError("can't combine user with prefix, "
  230. "exec_prefix/home, or install_(plat)base")
  231. # Next, stuff that's wrong (or dubious) only on certain platforms.
  232. if os.name != "posix":
  233. if self.exec_prefix:
  234. self.warn("exec-prefix option ignored on this platform")
  235. self.exec_prefix = None
  236. # Now the interesting logic -- so interesting that we farm it out
  237. # to other methods. The goal of these methods is to set the final
  238. # values for the install_{lib,scripts,data,...} options, using as
  239. # input a heady brew of prefix, exec_prefix, home, install_base,
  240. # install_platbase, user-supplied versions of
  241. # install_{purelib,platlib,lib,scripts,data,...}, and the
  242. # INSTALL_SCHEME dictionary above. Phew!
  243. self.dump_dirs("pre-finalize_{unix,other}")
  244. if os.name == 'posix':
  245. self.finalize_unix()
  246. else:
  247. self.finalize_other()
  248. self.dump_dirs("post-finalize_{unix,other}()")
  249. # Expand configuration variables, tilde, etc. in self.install_base
  250. # and self.install_platbase -- that way, we can use $base or
  251. # $platbase in the other installation directories and not worry
  252. # about needing recursive variable expansion (shudder).
  253. py_version = (string.split(sys.version))[0]
  254. (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
  255. self.config_vars = {'dist_name': self.distribution.get_name(),
  256. 'dist_version': self.distribution.get_version(),
  257. 'dist_fullname': self.distribution.get_fullname(),
  258. 'py_version': py_version,
  259. 'py_version_short': py_version[0:3],
  260. 'py_version_nodot': py_version[0] + py_version[2],
  261. 'sys_prefix': prefix,
  262. 'prefix': prefix,
  263. 'sys_exec_prefix': exec_prefix,
  264. 'exec_prefix': exec_prefix,
  265. 'userbase': self.install_userbase,
  266. 'usersite': self.install_usersite,
  267. }
  268. self.expand_basedirs()
  269. self.dump_dirs("post-expand_basedirs()")
  270. # Now define config vars for the base directories so we can expand
  271. # everything else.
  272. self.config_vars['base'] = self.install_base
  273. self.config_vars['platbase'] = self.install_platbase
  274. if DEBUG:
  275. from pprint import pprint
  276. print "config vars:"
  277. pprint(self.config_vars)
  278. # Expand "~" and configuration variables in the installation
  279. # directories.
  280. self.expand_dirs()
  281. self.dump_dirs("post-expand_dirs()")
  282. # Create directories in the home dir:
  283. if self.user:
  284. self.create_home_path()
  285. # Pick the actual directory to install all modules to: either
  286. # install_purelib or install_platlib, depending on whether this
  287. # module distribution is pure or not. Of course, if the user
  288. # already specified install_lib, use their selection.
  289. if self.install_lib is None:
  290. if self.distribution.ext_modules: # has extensions: non-pure
  291. self.install_lib = self.install_platlib
  292. else:
  293. self.install_lib = self.install_purelib
  294. # Convert directories from Unix /-separated syntax to the local
  295. # convention.
  296. self.convert_paths('lib', 'purelib', 'platlib',
  297. 'scripts', 'data', 'headers',
  298. 'userbase', 'usersite')
  299. # Well, we're not actually fully completely finalized yet: we still
  300. # have to deal with 'extra_path', which is the hack for allowing
  301. # non-packagized module distributions (hello, Numerical Python!) to
  302. # get their own directories.
  303. self.handle_extra_path()
  304. self.install_libbase = self.install_lib # needed for .pth file
  305. self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
  306. # If a new root directory was supplied, make all the installation
  307. # dirs relative to it.
  308. if self.root is not None:
  309. self.change_roots('libbase', 'lib', 'purelib', 'platlib',
  310. 'scripts', 'data', 'headers')
  311. self.dump_dirs("after prepending root")
  312. # Find out the build directories, ie. where to install from.
  313. self.set_undefined_options('build',
  314. ('build_base', 'build_base'),
  315. ('build_lib', 'build_lib'))
  316. # Punt on doc directories for now -- after all, we're punting on
  317. # documentation completely!
  318. # finalize_options ()
  319. def dump_dirs (self, msg):
  320. if DEBUG:
  321. from distutils.fancy_getopt import longopt_xlate
  322. print msg + ":"
  323. for opt in self.user_options:
  324. opt_name = opt[0]
  325. if opt_name[-1] == "=":
  326. opt_name = opt_name[0:-1]
  327. if opt_name in self.negative_opt:
  328. opt_name = string.translate(self.negative_opt[opt_name],
  329. longopt_xlate)
  330. val = not getattr(self, opt_name)
  331. else:
  332. opt_name = string.translate(opt_name, longopt_xlate)
  333. val = getattr(self, opt_name)
  334. print " %s: %s" % (opt_name, val)
  335. def finalize_unix (self):
  336. if self.install_base is not None or self.install_platbase is not None:
  337. if ((self.install_lib is None and
  338. self.install_purelib is None and
  339. self.install_platlib is None) or
  340. self.install_headers is None or
  341. self.install_scripts is None or
  342. self.install_data is None):
  343. raise DistutilsOptionError, \
  344. ("install-base or install-platbase supplied, but "
  345. "installation scheme is incomplete")
  346. return
  347. if self.user:
  348. if self.install_userbase is None:
  349. raise DistutilsPlatformError(
  350. "User base directory is not specified")
  351. self.install_base = self.install_platbase = self.install_userbase
  352. self.select_scheme("unix_user")
  353. elif self.home is not None:
  354. self.install_base = self.install_platbase = self.home
  355. self.select_scheme("unix_home")
  356. else:
  357. if self.prefix is None:
  358. if self.exec_prefix is not None:
  359. raise DistutilsOptionError, \
  360. "must not supply exec-prefix without prefix"
  361. self.prefix = os.path.normpath(sys.prefix)
  362. self.exec_prefix = os.path.normpath(sys.exec_prefix)
  363. else:
  364. if self.exec_prefix is None:
  365. self.exec_prefix = self.prefix
  366. self.install_base = self.prefix
  367. self.install_platbase = self.exec_prefix
  368. self.select_scheme("unix_prefix")
  369. # finalize_unix ()
  370. def finalize_other (self): # Windows and Mac OS for now
  371. if self.user:
  372. if self.install_userbase is None:
  373. raise DistutilsPlatformError(
  374. "User base directory is not specified")
  375. self.install_base = self.install_platbase = self.install_userbase
  376. self.select_scheme(os.name + "_user")
  377. elif self.home is not None:
  378. self.install_base = self.install_platbase = self.home
  379. self.select_scheme("unix_home")
  380. else:
  381. if self.prefix is None:
  382. self.prefix = os.path.normpath(sys.prefix)
  383. self.install_base = self.install_platbase = self.prefix
  384. try:
  385. self.select_scheme(os.name)
  386. except KeyError:
  387. raise DistutilsPlatformError, \
  388. "I don't know how to install stuff on '%s'" % os.name
  389. # finalize_other ()
  390. def select_scheme (self, name):
  391. # it's the caller's problem if they supply a bad name!
  392. scheme = INSTALL_SCHEMES[name]
  393. for key in SCHEME_KEYS:
  394. attrname = 'install_' + key
  395. if getattr(self, attrname) is None:
  396. setattr(self, attrname, scheme[key])
  397. def _expand_attrs (self, attrs):
  398. for attr in attrs:
  399. val = getattr(self, attr)
  400. if val is not None:
  401. if os.name == 'posix' or os.name == 'nt':
  402. val = os.path.expanduser(val)
  403. val = subst_vars(val, self.config_vars)
  404. setattr(self, attr, val)
  405. def expand_basedirs (self):
  406. self._expand_attrs(['install_base',
  407. 'install_platbase',
  408. 'root'])
  409. def expand_dirs (self):
  410. self._expand_attrs(['install_purelib',
  411. 'install_platlib',
  412. 'install_lib',
  413. 'install_headers',
  414. 'install_scripts',
  415. 'install_data',])
  416. def convert_paths (self, *names):
  417. for name in names:
  418. attr = "install_" + name
  419. setattr(self, attr, convert_path(getattr(self, attr)))
  420. def handle_extra_path (self):
  421. if self.extra_path is None:
  422. self.extra_path = self.distribution.extra_path
  423. if self.extra_path is not None:
  424. if type(self.extra_path) is StringType:
  425. self.extra_path = string.split(self.extra_path, ',')
  426. if len(self.extra_path) == 1:
  427. path_file = extra_dirs = self.extra_path[0]
  428. elif len(self.extra_path) == 2:
  429. (path_file, extra_dirs) = self.extra_path
  430. else:
  431. raise DistutilsOptionError, \
  432. ("'extra_path' option must be a list, tuple, or "
  433. "comma-separated string with 1 or 2 elements")
  434. # convert to local form in case Unix notation used (as it
  435. # should be in setup scripts)
  436. extra_dirs = convert_path(extra_dirs)
  437. else:
  438. path_file = None
  439. extra_dirs = ''
  440. # XXX should we warn if path_file and not extra_dirs? (in which
  441. # case the path file would be harmless but pointless)
  442. self.path_file = path_file
  443. self.extra_dirs = extra_dirs
  444. # handle_extra_path ()
  445. def change_roots (self, *names):
  446. for name in names:
  447. attr = "install_" + name
  448. setattr(self, attr, change_root(self.root, getattr(self, attr)))
  449. def create_home_path(self):
  450. """Create directories under ~
  451. """
  452. if not self.user:
  453. return
  454. home = convert_path(os.path.expanduser("~"))
  455. for name, path in self.config_vars.iteritems():
  456. if path.startswith(home) and not os.path.isdir(path):
  457. self.debug_print("os.makedirs('%s', 0700)" % path)
  458. os.makedirs(path, 0700)
  459. # -- Command execution methods -------------------------------------
  460. def run (self):
  461. # Obviously have to build before we can install
  462. if not self.skip_build:
  463. self.run_command('build')
  464. # If we built for any other platform, we can't install.
  465. build_plat = self.distribution.get_command_obj('build').plat_name
  466. # check warn_dir - it is a clue that the 'install' is happening
  467. # internally, and not to sys.path, so we don't check the platform
  468. # matches what we are running.
  469. if self.warn_dir and build_plat != get_platform():
  470. raise DistutilsPlatformError("Can't install when "
  471. "cross-compiling")
  472. # Run all sub-commands (at least those that need to be run)
  473. for cmd_name in self.get_sub_commands():
  474. self.run_command(cmd_name)
  475. if self.path_file:
  476. self.create_path_file()
  477. # write list of installed files, if requested.
  478. if self.record:
  479. outputs = self.get_outputs()
  480. if self.root: # strip any package prefix
  481. root_len = len(self.root)
  482. for counter in xrange(len(outputs)):
  483. outputs[counter] = outputs[counter][root_len:]
  484. self.execute(write_file,
  485. (self.record, outputs),
  486. "writing list of installed files to '%s'" %
  487. self.record)
  488. sys_path = map(os.path.normpath, sys.path)
  489. sys_path = map(os.path.normcase, sys_path)
  490. install_lib = os.path.normcase(os.path.normpath(self.install_lib))
  491. if (self.warn_dir and
  492. not (self.path_file and self.install_path_file) and
  493. install_lib not in sys_path):
  494. log.debug(("modules installed to '%s', which is not in "
  495. "Python's module search path (sys.path) -- "
  496. "you'll have to change the search path yourself"),
  497. self.install_lib)
  498. # run ()
  499. def create_path_file (self):
  500. filename = os.path.join(self.install_libbase,
  501. self.path_file + ".pth")
  502. if self.install_path_file:
  503. self.execute(write_file,
  504. (filename, [self.extra_dirs]),
  505. "creating %s" % filename)
  506. else:
  507. self.warn("path file '%s' not created" % filename)
  508. # -- Reporting methods ---------------------------------------------
  509. def get_outputs (self):
  510. # Assemble the outputs of all the sub-commands.
  511. outputs = []
  512. for cmd_name in self.get_sub_commands():
  513. cmd = self.get_finalized_command(cmd_name)
  514. # Add the contents of cmd.get_outputs(), ensuring
  515. # that outputs doesn't contain duplicate entries
  516. for filename in cmd.get_outputs():
  517. if filename not in outputs:
  518. outputs.append(filename)
  519. if self.path_file and self.install_path_file:
  520. outputs.append(os.path.join(self.install_libbase,
  521. self.path_file + ".pth"))
  522. return outputs
  523. def get_inputs (self):
  524. # XXX gee, this looks familiar ;-(
  525. inputs = []
  526. for cmd_name in self.get_sub_commands():
  527. cmd = self.get_finalized_command(cmd_name)
  528. inputs.extend(cmd.get_inputs())
  529. return inputs
  530. # -- Predicates for sub-command list -------------------------------
  531. def has_lib (self):
  532. """Return true if the current distribution has any Python
  533. modules to install."""
  534. return (self.distribution.has_pure_modules() or
  535. self.distribution.has_ext_modules())
  536. def has_headers (self):
  537. return self.distribution.has_headers()
  538. def has_scripts (self):
  539. return self.distribution.has_scripts()
  540. def has_data (self):
  541. return self.distribution.has_data_files()
  542. # 'sub_commands': a list of commands this command might have to run to
  543. # get its work done. See cmd.py for more info.
  544. sub_commands = [('install_lib', has_lib),
  545. ('install_headers', has_headers),
  546. ('install_scripts', has_scripts),
  547. ('install_data', has_data),
  548. ('install_egg_info', lambda self:True),
  549. ]
  550. # class install