1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/usr/bin/env python
# setup.py
import sys
from distutils.core import setup, Extension
# Windows
if sys.platform.lower().startswith("win"):
extensions = Extension('_psutil_mswindows',
sources=['psutil/_psutil_mswindows.c'],
define_macros=[('_WIN32_WINNT', '0x0500')],
libraries=["psapi", "kernel32", "advapi32", "shell32"]
)
# OS X
elif sys.platform.lower().startswith("darwin"):
extensions = Extension('_psutil_osx',
sources = ['psutil/_psutil_osx.c']
)
# Others
else:
extensions = None
def main():
setup_args = dict(
name='psutil',
version='0.1.0',
description='Python Process Management Library',
author='Giampaolo Rodola, Dave Daeschler, Jay Loden',
author_email='psutil-dev@googlegroups.com',
url='http://code.google.com/p/psutil/',
license='License :: OSI Approved :: BSD License',
packages=['psutil'],
)
if extensions is not None:
setup_args["ext_modules"] = [extensions]
setup(**setup_args)
if __name__ == '__main__':
main()
|