48 |
|
|
49 |
# The installation prefix (similar to autoconf's --prefix). This is |
# The installation prefix (similar to autoconf's --prefix). This is |
50 |
# only the default value, you can override it on the command line |
# only the default value, you can override it on the command line |
51 |
# with the install command's --prefix option |
# with the install command's --prefix option. |
52 |
|
# |
53 |
|
# Note that there's a separate prefix option for the bdist_rpm |
54 |
|
# command completely independend of this one. |
55 |
prefix = "/usr/local/" |
prefix = "/usr/local/" |
56 |
|
|
57 |
# On POSIX-systems we run wxgtk-config to determine the C++-compiler |
# On POSIX-systems we run wxgtk-config to determine the C++-compiler |
203 |
# |
# |
204 |
|
|
205 |
extensions.append(Extension("Lib.wxproj", |
extensions.append(Extension("Lib.wxproj", |
206 |
[ext_dir + "/thuban/wxproj.cpp", |
[ext_dir + "/thuban/wxproj.cpp"], |
207 |
shp_dir + "/shpopen.c"], |
include_dirs = ([shp_dir, proj4_incdir, |
208 |
include_dirs = [shp_dir, proj4_incdir] +wx_incdirs, |
ext_dir + "/pyshapelib/"] |
209 |
|
+ wx_incdirs), |
210 |
define_macros = wx_defs, |
define_macros = wx_defs, |
211 |
library_dirs = [proj4_libdir] + wx_libdirs, |
library_dirs = [proj4_libdir] + wx_libdirs, |
212 |
libraries = [proj4_lib] + wx_libs)) |
libraries = [proj4_lib] + wx_libs)) |
217 |
|
|
218 |
extensions.append(Extension("Lib.shapelibc", |
extensions.append(Extension("Lib.shapelibc", |
219 |
[ext_dir + "/pyshapelib/shapelib_wrap.c", |
[ext_dir + "/pyshapelib/shapelib_wrap.c", |
220 |
shp_dir + "/shpopen.c"], |
shp_dir + "/shpopen.c", |
221 |
|
shp_dir + "/shptree.c"], |
222 |
|
include_dirs = [shp_dir])) |
223 |
|
extensions.append(Extension("Lib.shptree", |
224 |
|
[ext_dir + "/pyshapelib/shptreemodule.c"], |
225 |
include_dirs = [shp_dir])) |
include_dirs = [shp_dir])) |
226 |
extensions.append(Extension("Lib.dbflibc", |
extensions.append(Extension("Lib.dbflibc", |
227 |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
[ext_dir + "/pyshapelib/dbflib_wrap.c", |
597 |
return outputs |
return outputs |
598 |
|
|
599 |
|
|
600 |
|
# scripts to override some of the commands put into the spec-file by the |
601 |
|
# bdist_rpm command. |
602 |
|
|
603 |
bdist_rpm_prep_script = ''' |
bdist_rpm_prep_script = ''' |
604 |
%setup |
%setup |
605 |
cp extensions/pyshapelib/{README,README.pyshapelib} |
cp extensions/pyshapelib/{README,README.pyshapelib} |
607 |
cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection} |
cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection} |
608 |
''' |
''' |
609 |
|
|
610 |
|
bdist_rpm_install_script = ''' |
611 |
|
%(python)s setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES \ |
612 |
|
--prefix=%(prefix)s |
613 |
|
''' |
614 |
|
|
615 |
|
|
616 |
class thuban_bdist_rpm(bdist_rpm): |
class thuban_bdist_rpm(bdist_rpm): |
617 |
|
|
618 |
"""Thuban specific RPM distribution command""" |
"""Thuban specific RPM distribution command""" |
619 |
|
|
620 |
|
user_options = bdist_rpm.user_options[:] |
621 |
|
user_options.extend([("prefix=", None, "Install prefix for the RPM"), |
622 |
|
]) |
623 |
|
|
624 |
def initialize_options(self): |
def initialize_options(self): |
625 |
# create the prep script for the spec-file |
# per default, RPMs are installed in /usr |
626 |
open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script) |
self.prefix = "/usr/" |
627 |
|
|
628 |
|
# create the scripts we want to override. We actually fill them |
629 |
|
# with contents later because some values we put into those |
630 |
|
# scripts such as the python interpreter to use are only known |
631 |
|
# then. |
632 |
|
open("bdist_rpm_prep", "w").close() |
633 |
|
open("bdist_rpm_install", "w").close() |
634 |
bdist_rpm.initialize_options(self) |
bdist_rpm.initialize_options(self) |
635 |
|
|
636 |
|
def _make_spec_file(self): |
637 |
|
# create the scripts for the spec-file. Now we know the python |
638 |
|
# interpreter to use. |
639 |
|
open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script) |
640 |
|
install = bdist_rpm_install_script % {"python": self.python, |
641 |
|
"prefix": self.prefix} |
642 |
|
open("bdist_rpm_install", "w").write(install) |
643 |
|
|
644 |
|
# |
645 |
|
return bdist_rpm._make_spec_file(self) |
646 |
|
|
647 |
|
|
648 |
class bdist_inno(Command): |
class bdist_inno(Command): |
649 |
|
|
856 |
""" |
""" |
857 |
|
|
858 |
setup(name = "Thuban", |
setup(name = "Thuban", |
859 |
version = "0.1.1", |
version = "0.1.2", |
860 |
description = "Geographic data viewer", |
description = "Geographic data viewer", |
861 |
long_description = long_description, |
long_description = long_description, |
862 |
licence = "GPL", |
licence = "GPL", |
876 |
{"prefix": prefix, |
{"prefix": prefix, |
877 |
# make sure both libs and scripts are installed in the |
# make sure both libs and scripts are installed in the |
878 |
# same directory. |
# same directory. |
879 |
"install_lib": "$base/thuban", |
"install_lib": "$base/lib/thuban", |
880 |
"install_scripts": "$base/thuban", |
"install_scripts": "$base/lib/thuban", |
881 |
"install_data": "$base/thuban", |
"install_data": "$base/lib/thuban", |
882 |
|
|
883 |
# Don't print warning messages about the lib dir not |
# Don't print warning messages about the lib dir not |
884 |
# being on Python's path. The libraries are Thuban |
# being on Python's path. The libraries are Thuban |