ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/pystatgrab/setup.py
(Generate patch)

Comparing projects/pystatgrab/setup.py (file contents):
Revision 1.3 by tdb, Tue Feb 10 20:15:19 2004 UTC vs.
Revision 1.9 by tdb, Sat Mar 20 21:29:59 2004 UTC

# Line 1 | Line 1
1   #!/usr/bin/env python
2 + #
3 + # setup.py - distfiles configuration for pystatgrab
4 + #
5 + # $Id$
6 + #
7 + """Python bindings for libstatgrab."""
8  
9   from distutils.core import setup, Extension
10   from commands import getstatusoutput
5 from sys import exit
11  
12 + import sys
13 + import os
14 +
15 + # version of pystatgrab
16 + VERSION = "0.1"
17 +
18 + # required version of libstatgrab
19 + LIBSTATGRAB = "0.9"
20 +
21 + # test for pkg-config presence
22 + if os.system("pkg-config --version >/dev/null 2>&1"):
23 +        sys.exit("Error, could not find pkg-config.")
24 +
25 + # test for libstatgrab presence using pkg-config
26 + if os.system("pkg-config --exists libstatgrab"):
27 +        sys.exit("Error, libstatgrab is not installed (according to pkg-config).")
28 +
29 + # test for libstatgrab version using pkg-config
30 + if os.system("pkg-config --atleast-version=%s libstatgrab" % LIBSTATGRAB):
31 +        sys.exit("Error, need at least libstatgrab version %s." % LIBSTATGRAB)
32 +
33 + # test for _statgrab.c, and try to generate if not found
34 + if not os.path.exists("_statgrab.c"):
35 +        print "_statgrab.c doesn't exist, trying to use pyrexc to generate it..."
36 +        if os.system("pyrexc --version >/dev/null 2>&1"):
37 +                sys.exit("Error, _statgrab.c not present, and can't find pyrexc to generate it with.")
38 +        else:
39 +                if os.system("pyrexc _statgrab.pyx"):
40 +                        sys.exit("Error, pyrexc failed to generate _statgrab.c")
41 +
42 + # get cflags and libs for libstatgrab
43   cflags = getstatusoutput("pkg-config --cflags libstatgrab")
44   libs = getstatusoutput("pkg-config --libs libstatgrab")
45  
46   if cflags[0] != 0:
47 <        exit("Failed to get cflags: " + cflags[1])
47 >        sys.exit("Failed to get cflags: " + cflags[1])
48  
49   if libs[0] != 0:
50          exit("Failed to get libs: " + libs[1])
51  
52 < setup(  name = "statgrab",
53 <        version = "0.8.2",
52 > # setup information
53 > setup(  name = "pystatgrab",
54 >        version = VERSION,
55          description = "Python bindings for libstatgrab",
56          author = "i-scream",
57          author_email = "dev@i-scream.org",
58 <        url = "http://www.i-scream.org/libstatgrab",
58 >        url = "http://www.i-scream.org/libstatgrab/",
59          license = "GNU GPL v2 or later",
60          ext_modules=[Extension(
61 <                "statgrab",
62 <                ["statgrab.c"],
61 >                "_statgrab",
62 >                ["_statgrab.c"],
63                  extra_compile_args = cflags[1].split(),
64                  extra_link_args = libs[1].split(),
65          )],
66 +        py_modules=["statgrab"],
67   )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines