/[thuban]/branches/WIP-pyshapelib-bramz/setup.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/setup.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 212 by bh, Wed Jul 10 14:06:09 2002 UTC revision 515 by jonathan, Tue Mar 11 16:45:20 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001, 2002 by Intevation GmbH  # Copyright (c) 2001, 2002, 2003 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 80  elif os.name == "nt": Line 80  elif os.name == "nt":
80      proj4_lib = "proj_i"      proj4_lib = "proj_i"
81    
82      # Define include and lib directories for wxWindows and      # Define include and lib directories for wxWindows and
83      wx_prefix = r"D:\wx230"      wx_prefix = r"D:\wx240"
84      wx_inc =  os.path.join(wx_prefix, "include")      wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdllh'),
85      wx_lib =  os.path.join(wx_prefix, "lib")                os.path.join(wx_prefix, "include")]
86        wx_lib = [os.path.join(wx_prefix, "lib")]
87    
88    
89      #      #
90      # 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
91      # shouldn't have to modify anything below here      # shouldn't have to modify anything below here
92      ##################################################################      ##################################################################
93            
# Line 127  elif os.name == "nt": Line 129  elif os.name == "nt":
129                  ('WXP_USE_THREAD', '1'),                  ('WXP_USE_THREAD', '1'),
130                  ]                  ]
131            
132      wx_incdirs = [wx_inc]      wx_incdirs = wx_inc
133      wx_libdirs = [wx_lib]      wx_libdirs = wx_lib
134      wx_libs = ["wx23_1h"]      wx_libs = ["wxmsw24h"]
135    
136      wx_libs = wx_libs + ['kernel32', 'user32', 'gdi32', 'comdlg32',      wx_libs = wx_libs + ['kernel32', 'user32', 'gdi32', 'comdlg32',
137                           'winspool', 'winmm', 'shell32', 'oldnames',                           'winspool', 'winmm', 'shell32', 'oldnames',
138                           'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32',                           'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32',
# Line 417  class InstallLocal(Command): Line 420  class InstallLocal(Command):
420    
421      user_options = [      user_options = [
422          ('skip-build', None, "skip the build steps"),          ('skip-build', None, "skip the build steps"),
423            ('create-init-module', None,
424             "Create the thubaninit.py module to ease use of Thuban as a library"),
425            ('dont-create-init-module', None,
426             "Do not create the thubaninit.py module"),
427          ]          ]
428    
429        boolean_options = ["create-init-module"]
430        negative_opt = {'dont-create-init-module' : 'create-init-module'}
431    
432    
433      def initialize_options (self):      def initialize_options (self):
434          self.extensions = None          self.extensions = None
435          self.build_dir = None          self.build_dir = None
436          self.skip_build = None          self.skip_build = None
437            self.create_init_module = None
438    
439      def finalize_options (self):      def finalize_options (self):
440          self.set_undefined_options("install",          self.set_undefined_options("install",
441                                     ("build_lib", "build_dir"),                                     ("build_lib", "build_dir"),
442                                     ('skip_build', 'skip_build'))                                     ('skip_build', 'skip_build'))
443          self.extensions = self.distribution.ext_modules          self.extensions = self.distribution.ext_modules
444            if self.create_init_module is None:
445                # by default we create the init module
446                self.create_init_module = 1
447    
448      def run(self):      def run(self):
449          # Make sure we have built everything we need first          # Make sure we have built everything we need first
# Line 442  class InstallLocal(Command): Line 457  class InstallLocal(Command):
457          else:          else:
458              self.copy_tree(libdir, "Lib")              self.copy_tree(libdir, "Lib")
459    
460            # create the init module if desired
461            if self.create_init_module:
462                # create the init module
463                initfilename = "thubaninit.py"
464                contents = thubaninit_contents("")
465                self.execute(write_file, (initfilename, contents),
466                             "Create %s" % initfilename)
467    
468      def link_dir(self, src, dest):      def link_dir(self, src, dest):
469          """Create a symbolic link dest pointing to src"""          """Create a symbolic link dest pointing to src"""
470          if self.verbose:          if self.verbose:
# Line 468  class thuban_build_py(build_py): Line 491  class thuban_build_py(build_py):
491      distribution.      distribution.
492      """      """
493    
494        # FIXME: When Thuban can rely on Python 2.3 as the oldest supported
495        # Python release we don't need to override the run and
496        # find_all_modules methods anymore. distutils will allow both python
497        # modules and packages starting with 2.3.
498    
499      def run(self):      def run(self):
500          """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
501          that this allows both packages and modules to be in one          that this allows both packages and modules to be in one
# Line 519  class thuban_build_py(build_py): Line 547  class thuban_build_py(build_py):
547          return modules          return modules
548    
549    
550  thubaninit_contents = """  thubaninit_contents_start = """
551  # This module was automatically generated by Thuban's install script  # This module was automatically generated by Thuban's install script
552  '''Import this module once per program (best place is probably the file  '''Import this module once per program (best place is probably the file
553  that ends up as your __main__ module) to be able to import Thuban  that ends up as your __main__ module) to be able to import Thuban
# Line 531  import thubaninit Line 559  import thubaninit
559  import Thuban  import Thuban
560  '''  '''
561  import sys, os  import sys, os
562  sys.path.insert(0, %(thubandir)s)  """
563    
564    thubaninit_contents_thubaninitdir = """
565    sys.path.insert(0, %(thubandir)s)
566    """
567    thubaninit_contents_otherdirs = """
568  # Put the Lib dir into the path. The Lib dir contains some extra Python  # Put the Lib dir into the path. The Lib dir contains some extra Python
569  # modules  # modules
570  import Thuban  import Thuban
# Line 542  if os.path.isdir(dir): Line 574  if os.path.isdir(dir):
574      sys.path.insert(0, dir)      sys.path.insert(0, dir)
575  """  """
576    
577    def thubaninit_contents(thubandir):
578        """Return the contents of the the thubaninit file as a list of lines.
579    
580        The parameter thubandir is the parent directory where the Thuban/
581        package or the empty string if the thubaninit file itself will be
582        located in that direcory as well.
583        """
584        contents = thubaninit_contents_start
585        if thubandir:
586            thubandir = repr(thubandir)
587            contents += thubaninit_contents_thubaninitdir % locals()
588        contents += thubaninit_contents_otherdirs
589        return contents.split("\n")
590    
591    
592  class ThubanInstall(install):  class ThubanInstall(install):
593    
# Line 569  class ThubanInstall(install): Line 615  class ThubanInstall(install):
615                           ("init-module-dir=", None,                           ("init-module-dir=", None,
616                            "Directory in which to create the init module."                            "Directory in which to create the init module."
617                            " Defaults to Python's site-packages directory."),                            " Defaults to Python's site-packages directory."),
                           
618                           ])                           ])
619    
620      boolean_options = install.boolean_options[:]      boolean_options = install.boolean_options[:]
# Line 634  class ThubanInstall(install): Line 679  class ThubanInstall(install):
679                  src, dest = item                  src, dest = item
680              else:              else:
681                  src = dest = item                  src = dest = item
682              self.copy_file(convert_path(src),              self.copy_file(convert_path(src),
683                             os.path.join(self.root, convert_path(dest)))                             os.path.join(self.root, convert_path(dest)))
684    
685          if os.name == "posix" and self.do_symlink:          if os.name == "posix" and self.do_symlink:
# Line 654  class ThubanInstall(install): Line 699  class ThubanInstall(install):
699              initfilename = self.thuban_init_filename()              initfilename = self.thuban_init_filename()
700              if self.root:              if self.root:
701                  initfilename = change_root(self.root, initfilename)                  initfilename = change_root(self.root, initfilename)
702              contents = thubaninit_contents % {              contents = thubaninit_contents(self.install_lib_orig)
                 "thubandir": repr(self.install_lib_orig)  
                 }  
703              self.mkpath(os.path.dirname(initfilename))              self.mkpath(os.path.dirname(initfilename))
704              self.execute(write_file, (initfilename, split(contents, "\n")),              self.execute(write_file, (initfilename, contents),
705                           "Create %s" % initfilename)                           "Create %s" % initfilename)
706    
707      def link_file(self, src, dest):      def link_file(self, src, dest):
# Line 718  bdist_rpm_install_script = ''' Line 761  bdist_rpm_install_script = '''
761     --prefix=%(prefix)s     --prefix=%(prefix)s
762  '''  '''
763    
764        
765  class thuban_bdist_rpm(bdist_rpm):  class thuban_bdist_rpm(bdist_rpm):
766    
767      """Thuban specific RPM distribution command"""      """Thuban specific RPM distribution command"""
# Line 852  class bdist_inno(Command): Line 895  class bdist_inno(Command):
895          self.execute(write_file, (iss_file, self.generate_iss()),          self.execute(write_file, (iss_file, self.generate_iss()),
896                       "Create Inno Setup script file %s" % iss_file)                       "Create Inno Setup script file %s" % iss_file)
897    
898          # and invoke          # and invoke
899          if self.run_inno:          if self.run_inno:
900              self.spawn(["iscc", iss_file])              self.spawn(["iscc", iss_file])
901    
# Line 918  class bdist_inno(Command): Line 961  class bdist_inno(Command):
961              line = 'Name: "{group}\\%s"; Filename: "%s";' \              line = 'Name: "{group}\\%s"; Filename: "%s";' \
962                     % (icon.title, icon.install_name)                     % (icon.title, icon.install_name)
963              iss.append(line)              iss.append(line)
964                
965          return iss          return iss
966    
967    
# Line 934  class InnoIconItem: Line 977  class InnoIconItem:
977          else:          else:
978              self.install_name = filename              self.install_name = filename
979    
980                
981  class thuban_bdist_inno(bdist_inno):  class thuban_bdist_inno(bdist_inno):
982    
983      """Thuban specific Inno Setup stuff"""      """Thuban specific Inno Setup stuff"""
# Line 950  class thuban_bdist_inno(bdist_inno): Line 993  class thuban_bdist_inno(bdist_inno):
993          # that we can generate the iss-file even on Linux          # that we can generate the iss-file even on Linux
994          install_options["do_symlink"] = 0          install_options["do_symlink"] = 0
995          bdist_inno.run(self, install_options)          bdist_inno.run(self, install_options)
996        
997                
998  #  #
999  #   Run the script  #   Run the script
1000  #  #
# Line 962  Thuban is a viewer for geographic data w Line 1005  Thuban is a viewer for geographic data w
1005  """  """
1006    
1007  setup(name = "Thuban",  setup(name = "Thuban",
1008        version = "0.1.3cvs",        version = "0.1.3",
1009        description = "Geographic data viewer",        description = "Geographic data viewer",
1010        long_description = long_description,        long_description = long_description,
1011        licence = "GPL",        licence = "GPL",

Legend:
Removed from v.212  
changed lines
  Added in v.515

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26