1 |
# Copyright (c) 2001, 2002 by Intevation GmbH |
# Copyright (c) 2001, 2002, 2003, 2004, 2005 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
15 |
# hand below. |
# hand below. |
16 |
# |
# |
17 |
|
|
18 |
|
import sys |
19 |
import os |
import os |
20 |
from types import TupleType |
from types import TupleType |
21 |
|
import glob |
22 |
from distutils.core import setup, Extension, Command |
from distutils.core import setup, Extension, Command |
23 |
from distutils.command.install import install, INSTALL_SCHEMES, subst_vars |
from distutils.command.install import install, INSTALL_SCHEMES, subst_vars |
24 |
from distutils.command.build_py import build_py |
from distutils.command.build_py import build_py |
25 |
from distutils.command.bdist_rpm import bdist_rpm |
from distutils.command.bdist_rpm import bdist_rpm |
26 |
|
from distutils.command.build_ext import build_ext |
27 |
from distutils.file_util import write_file |
from distutils.file_util import write_file |
28 |
from distutils.filelist import FileList |
from distutils.filelist import FileList |
29 |
from distutils.util import convert_path, change_root |
from distutils.util import convert_path, change_root |
34 |
from string import split |
from string import split |
35 |
import string |
import string |
36 |
|
|
37 |
|
# config script parameter list indices |
38 |
|
CS_DEFS, CS_INCDIRS, CS_LIBDIRS, CS_LIBS, CS_NUM_PARAMS = range(5) |
39 |
|
|
40 |
|
# support for gdal is on by default, but under posix we try to |
41 |
|
# detect it anyway. Set this to False to disable GDAL. |
42 |
|
include_gdal = True |
43 |
|
|
44 |
if os.name == "posix": |
if os.name == "posix": |
45 |
################################################################### |
################################################################### |
46 |
# Posix configuration. Adapt this if you're running some kind of |
# Posix configuration. Adapt this if you're running some kind of |
61 |
# with the install command's --prefix option. |
# with the install command's --prefix option. |
62 |
# |
# |
63 |
# Note that there's a separate prefix option for the bdist_rpm |
# Note that there's a separate prefix option for the bdist_rpm |
64 |
# command completely independend of this one. |
# command completely independent of this one. |
65 |
prefix = "/usr/local/" |
prefix = "/usr/local/" |
66 |
|
|
67 |
# Whether to create the thubaninit module. You can override this |
# Whether to create the thubaninit module. You can override this |
73 |
# flags |
# flags |
74 |
wx_config_script = "wx-config" |
wx_config_script = "wx-config" |
75 |
# These lists will be filled automatically below |
# These lists will be filled automatically below |
76 |
wx_defs = [] |
wx_cs_params = [[] for i in range(CS_NUM_PARAMS)] |
77 |
wx_incdirs = [] |
|
78 |
wx_libdirs = [] |
gdal_config_script = "gdal-config" |
79 |
wx_libs = [] |
gdal_cs_params = [[] for i in range(CS_NUM_PARAMS)] |
80 |
|
|
81 |
elif os.name == "nt": |
elif os.name == "nt": |
82 |
################################################################# |
################################################################# |
83 |
# Windows configuration. |
# Windows configuration. |
84 |
# |
# |
85 |
|
|
86 |
|
basedir = os.path.dirname(sys.argv[0]) |
87 |
|
|
88 |
# Directories where Proj4 is installed |
# Directories where Proj4 is installed |
89 |
proj4_prefix = r"D:\cygwin\home\user\proj-4.4.3\src" |
proj4_prefix = os.path.join(basedir, "..", "proj-4.4.9", "src") |
90 |
proj4_incdir = proj4_prefix |
proj4_incdir = proj4_prefix |
91 |
proj4_libdir = proj4_prefix |
proj4_libdir = proj4_prefix |
92 |
proj4_lib = "proj_i" |
proj4_lib = "proj_i" |
93 |
|
|
94 |
# Define include and lib directories for wxWindows and |
# Define include and lib directories for wxWindows and |
95 |
wx_prefix = r"D:\wx230" |
wx_prefix = os.path.join(basedir, "..", "wxPython-2.6.3.3") |
96 |
wx_inc = os.path.join(wx_prefix, "include") |
wx_inc = [os.path.join(wx_prefix, 'lib', 'vc_dll', 'mswuh'), |
97 |
wx_lib = os.path.join(wx_prefix, "lib") |
os.path.join(wx_prefix, "include")] |
98 |
|
wx_lib = [os.path.join(wx_prefix, "lib", "vc_dll")] |
99 |
|
|
100 |
|
# Define include and lib directories for GDAL |
101 |
|
gdal_prefix = os.path.join(basedir, "..", "gdal-1.3.2") |
102 |
|
gdal_inc = [os.path.join(gdal_prefix, 'alg'), |
103 |
|
os.path.join(gdal_prefix, 'ogr'), |
104 |
|
os.path.join(gdal_prefix, 'port'), |
105 |
|
os.path.join(gdal_prefix, 'gcore'), |
106 |
|
os.path.join(gdal_prefix, 'core')] |
107 |
|
gdal_lib = [gdal_prefix] |
108 |
|
|
109 |
# |
# |
110 |
# Unless you use a wxPython version other than 2.3.1, you probably |
# Unless you use a wxPython version other than 2.4.0, you probably |
111 |
# shouldn't have to modify anything below here |
# shouldn't have to modify anything below here |
112 |
################################################################## |
################################################################## |
113 |
|
|
131 |
# there's no config script. |
# there's no config script. |
132 |
wx_config_script = "" |
wx_config_script = "" |
133 |
|
|
134 |
|
wx_cs_params = [[] for i in range(CS_NUM_PARAMS)] |
135 |
|
|
136 |
# the values of wx_defs and wx_libs. copied from the wxPython |
# the values of wx_defs and wx_libs. copied from the wxPython |
137 |
# setup.py |
# setup.py |
138 |
wx_defs = [ ('WIN32', None), # Some of these are no longer |
wx_cs_params[CS_DEFS] = \ |
139 |
|
[ ('WIN32', None), # Some of these are no longer |
140 |
('__WIN32__', None), # necessary. Anybody know which? |
('__WIN32__', None), # necessary. Anybody know which? |
141 |
('_WINDOWS', None), |
('_WINDOWS', None), |
142 |
('__WINDOWS__', None), |
('__WINDOWS__', None), |
152 |
('WXP_USE_THREAD', '1'), |
('WXP_USE_THREAD', '1'), |
153 |
] |
] |
154 |
|
|
155 |
wx_incdirs = [wx_inc] |
wx_cs_params[CS_INCDIRS] = wx_inc |
156 |
wx_libdirs = [wx_lib] |
wx_cs_params[CS_LIBDIRS] = wx_lib |
157 |
wx_libs = ["wx23_1h"] |
wx_cs_params[CS_LIBS] = ["wxmsw26uh"] \ |
158 |
wx_libs = wx_libs + ['kernel32', 'user32', 'gdi32', 'comdlg32', |
+ ['kernel32', 'user32', 'gdi32', 'comdlg32', |
159 |
'winspool', 'winmm', 'shell32', 'oldnames', |
'winspool', 'winmm', 'shell32', 'oldnames', |
160 |
'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', |
'comctl32', 'odbc32', 'ole32', 'oleaut32', |
161 |
'uuid', 'rpcrt4', 'advapi32', 'wsock32'] |
'uuid', 'rpcrt4', 'advapi32', 'wsock32'] |
162 |
|
|
163 |
|
gdal_config_script = "" |
164 |
|
gdal_cs_params = [[] for i in range(CS_NUM_PARAMS)] |
165 |
|
|
166 |
|
gdal_cs_params[CS_INCDIRS] = gdal_inc |
167 |
|
gdal_cs_params[CS_LIBDIRS] = gdal_lib |
168 |
|
gdal_cs_params[CS_LIBS] = ["gdal_i"] |
169 |
|
|
170 |
else: |
else: |
171 |
raise RuntimeError("Unsupported platform " + os.name) |
raise RuntimeError("Unsupported platform " + os.name) |
172 |
|
|
193 |
return result |
return result |
194 |
|
|
195 |
|
|
196 |
def run_wx_script(command): |
def run_cs_script(command, store): |
197 |
# first, determine the C++ preprocessor flags Use --cflags here |
# first, determine the C++ preprocessor flags Use --cflags here |
198 |
# because it seems that older version don't have --cxxflags and |
# because it seems that older version don't have --cxxflags and |
199 |
# newer ones return the same result for both |
# newer ones return the same result for both |
200 |
flags = run_script(command + ' --cflags ') |
flags = run_script(command + ' --cflags ') |
201 |
if flags is None: |
if flags is None: |
202 |
return 0 |
return False |
203 |
for flag in split(flags): |
for flag in split(flags): |
204 |
start = flag[:2] |
start = flag[:2] |
205 |
value = flag[2:] |
value = flag[2:] |
206 |
if start == "-I": |
if start == "-I": |
207 |
wx_incdirs.append(value) |
store[CS_INCDIRS].append(value) |
208 |
elif start == "-D": |
elif start == "-D": |
209 |
wx_defs.append((value, None)) |
store[CS_DEFS].append((value, None)) |
210 |
|
|
211 |
# determine the library flags |
# determine the library flags |
212 |
flags = run_script(command + ' --libs') |
flags = run_script(command + ' --libs') |
213 |
if flags is None: |
if flags is None: |
214 |
return 0 |
return False |
215 |
for flag in split(flags): |
for flag in split(flags): |
216 |
start = flag[:2] |
start = flag[:2] |
217 |
value = flag[2:] |
value = flag[2:] |
218 |
if start == "-L": |
if start == "-L": |
219 |
wx_libdirs.append(value) |
store[CS_LIBDIRS].append(value) |
220 |
elif start == "-l": |
elif start == "-l": |
221 |
wx_libs.append(value) |
store[CS_LIBS].append(value) |
222 |
|
|
223 |
|
return True |
224 |
|
|
225 |
if wx_config_script: |
if wx_config_script: |
226 |
# if there's a wx config script, run it to determine the configuration |
# if there's a wx config script, run it to determine the configuration |
227 |
run_wx_script(wx_config_script) |
run_cs_script(wx_config_script, wx_cs_params) |
|
|
|
228 |
|
|
229 |
|
if gdal_config_script: |
230 |
|
# if there's a gdal config script, run it to determine the configuration |
231 |
|
include_gdal = include_gdal \ |
232 |
|
and run_cs_script(gdal_config_script, gdal_cs_params) |
233 |
|
|
234 |
# |
# |
235 |
# Define some extension and python modules |
# Define some extension and python modules |
236 |
# |
# |
237 |
# The C-extension names are prefixed woth "Lib." so they get put into |
# The C-extension names are prefixed with "Lib." so they get put into |
238 |
# the Lib/ subdirectory. Lib/ is not really a package but distutils |
# the Lib/ subdirectory. Lib/ is not really a package but distutils |
239 |
# doesn't care |
# doesn't care |
240 |
|
|
241 |
# subdirectory containing the extensions |
# subdirectory containing the distutil extensions |
242 |
ext_dir = "extensions" |
ext_dir = "libraries" |
243 |
|
|
244 |
# subdirectory with some shapelib files |
# subdirectory with some shapelib files |
245 |
shp_dir = ext_dir + "/shapelib" |
shp_dir = ext_dir + "/shapelib" |
253 |
# Thuban specific modules |
# Thuban specific modules |
254 |
# |
# |
255 |
|
|
256 |
extensions.append(Extension("Lib.wxproj", |
wxproj_extension = Extension("Lib.wxproj", |
257 |
[ext_dir + "/thuban/wxproj.cpp"], |
[ext_dir + "/thuban/wxproj.cpp"], |
258 |
include_dirs = ([shp_dir, proj4_incdir, |
include_dirs = ([shp_dir, proj4_incdir, |
259 |
ext_dir + "/pyshapelib/"] |
ext_dir + "/pyshapelib/"] |
260 |
+ wx_incdirs), |
+ wx_cs_params[CS_INCDIRS]), |
261 |
define_macros = wx_defs, |
define_macros = wx_cs_params[CS_DEFS], |
262 |
library_dirs = [proj4_libdir] + wx_libdirs, |
library_dirs = [proj4_libdir] + |
263 |
libraries = [proj4_lib] + wx_libs)) |
wx_cs_params[CS_LIBDIRS], |
264 |
|
libraries = [proj4_lib] + wx_cs_params[CS_LIBS]) |
265 |
|
extensions.append(wxproj_extension) |
266 |
|
|
267 |
|
|
268 |
# |
# |
269 |
# shapelib wrappers are also distributed with thuban |
# shapelib wrappers are also distributed with thuban |
270 |
# |
# |
271 |
|
|
272 |
extensions.append(Extension("Lib.shapelibc", |
extensions.append(Extension("Lib.shapelib", |
273 |
[ext_dir + "/pyshapelib/shapelib_wrap.c", |
[ext_dir + "/pyshapelib/shapelib.c", |
274 |
shp_dir + "/shpopen.c", |
shp_dir + "/shpopen.c", |
275 |
shp_dir + "/shptree.c"], |
shp_dir + "/shptree.c"], |
276 |
include_dirs = [shp_dir])) |
include_dirs = [shp_dir])) |
280 |
extensions.append(Extension("Lib.dbflibc", |
extensions.append(Extension("Lib.dbflibc", |
281 |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
282 |
shp_dir + "/dbfopen.c"], |
shp_dir + "/dbfopen.c"], |
283 |
include_dirs = [shp_dir])) |
include_dirs = [shp_dir], |
284 |
|
define_macros = [("HAVE_UPDATE_HEADER", "1")])) |
285 |
for name in ("shapelib", "dbflib"): |
for name in ("shapelib", "dbflib"): |
286 |
py_modules.append(ext_dir + "/pyshapelib/" + name) |
py_modules.append(ext_dir + "/pyshapelib/" + name) |
287 |
|
|
302 |
|
|
303 |
data_files = [] |
data_files = [] |
304 |
|
|
305 |
# bitmaps |
# Resources |
306 |
dir = "Resources/Bitmaps" |
for d, patterns in [("Resources/Bitmaps", |
307 |
bitmaps = [] |
("Resources/Bitmaps/*.xpm",)), |
308 |
for file in os.listdir(os.path.join("Resources", "Bitmaps")): |
("Resources/Projections", |
309 |
if string.lower(file[-4:]) == ".xpm": |
("Resources/Projections/*.proj",)), |
310 |
bitmaps.append(dir + '/' + file) |
("Resources/XML", |
311 |
data_files.append((dir, bitmaps)) |
("Resources/XML/*.dtd",)), |
312 |
|
("Extensions/importAPR/samples", |
313 |
|
("Extensions/importAPR/samples/README", |
314 |
|
"Extensions/importAPR/samples/*.apr")), |
315 |
|
]: |
316 |
|
for pattern in patterns: |
317 |
|
data_files.append((d, glob.glob(pattern))) |
318 |
|
if os.path.isdir("Resources/Locale"): |
319 |
|
for d in os.listdir("Resources/Locale"): |
320 |
|
data_files.append(("Resources/Locale/" + d +"/LC_MESSAGES", |
321 |
|
["Resources/Locale/"+ d +"/LC_MESSAGES/thuban.mo"])) |
322 |
|
|
323 |
|
#add the Lib content to the output |
324 |
|
if os.path.isdir("Lib"): |
325 |
|
for d in os.listdir("Lib"): |
326 |
|
data_files.append(("Lib", ["Lib/"+d])) |
327 |
|
|
328 |
|
|
329 |
# |
# |
330 |
# Command definitions |
# Command definitions |
546 |
distribution. |
distribution. |
547 |
""" |
""" |
548 |
|
|
549 |
|
# FIXME: When Thuban can rely on Python 2.3 as the oldest supported |
550 |
|
# Python release we don't need to override the run and |
551 |
|
# find_all_modules methods anymore. distutils will allow both python |
552 |
|
# modules and packages starting with 2.3. |
553 |
|
|
554 |
def run(self): |
def run(self): |
555 |
"""The same the as the original in build_py revision 1.33 except |
"""The same the as the original in build_py revision 1.33 except |
556 |
that this allows both packages and modules to be in one |
that this allows both packages and modules to be in one |
661 |
("extra-files", None, |
("extra-files", None, |
662 |
"List of filenames or (src, dest) pairs describing" |
"List of filenames or (src, dest) pairs describing" |
663 |
" extra files to install " |
" extra files to install " |
664 |
"(can only be set from witin setup.py"), |
"(can only be set from within setup.py"), |
665 |
|
|
666 |
("create-init-module=", None, |
("create-init-module=", None, |
667 |
"If true, create a module in the site-packages" |
"If true, create a module in the site-packages" |
806 |
|
|
807 |
bdist_rpm_prep_script = ''' |
bdist_rpm_prep_script = ''' |
808 |
%setup |
%setup |
809 |
cp extensions/pyshapelib/{README,README.pyshapelib} |
cp libraries/pyshapelib/{README,README.pyshapelib} |
810 |
cp extensions/pyshapelib/{COPYING,COPYING.pyshapelib} |
cp libraries/pyshapelib/{COPYING,COPYING.pyshapelib} |
811 |
cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection} |
cp libraries/pyprojection/{LICENSE,LICENSE.pyprojection} |
812 |
|
''' |
813 |
|
|
814 |
|
bdist_rpm_build_script = ''' |
815 |
|
env PATH="$PATH:%(prefix)s/lib/wxPython/bin:/usr/lib/wxPython/bin" CFLAGS="$RPM_OPT_FLAGS" %(python)s setup.py build |
816 |
''' |
''' |
817 |
|
|
818 |
bdist_rpm_install_script = ''' |
bdist_rpm_install_script = ''' |
838 |
# scripts such as the python interpreter to use are only known |
# scripts such as the python interpreter to use are only known |
839 |
# then. |
# then. |
840 |
open("bdist_rpm_prep", "w").close() |
open("bdist_rpm_prep", "w").close() |
841 |
|
open("bdist_rpm_build", "w").close() |
842 |
open("bdist_rpm_install", "w").close() |
open("bdist_rpm_install", "w").close() |
843 |
bdist_rpm.initialize_options(self) |
bdist_rpm.initialize_options(self) |
844 |
|
|
846 |
# create the scripts for the spec-file. Now we know the python |
# create the scripts for the spec-file. Now we know the python |
847 |
# interpreter to use. |
# interpreter to use. |
848 |
open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script) |
open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script) |
849 |
|
|
850 |
|
build = bdist_rpm_build_script % {"python": self.python, |
851 |
|
"prefix": self.prefix} |
852 |
|
open("bdist_rpm_build", "w").write(build) |
853 |
|
|
854 |
install = bdist_rpm_install_script % {"python": self.python, |
install = bdist_rpm_install_script % {"python": self.python, |
855 |
"prefix": self.prefix} |
"prefix": self.prefix} |
856 |
open("bdist_rpm_install", "w").write(install) |
open("bdist_rpm_install", "w").write(install) |
932 |
if self.output_basename is None: |
if self.output_basename is None: |
933 |
self.output_basename = "%s-%s-%d" \ |
self.output_basename = "%s-%s-%d" \ |
934 |
% (name, self.distribution.get_version(), |
% (name, self.distribution.get_version(), |
935 |
self.iss_revision) |
int(self.iss_revision)) |
936 |
|
|
937 |
def run(self, install_options = None): |
def run(self, install_options = None): |
938 |
"""Execute the command. install_options if given, should be a |
"""Execute the command. install_options if given, should be a |
939 |
directory of additional options to set in the install step""" |
directory of additional options to set in the install step""" |
940 |
# Obviously have to build before we can install |
# Obviously have to build before we can install |
941 |
|
|
942 |
|
# add gdal to the build |
943 |
|
for (dirpath, dnames, fnames) in os.walk('gdal'): |
944 |
|
files_in_dir = [] |
945 |
|
dp = '/'.join(dirpath.split('\\')) |
946 |
|
for f in fnames: |
947 |
|
if os.path.isfile(os.path.join(dirpath,f)): |
948 |
|
files_in_dir.append( dp + '/' + f) |
949 |
|
if len(files_in_dir) > 0: |
950 |
|
data_files.append(( dp , files_in_dir)) |
951 |
|
# add thubaninit to the build |
952 |
|
|
953 |
|
|
954 |
if not self.skip_build: |
if not self.skip_build: |
955 |
self.run_command('build') |
self.run_command('build') |
956 |
|
|
1063 |
def run(self): |
def run(self): |
1064 |
install_options = { |
install_options = { |
1065 |
"prefix": ".", |
"prefix": ".", |
1066 |
|
"install_lib": "$base", |
1067 |
|
"install_data": "$base", |
1068 |
"install_scripts": "$base", |
"install_scripts": "$base", |
1069 |
"warn_dir": 0, |
"warn_dir": 0, |
1070 |
"extra_files": ["COPYING", "Lib/proj.dll"], |
"extra_files": ["COPYING", "Lib/proj.dll"], |
1071 |
} |
} |
1072 |
|
install_options["extra_files"].extend(self.get_gdal_content()) |
1073 |
|
|
1074 |
# don't make a symlink because we're simulating windows, so |
# don't make a symlink because we're simulating windows, so |
1075 |
# that we can generate the iss-file even on Linux |
# that we can generate the iss-file even on Linux |
1076 |
install_options["do_symlink"] = 0 |
install_options["do_symlink"] = 0 |
1077 |
|
|
1078 |
bdist_inno.run(self, install_options) |
bdist_inno.run(self, install_options) |
1079 |
|
|
1080 |
|
def get_gdal_content(self): |
1081 |
|
''' |
1082 |
|
Return the list of files in the gdal directory of the Thuban installation |
1083 |
|
''' |
1084 |
|
gdal_files = [] |
1085 |
|
for (dirpath, dnames, fnames) in os.walk('gdal'): |
1086 |
|
if len(fnames) > 0: |
1087 |
|
for file in fnames : |
1088 |
|
gdal_files.append(dirpath + os.sep + file) |
1089 |
|
return gdal_files |
1090 |
|
|
1091 |
|
class thuban_build_docs(Command): |
1092 |
|
|
1093 |
|
"""Command to generate documentation from source code.""" |
1094 |
|
|
1095 |
|
description = "Generate documentation." |
1096 |
|
|
1097 |
|
user_options = [] |
1098 |
|
|
1099 |
|
def initialize_options(self): pass |
1100 |
|
|
1101 |
|
def finalize_options(self): pass |
1102 |
|
|
1103 |
|
def run(self, install_options = None): |
1104 |
|
self.spawn(["happydoc", "-d./Doc", "./Thuban"]) |
1105 |
|
|
1106 |
|
class thuban_build_ext(build_ext): |
1107 |
|
|
1108 |
|
"""Extend the build_ext command with some Thuban specific options |
1109 |
|
|
1110 |
|
--with-gdal, --without-gdal |
1111 |
|
|
1112 |
|
Switch the optional GDAL support on/off. Default is On. |
1113 |
|
|
1114 |
|
--use-wx-python-swig-hack |
1115 |
|
|
1116 |
|
For performance reasons, Thuban access wxPython objects at the |
1117 |
|
C++ level so that it can directly call wxWidgets code from C++. |
1118 |
|
The normal and preferred way to do that is to use the API |
1119 |
|
defined in wxPython.h. Unfortunately, this header file is not |
1120 |
|
distributed with binary packages of wxPython on some platforms. |
1121 |
|
By using the --use-wx-python-swig-hack option you can activate a |
1122 |
|
way to access the C++ objects without wxPython.h. This relies |
1123 |
|
on internals of SWIG, so it might change with future wxPython |
1124 |
|
versions. Therefore, only use this option if the normal way |
1125 |
|
doesn't work for you. |
1126 |
|
""" |
1127 |
|
|
1128 |
|
user_options = build_ext.user_options[:] |
1129 |
|
user_options.extend([("with-gdal", None, "Include GDAL support."), |
1130 |
|
("without-gdal", None, "Don't include GDAL support."), |
1131 |
|
("use-wx-python-swig-hack", None, |
1132 |
|
"Use a hack to access wxPython objects at the C++ level" |
1133 |
|
"(use only when you absolutely can't use wxPython.h)")]) |
1134 |
|
|
1135 |
|
boolean_options = ["with-gdal", "use-wx-python-swig-hack"] |
1136 |
|
negative_opt = {'without-gdal' : 'with-gdal'} |
1137 |
|
|
1138 |
|
def initialize_options(self): |
1139 |
|
self.with_gdal = True |
1140 |
|
self.use_wx_python_swig_hack = False |
1141 |
|
build_ext.initialize_options(self) |
1142 |
|
|
1143 |
|
def finalize_options(self): |
1144 |
|
build_ext.finalize_options(self) |
1145 |
|
if self.with_gdal and include_gdal: |
1146 |
|
self.extensions.append(Extension("Lib.gdalwarp", |
1147 |
|
[ext_dir + "/thuban/gdalwarp.cpp"], |
1148 |
|
include_dirs = gdal_cs_params[CS_INCDIRS] + |
1149 |
|
[ext_dir + "/thuban/"], |
1150 |
|
define_macros = gdal_cs_params[CS_DEFS], |
1151 |
|
library_dirs = gdal_cs_params[CS_LIBDIRS], |
1152 |
|
libraries = gdal_cs_params[CS_LIBS])) |
1153 |
|
if self.use_wx_python_swig_hack: |
1154 |
|
wxproj_extension.define_macros.append(("USE_WX_PYTHON_SWIG_HACK", |
1155 |
|
None)) |
1156 |
|
|
1157 |
|
def run(self, install_options = None): |
1158 |
|
build_ext.run(self) |
1159 |
|
|
1160 |
# |
# |
1161 |
# Run the script |
# Run the script |
1162 |
# |
# |
1163 |
|
|
|
|
|
1164 |
long_description = """\ |
long_description = """\ |
1165 |
Thuban is a viewer for geographic data written in Python |
Thuban is a viewer for geographic data written in Python |
1166 |
""" |
""" |
1167 |
|
|
1168 |
setup(name = "Thuban", |
setup(name = "Thuban", |
1169 |
version = "0.1.3", |
version = "1.2.0", |
1170 |
description = "Geographic data viewer", |
description = "Geographic data viewer", |
1171 |
long_description = long_description, |
long_description = long_description, |
1172 |
licence = "GPL", |
license = "GPL", |
1173 |
author = "Intevation GmbH", |
author = "Intevation GmbH", |
1174 |
author_email = "[email protected]", |
author_email = "[email protected]", |
1175 |
url = "http://thuban.intevation.de/", |
url = "http://thuban.intevation.de/", |
1176 |
|
|
1177 |
scripts = ["thuban.py"], |
scripts = ["thuban.py"], |
1178 |
packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI"], |
packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI", |
1179 |
|
"Extensions", "Extensions.gns2shp", "Extensions.wms", |
1180 |
|
"Extensions.importAPR", "Extensions.profiling", |
1181 |
|
"Extensions.svgexport", "Extensions.mouseposition", |
1182 |
|
"Extensions.bboxdump", "Extensions.ogr", |
1183 |
|
"Extensions.umn_mapserver"], |
1184 |
ext_modules = extensions, |
ext_modules = extensions, |
1185 |
py_modules = py_modules, |
py_modules = py_modules, |
1186 |
data_files = data_files, |
data_files = data_files, |
1194 |
"install_lib": "$base/lib/thuban", |
"install_lib": "$base/lib/thuban", |
1195 |
"install_scripts": "$base/lib/thuban", |
"install_scripts": "$base/lib/thuban", |
1196 |
"install_data": "$base/lib/thuban", |
"install_data": "$base/lib/thuban", |
|
|
|
1197 |
# Don't print warning messages about the lib dir not |
# Don't print warning messages about the lib dir not |
1198 |
# being on Python's path. The libraries are Thuban |
# being on Python's path. The libraries are Thuban |
1199 |
# specific and are installed just for Thuban. They'll |
# specific and are installed just for Thuban. They'll |
1212 |
"install": ThubanInstall, |
"install": ThubanInstall, |
1213 |
"bdist_rpm": thuban_bdist_rpm, |
"bdist_rpm": thuban_bdist_rpm, |
1214 |
"bdist_inno": thuban_bdist_inno, |
"bdist_inno": thuban_bdist_inno, |
1215 |
"data_dist": data_dist |
"data_dist": data_dist, |
1216 |
|
"build_docs": thuban_build_docs, |
1217 |
|
"build_ext": thuban_build_ext |
1218 |
}) |
}) |
1219 |
|
|
1220 |
|
|