| 1 |
|
#!/usr/bin/env python |
| 2 |
|
# |
| 3 |
< |
# setup.py - distfiles configuration for pystatgrab |
| 3 |
> |
# i-scream central monitoring system |
| 4 |
> |
# http://www.i-scream.org |
| 5 |
> |
# Copyright (C) 2000-2004 i-scream |
| 6 |
|
# |
| 7 |
+ |
# This program is free software; you can redistribute it and/or |
| 8 |
+ |
# modify it under the terms of the GNU General Public License |
| 9 |
+ |
# as published by the Free Software Foundation; either version 2 |
| 10 |
+ |
# of the License, or (at your option) any later version. |
| 11 |
+ |
# |
| 12 |
+ |
# This program is distributed in the hope that it will be useful, |
| 13 |
+ |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
+ |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
+ |
# GNU General Public License for more details. |
| 16 |
+ |
# |
| 17 |
+ |
# You should have received a copy of the GNU General Public License |
| 18 |
+ |
# along with this program; if not, write to the Free Software |
| 19 |
+ |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 |
+ |
# |
| 21 |
|
# $Id$ |
| 22 |
|
# |
| 23 |
|
"""Python bindings for libstatgrab.""" |
| 46 |
|
if os.system("pkg-config --atleast-version=%s libstatgrab" % LIBSTATGRAB): |
| 47 |
|
sys.exit("Error, need at least libstatgrab version %s." % LIBSTATGRAB) |
| 48 |
|
|
| 49 |
< |
# test for statgrab.c, and try to generate if not found |
| 50 |
< |
if not os.path.exists("statgrab.c"): |
| 51 |
< |
print "statgrab.c doesn't exist, trying to use pyrexc to generate it..." |
| 49 |
> |
# test for _statgrab.c, and try to generate if not found |
| 50 |
> |
if not os.path.exists("_statgrab.c"): |
| 51 |
> |
print "_statgrab.c doesn't exist, trying to use pyrexc to generate it..." |
| 52 |
|
if os.system("pyrexc --version >/dev/null 2>&1"): |
| 53 |
< |
sys.exit("Error, statgrab.c not present, and can't find pyrexc to generate it with.") |
| 53 |
> |
sys.exit("Error, _statgrab.c not present, and can't find pyrexc to generate it with.") |
| 54 |
|
else: |
| 55 |
< |
if os.system("pyrexc statgrab.pyx"): |
| 56 |
< |
sys.exit("Error, pyrexc failed to generate statgrab.c") |
| 55 |
> |
if os.system("pyrexc _statgrab.pyx"): |
| 56 |
> |
sys.exit("Error, pyrexc failed to generate _statgrab.c") |
| 57 |
|
|
| 58 |
|
# get cflags and libs for libstatgrab |
| 59 |
|
cflags = getstatusoutput("pkg-config --cflags libstatgrab") |
| 74 |
|
url = "http://www.i-scream.org/libstatgrab/", |
| 75 |
|
license = "GNU GPL v2 or later", |
| 76 |
|
ext_modules=[Extension( |
| 77 |
< |
"statgrab", |
| 78 |
< |
["statgrab.c"], |
| 77 |
> |
"_statgrab", |
| 78 |
> |
["_statgrab.c"], |
| 79 |
|
extra_compile_args = cflags[1].split(), |
| 80 |
|
extra_link_args = libs[1].split(), |
| 81 |
|
)], |
| 82 |
+ |
py_modules=["statgrab"], |
| 83 |
|
) |