diff options
author | imasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 01:56:56 +0000 |
---|---|---|
committer | imasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 01:56:56 +0000 |
commit | 81b941e97497d337f742aa7b499435709e769bc2 (patch) | |
tree | 295240e93e7c6ae02b8dd4fa083c43318f654395 /third_party/psutil/setup.py | |
parent | c1795d643965e35276dfef1fa390df9bbdb11289 (diff) | |
download | chromium_src-81b941e97497d337f742aa7b499435709e769bc2.zip chromium_src-81b941e97497d337f742aa7b499435709e769bc2.tar.gz chromium_src-81b941e97497d337f742aa7b499435709e769bc2.tar.bz2 |
Update third_party/psutil and fix the licence issue with it.
BUG=98456
TEST=None
Review URL: http://codereview.chromium.org/8159001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/psutil/setup.py')
-rw-r--r-- | third_party/psutil/setup.py | 89 |
1 files changed, 57 insertions, 32 deletions
diff --git a/third_party/psutil/setup.py b/third_party/psutil/setup.py index fb944bf..d7383cb 100644 --- a/third_party/psutil/setup.py +++ b/third_party/psutil/setup.py @@ -1,22 +1,34 @@ #!/usr/bin/env python # -# $Id: setup.py 748 2010-10-29 12:51:58Z g.rodola $ +# $Id: setup.py 1142 2011-10-05 18:45:49Z g.rodola $ # +# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. import sys import os -import shutil -from distutils.core import setup, Extension +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension + +__ver__ = "0.3.1" # Hack for Python 3 to tell distutils to run 2to3 against the files # copied in the build directory before installing. -# Reference: http://osdir.com/ml/python.python-3000.cvs/2008-03/msg00127.html +# Reference: http://docs.python.org/dev/howto/pyporting.html#during-installation try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py +if os.name == 'posix': + posix_extension = Extension('_psutil_posix', + sources = ['psutil/_psutil_posix.c']) + + # Windows if sys.platform.lower().startswith("win"): @@ -24,31 +36,41 @@ if sys.platform.lower().startswith("win"): maj,min = sys.getwindowsversion()[0:2] return '0x0%s' % ((maj * 100) + min) - extensions = Extension('_psutil_mswindows', - sources=['psutil/_psutil_mswindows.c', - 'psutil/arch/mswindows/process_info.c', - 'psutil/arch/mswindows/process_handles.c', - 'psutil/arch/mswindows/security.c'], - define_macros=[('_WIN32_WINNT', get_winver()), - ('_AVAIL_WINVER_', get_winver())], - libraries=["psapi", "kernel32", "advapi32", "shell32", - "netapi32"] - ) + extensions = [Extension('_psutil_mswindows', + sources=['psutil/_psutil_mswindows.c', + 'psutil/_psutil_common.c', + 'psutil/arch/mswindows/process_info.c', + 'psutil/arch/mswindows/process_handles.c', + 'psutil/arch/mswindows/security.c'], + define_macros=[('_WIN32_WINNT', get_winver()), + ('_AVAIL_WINVER_', get_winver())], + libraries=["psapi", "kernel32", "advapi32", "shell32", + "netapi32"] + )] # OS X elif sys.platform.lower().startswith("darwin"): - extensions = Extension('_psutil_osx', - sources = ['psutil/_psutil_osx.c', - 'psutil/arch/osx/process_info.c'] - ) + extensions = [Extension('_psutil_osx', + sources = ['psutil/_psutil_osx.c', + 'psutil/_psutil_common.c', + 'psutil/arch/osx/process_info.c'], + extra_link_args=['-framework', 'CoreFoundation', '-framework', 'IOKit'] + ), + posix_extension] # FreeBSD elif sys.platform.lower().startswith("freebsd"): - extensions = Extension('_psutil_bsd', - sources = ['psutil/_psutil_bsd.c', - 'psutil/arch/bsd/process_info.c'] - ) -# Others + extensions = [Extension('_psutil_bsd', + sources = ['psutil/_psutil_bsd.c', + 'psutil/_psutil_common.c', + 'psutil/arch/bsd/process_info.c'] + ), + posix_extension] +# Linux elif sys.platform.lower().startswith("linux"): - extensions = None + extensions = [Extension('_psutil_linux', + sources=['psutil/_psutil_linux.c'], + ), + posix_extension] + else: raise NotImplementedError('platform %s is not supported' % sys.platform) @@ -56,14 +78,17 @@ else: def main(): setup_args = dict( name='psutil', - version="0.2.0", + version=__ver__, + download_url="http://psutil.googlecode.com/files/psutil-%s.tar.gz" % __ver__, description='A process utilities module for Python', - long_description=""" -psutil is a module providing convenience functions for managing processes in a -portable way by using Python.""", - keywords=['psutil', 'ps', 'top', 'process', 'utility'], - author='Giampaolo Rodola, Dave Daeschler, Jay Loden', - author_email='psutil-dev@googlegroups.com', + long_description="""\ +psutil is a module providing convenience functions for monitoring +system and processes in a portable way by using Python.""", + keywords=['ps', 'top', 'kill', 'free', 'lsof', 'netstat', 'nice', + 'tty', 'ionice', 'uptime', 'taskmgr', 'process', 'df', + 'monitoring'], + author='Giampaolo Rodola, Jay Loden', + author_email='psutil@googlegroups.com', url='http://code.google.com/p/psutil/', platforms='Platform Independent', license='License :: OSI Approved :: BSD License', @@ -100,7 +125,7 @@ portable way by using Python.""", ], ) if extensions is not None: - setup_args["ext_modules"] = [extensions] + setup_args["ext_modules"] = extensions setup(**setup_args) |