1 |
# Copyright (c) 2001, 2002, 2003 by Intevation GmbH |
# Copyright (c) 2001, 2002, 2003, 2004 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 |
import glob |
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.7\src" |
proj4_prefix = os.path.join(basedir, "..", "proj-4.4.7", "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:\cygwin\home\user\project\greater\wxPython-2.4.0.4" |
wx_prefix = os.path.join(basedir, "..", "wxPython-2.4.2.4") |
96 |
wx_prefix = r"D:\wx-sources\wxPythonSrc-2.4.0.7" |
wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdllh'), |
|
wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdll'), |
|
97 |
os.path.join(wx_prefix, "include")] |
os.path.join(wx_prefix, "include")] |
98 |
wx_lib = [os.path.join(wx_prefix, "lib")] |
wx_lib = [os.path.join(wx_prefix, "lib")] |
99 |
|
|
100 |
# Define include and lib directories for GDAL |
# Define include and lib directories for GDAL |
101 |
gdal_prefix = r"D:\cygwin\home\user\build\gdal-1.1.8" |
gdal_prefix = os.path.join(basedir, "..", "gdal-1.1.8") |
102 |
gdal_inc = [os.path.join(gdal_prefix, 'alg'), |
gdal_inc = [os.path.join(gdal_prefix, 'alg'), |
103 |
os.path.join(gdal_prefix, 'ogr'), |
os.path.join(gdal_prefix, 'ogr'), |
104 |
os.path.join(gdal_prefix, 'port'), |
os.path.join(gdal_prefix, 'port'), |
153 |
|
|
154 |
wx_cs_params[CS_INCDIRS] = wx_inc |
wx_cs_params[CS_INCDIRS] = wx_inc |
155 |
wx_cs_params[CS_LIBDIRS] = wx_lib |
wx_cs_params[CS_LIBDIRS] = wx_lib |
156 |
wx_cs_params[CS_LIBS] = ["wxmsw24"] \ |
wx_cs_params[CS_LIBS] = ["wxmsw24h"] \ |
157 |
+ ['kernel32', 'user32', 'gdi32', 'comdlg32', |
+ ['kernel32', 'user32', 'gdi32', 'comdlg32', |
158 |
'winspool', 'winmm', 'shell32', 'oldnames', |
'winspool', 'winmm', 'shell32', 'oldnames', |
159 |
'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', |
'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', |
233 |
# |
# |
234 |
# Define some extension and python modules |
# Define some extension and python modules |
235 |
# |
# |
236 |
# 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 |
237 |
# the Lib/ subdirectory. Lib/ is not really a package but distutils |
# the Lib/ subdirectory. Lib/ is not really a package but distutils |
238 |
# doesn't care |
# doesn't care |
239 |
|
|
240 |
# subdirectory containing the extensions |
# subdirectory containing the distutil extensions |
241 |
ext_dir = "extensions" |
ext_dir = "libraries" |
242 |
|
|
243 |
# subdirectory with some shapelib files |
# subdirectory with some shapelib files |
244 |
shp_dir = ext_dir + "/shapelib" |
shp_dir = ext_dir + "/shapelib" |
278 |
extensions.append(Extension("Lib.dbflibc", |
extensions.append(Extension("Lib.dbflibc", |
279 |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
280 |
shp_dir + "/dbfopen.c"], |
shp_dir + "/dbfopen.c"], |
281 |
include_dirs = [shp_dir])) |
include_dirs = [shp_dir], |
282 |
|
define_macros = [("HAVE_UPDATE_HEADER", "1")])) |
283 |
for name in ("shapelib", "dbflib"): |
for name in ("shapelib", "dbflib"): |
284 |
py_modules.append(ext_dir + "/pyshapelib/" + name) |
py_modules.append(ext_dir + "/pyshapelib/" + name) |
285 |
|
|
300 |
|
|
301 |
data_files = [] |
data_files = [] |
302 |
|
|
303 |
# bitmaps |
# Resources |
304 |
# ("Resources/Locale", "Resources/Locale/*/LC_MESSAGES/*.mo") |
for d, patterns in [("Resources/Bitmaps", |
305 |
for d, pattern in [("Resources/Bitmaps", "Resources/Bitmaps/*.xpm")]: |
("Resources/Bitmaps/*.xpm",)), |
306 |
data_files.append((d, glob.glob(pattern))) |
("Resources/Projections", |
307 |
|
("Resources/Projections/*.proj",)), |
308 |
|
("Resources/XML", |
309 |
|
("Resources/XML/*.dtd",)), |
310 |
|
("Extensions/importAPR/samples", |
311 |
|
("Extensions/importAPR/samples/README", |
312 |
|
"Extensions/importAPR/samples/*.apr")), |
313 |
|
]: |
314 |
|
for pattern in patterns: |
315 |
|
data_files.append((d, glob.glob(pattern))) |
316 |
|
if os.path.isdir("Resources/Locale"): |
317 |
|
for d in os.listdir("Resources/Locale"): |
318 |
|
data_files.append(("Resources/Locale/" + d +"/LC_MESSAGES", |
319 |
|
["Resources/Locale/"+ d +"/LC_MESSAGES/thuban.mo"])) |
320 |
|
|
321 |
# |
# |
322 |
# Command definitions |
# Command definitions |
798 |
|
|
799 |
bdist_rpm_prep_script = ''' |
bdist_rpm_prep_script = ''' |
800 |
%setup |
%setup |
801 |
cp extensions/pyshapelib/{README,README.pyshapelib} |
cp libraries/pyshapelib/{README,README.pyshapelib} |
802 |
cp extensions/pyshapelib/{COPYING,COPYING.pyshapelib} |
cp libraries/pyshapelib/{COPYING,COPYING.pyshapelib} |
803 |
cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection} |
cp libraries/pyprojection/{LICENSE,LICENSE.pyprojection} |
804 |
''' |
''' |
805 |
|
|
806 |
bdist_rpm_build_script = ''' |
bdist_rpm_build_script = ''' |
1112 |
""" |
""" |
1113 |
|
|
1114 |
setup(name = "Thuban", |
setup(name = "Thuban", |
1115 |
version = "0.8.0", |
version = "1.0.0", |
1116 |
description = "Geographic data viewer", |
description = "Geographic data viewer", |
1117 |
long_description = long_description, |
long_description = long_description, |
1118 |
licence = "GPL", |
license = "GPL", |
1119 |
author = "Intevation GmbH", |
author = "Intevation GmbH", |
1120 |
author_email = "[email protected]", |
author_email = "[email protected]", |
1121 |
url = "http://thuban.intevation.de/", |
url = "http://thuban.intevation.de/", |
1122 |
|
|
1123 |
scripts = ["thuban.py"], |
scripts = ["thuban.py"], |
1124 |
packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI"], |
packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI", |
1125 |
|
"Extensions", "Extensions.gns2shp", "Extensions.wms", |
1126 |
|
"Extensions.importAPR", "Extensions.profiling"], |
1127 |
ext_modules = extensions, |
ext_modules = extensions, |
1128 |
py_modules = py_modules, |
py_modules = py_modules, |
1129 |
data_files = data_files, |
data_files = data_files, |