1
2 from distutils.core import setup, Extension
3
4
5
6
7
8
9 import os
10 GPKLIB_LIB = None
11 pl = os.environ['LD_LIBRARY_PATH'].split(':')
12 for p in pl:
13 for ext in ['so', 'a']:
14 pp = os.path.join(p, 'libgpk.%s' % ext)
15 if os.path.isfile(pp) and os.access(pp, os.R_OK):
16 GPKLIB_LIB = p
17 break
18 if GPKLIB_LIB is not None:
19 break
20 assert GPKLIB_LIB is not None, "Cannot find gpklib.so"
21
22 print 'lib=', GPKLIB_LIB
23
24
25 GPKLIB_INCLUDES = os.path.join(os.path.split(GPKLIB_LIB)[0], 'include')
26
27 print 'includes=', GPKLIB_INCLUDES
28
29 from gmisclib import Num
30
31 setup(name="gpkimg", version="1.2",
32 description = "Interface to gpkio 2-D image formats",
33 author = "Greg Kochanski",
34 author_email = "gpk@kochanski.org",
35 py_modules = ["gpkimgclass"],
36 ext_modules = [
37 Extension("gpkimg", [ "gpkimg.cc" ],
38 libraries = ["gpk", "gpkio"],
39
40
41 include_dirs = [
42 GPKLIB_INCLUDES,
43 Num.get_include()
44 ],
45
46
47 library_dirs = [
48 GPKLIB_LIB
49 ]
50 )
51 ]
52 )
53