root/tags/gdal_1_2_5/setup.py
| Revision 6583, 4.2 kB (checked in by fwarmerdam, 4 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #!/usr/bin/env python |
| 2 | #****************************************************************************** |
| 3 | # $Id$ |
| 4 | # |
| 5 | # Name: setup.py |
| 6 | # Project: GDAL |
| 7 | # Purpose: Installation / Install script. |
| 8 | # Author: Evgeniy Cherkashin <eugeneai@icc.ru> |
| 9 | # |
| 10 | #****************************************************************************** |
| 11 | # Copyright (c) 2003, Evgeniy Cherkashin <eugeneai@icc.ru> |
| 12 | # |
| 13 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 14 | # copy of this software and associated documentation files (the "Software"), |
| 15 | # to deal in the Software without restriction, including without limitation |
| 16 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 17 | # and/or sell copies of the Software, and to permit persons to whom the |
| 18 | # Software is furnished to do so, subject to the following conditions: |
| 19 | # |
| 20 | # The above copyright notice and this permission notice shall be included |
| 21 | # in all copies or substantial portions of the Software. |
| 22 | # |
| 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 24 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 26 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 28 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 29 | # DEALINGS IN THE SOFTWARE. |
| 30 | #****************************************************************************** |
| 31 | # |
| 32 | # $Log$ |
| 33 | # Revision 1.6 2004/09/24 23:06:42 fwarmerdam |
| 34 | # various patches from Alessandro |
| 35 | # |
| 36 | # Revision 1.5 2004/04/25 19:28:45 aamici |
| 37 | # core -> gcore update |
| 38 | # |
| 39 | # Revision 1.4 2004/01/31 10:14:08 aamici |
| 40 | # fix all stale references after the libtool transition. |
| 41 | # don't install non-python data files. |
| 42 | # |
| 43 | # Revision 1.3 2003/02/07 14:14:00 warmerda |
| 44 | # fixed spelling of python |
| 45 | # |
| 46 | # Revision 1.2 2003/02/07 14:11:03 warmerda |
| 47 | # corrected a few info items, added header |
| 48 | # |
| 49 | |
| 50 | import string |
| 51 | from distutils.core import setup, Extension |
| 52 | import os, os.path, glob |
| 53 | |
| 54 | # |
| 55 | # debug |
| 56 | # |
| 57 | #import sys |
| 58 | #sys.argv.append("build") |
| 59 | |
| 60 | f=open(os.path.join("VERSION")) |
| 61 | v=f.read() |
| 62 | f.close() |
| 63 | del f |
| 64 | |
| 65 | version=v.strip() |
| 66 | dllversion=version.replace(".","") |
| 67 | soversion=v[:3] |
| 68 | |
| 69 | SOURCES=glob.glob(os.path.join("pymod","*.c*")) |
| 70 | print SOURCES |
| 71 | INCLUDE_DIRS=[os.path.join("gcore"), os.path.join("port"), os.path.join("ogr"), os.path.join("pymod"), os.path.join("alg")] # only necessary |
| 72 | LIBRARY_DIRS = ["./.libs"] |
| 73 | |
| 74 | INCLUDE_FILES = [ |
| 75 | glob.glob(os.path.join("gcore", "*.h")), |
| 76 | glob.glob(os.path.join("port", "*.h")), |
| 77 | glob.glob(os.path.join("alg", "*.h")), |
| 78 | glob.glob(os.path.join("ogr", "*.h")), |
| 79 | glob.glob(os.path.join("ogr", "ogrsf_frmts", "*.h")), |
| 80 | glob.glob(os.path.join("pymod", "*.h")) |
| 81 | ] |
| 82 | |
| 83 | IF=[] |
| 84 | for i in INCLUDE_FILES: |
| 85 | IF.extend(i) |
| 86 | INCLUDE_FILES=IF |
| 87 | del IF |
| 88 | |
| 89 | HTML_FILES=glob.glob(os.path.join("html", "*")) |
| 90 | |
| 91 | #HTML_FILES.remove(os.path.join("html", ".cvsignore")) |
| 92 | |
| 93 | #print INCLUDE_FILES |
| 94 | |
| 95 | if os.name=="nt": |
| 96 | DLL="gdal%s.dll" % dllversion |
| 97 | DATA_FILES=[ |
| 98 | ("", [DLL]), |
| 99 | # ("libs", [os.path.join("gdal_i.lib"), os.path.join("pymod","_gdal.lib")]), |
| 100 | ("libs", [os.path.join("gdal_i.lib")]), |
| 101 | ] |
| 102 | LIBRARIES = ["gdal_i"] |
| 103 | EXTRA_LINK_ARGS=[] |
| 104 | else: |
| 105 | if os.name=="mac": |
| 106 | soext = "dylib" |
| 107 | else: |
| 108 | soext = "so" |
| 109 | DATA_FILES=[ |
| 110 | ("lib", ['libgdal.%s.%s' % (soversion, soext)]), |
| 111 | ] |
| 112 | LIBRARIES = [] |
| 113 | #EXTRA_LINK_ARGS=[os.path.join("gdal.a")] |
| 114 | LIBRARIES = ["gdal"] |
| 115 | EXTRA_LINK_ARGS=[] |
| 116 | |
| 117 | DATA_FILES.append(("include", INCLUDE_FILES)) |
| 118 | DATA_FILES.append((os.path.join("doc","gdal"), HTML_FILES)) |
| 119 | |
| 120 | setup (name = "Python_GDAL", |
| 121 | version = version, |
| 122 | description = "Geospatial Data Abstraction Library: Python Bindings", |
| 123 | author = "Frank Warmerdam", |
| 124 | #packager = "Evgeniy Cherkashin", |
| 125 | author_email = "warmerdam@pobox.com", |
| 126 | #packager_email = "eugeneai@icc.ru", |
| 127 | url = "http://www.remotesensing.org/gdal/", |
| 128 | packages = [''], |
| 129 | package_dir = {'': 'pymod'}, |
| 130 | #extra_path = "gdal", |
| 131 | ext_modules = [Extension('_gdalmodule', |
| 132 | sources = SOURCES, |
| 133 | include_dirs = INCLUDE_DIRS, |
| 134 | libraries = LIBRARIES, |
| 135 | library_dirs = LIBRARY_DIRS, |
| 136 | extra_link_args=EXTRA_LINK_ARGS, |
| 137 | ), |
| 138 | ], |
| 139 | #data_files = DATA_FILES |
| 140 | ) |
| 141 |
Note: See TracBrowser for help on using the browser.
