/[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 19 by bh, Tue Sep 4 15:11:27 2001 UTC revision 532 by jonathan, Fri Mar 14 11:31:24 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001 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 18  __version__ = "$Revision$" Line 18  __version__ = "$Revision$"
18  import os  import os
19  from types import TupleType  from types import TupleType
20  from distutils.core import setup, Extension, Command  from distutils.core import setup, Extension, Command
21  from distutils.command.install import install  from distutils.command.install import install, INSTALL_SCHEMES, subst_vars
22  from distutils.command.build_py import build_py  from distutils.command.build_py import build_py
23  from distutils.command.bdist_rpm import bdist_rpm  from distutils.command.bdist_rpm import bdist_rpm
24  from distutils.file_util import write_file  from distutils.file_util import write_file
25    from distutils.filelist import FileList
26  from distutils.util import convert_path, change_root  from distutils.util import convert_path, change_root
27    
28    from distutils import archive_util, dir_util
29  import distutils  import distutils
30    
31  from string import split  from string import split
# Line 41  if os.name == "posix": Line 43  if os.name == "posix":
43      proj4_lib = "proj"      proj4_lib = "proj"
44    
45    
46      # You shpuldn't have to modify anything below here      # You shouldn't have to modify anything below here
47      ###################################################################      ###################################################################
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        # Whether to create the thubaninit module. You can override this
58        # value on the commandline with the --create-init-module to the
59        # install command.
60        create_init_module = 1
61    
62      # On POSIX-systems we run wxgtk-config to determine the C++-compiler      # On POSIX-systems we run wxgtk-config to determine the C++-compiler
63      # flags      # flags
64      wx_config_script = "wx-config"      wx_config_script = "wx-config"
# Line 70  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 84  elif os.name == "nt": Line 96  elif os.name == "nt":
96      # the command line with the install command's --prefix option      # the command line with the install command's --prefix option
97      prefix = r"install"      prefix = r"install"
98    
99        # Whether to create the thubaninit module. You can override this
100        # value on the commandline with the --create-init-module to the
101        # install command. By default we don't create it under NT because we
102        # most often run install only as part of bdist_inno where we can't
103        # really create because it needs information only known at install
104        # time.
105        create_init_module = 0
106    
107      # There doesn't seem to be an easy way to get at the wx compiler      # There doesn't seem to be an easy way to get at the wx compiler
108      # flags, so we define them here. These flags work for us with      # flags, so we define them here. These flags work for us with
109      # wxPython 2.3.1. They may have to be modified for other versions.      # wxPython 2.3.1. They may have to be modified for other versions.
# Line 109  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 198  py_modules = [] Line 219  py_modules = []
219  #  #
220    
221  extensions.append(Extension("Lib.wxproj",  extensions.append(Extension("Lib.wxproj",
222                              [ext_dir + "/thuban/wxproj.cpp",                              [ext_dir + "/thuban/wxproj.cpp"],
223                               shp_dir + "/shpopen.c"],                              include_dirs = ([shp_dir, proj4_incdir,
224                              include_dirs = [shp_dir, proj4_incdir] +wx_incdirs,                                               ext_dir + "/pyshapelib/"]
225                                                + wx_incdirs),
226                              define_macros = wx_defs,                              define_macros = wx_defs,
227                              library_dirs = [proj4_libdir] + wx_libdirs,                              library_dirs = [proj4_libdir] + wx_libdirs,
228                              libraries = [proj4_lib] + wx_libs))                              libraries = [proj4_lib] + wx_libs))
# Line 211  extensions.append(Extension("Lib.wxproj" Line 233  extensions.append(Extension("Lib.wxproj"
233    
234  extensions.append(Extension("Lib.shapelibc",  extensions.append(Extension("Lib.shapelibc",
235                              [ext_dir + "/pyshapelib/shapelib_wrap.c",                              [ext_dir + "/pyshapelib/shapelib_wrap.c",
236                               shp_dir + "/shpopen.c"],                               shp_dir + "/shpopen.c",
237                                 shp_dir + "/shptree.c"],
238                                include_dirs = [shp_dir]))
239    extensions.append(Extension("Lib.shptree",
240                                [ext_dir + "/pyshapelib/shptreemodule.c"],
241                              include_dirs = [shp_dir]))                              include_dirs = [shp_dir]))
242  extensions.append(Extension("Lib.dbflibc",  extensions.append(Extension("Lib.dbflibc",
243                              [ext_dir + "/pyshapelib/dbflib_wrap.c",                              [ext_dir + "/pyshapelib/dbflib_wrap.c",
# Line 250  data_files.append((dir, bitmaps)) Line 276  data_files.append((dir, bitmaps))
276  #  #
277  # So far distutils are only meant to distribute python extensions, not  # So far distutils are only meant to distribute python extensions, not
278  # complete applications, so we have to redefine a few commands  # complete applications, so we have to redefine a few commands
279    #
280    
281    
282    # Much of the data_dist command is directly copied from the distutils'
283    # sdist command
284    class data_dist(Command):
285    
286        description = "create a data distribution (tarball, zip file, etc.)"
287    
288        user_options = [
289            ('formats=', None,
290             "formats for source distribution (comma-separated list)"),
291            ('keep-temp', 'k',
292             "keep the distribution tree around after creating " +
293             "archive file(s)"),
294            ('dist-dir=', 'd',
295             "directory to put the source distribution archive(s) in "
296             "[default: dist]"),
297            ]
298    
299        boolean_options = ['keep-temp']
300    
301        def initialize_options (self):
302            self.formats = None
303            self.keep_temp = 0
304            self.dist_dir = None
305    
306        def finalize_options (self):
307            self.ensure_string_list('formats')
308            if self.formats is None:
309                self.formats = ["zip"]
310            bad_format = archive_util.check_archive_formats(self.formats)
311            if bad_format:
312                raise DistutilsOptionError, \
313                      "unknown archive format '%s'" % bad_format
314    
315            if self.dist_dir is None:
316                self.dist_dir = "dist"
317    
318    
319        def run(self):
320            # 'filelist' contains the list of files that will make up the
321            # manifest
322            self.filelist = FileList()
323            
324            # Do whatever it takes to get the list of files to process.
325            # File list is accumulated in 'self.filelist'.
326            self.get_file_list()
327    
328            # Otherwise, go ahead and create the source distribution tarball,
329            # or zipfile, or whatever.
330            self.make_distribution()
331    
332        def get_file_list(self):
333            """Figure out the list of files to include in the data
334            distribution, and put it in 'self.filelist'.
335            """
336            self.filelist.findall("Data")
337            self.filelist.include_pattern("*", anchor = 0)
338            self.filelist.exclude_pattern(r'/(RCS|CVS)/.*', is_regex=1)
339            self.filelist.sort()
340            self.filelist.remove_duplicates()
341    
342        def make_release_tree(self, base_dir, files):
343            """Create the directory tree that will become the source
344            distribution archive.  All directories implied by the filenames in
345            'files' are created under 'base_dir', and then we hard link or copy
346            (if hard linking is unavailable) those files into place.
347            Essentially, this duplicates the developer's source tree, but in a
348            directory named after the distribution, containing only the files
349            to be distributed.
350            """
351            # Create all the directories under 'base_dir' necessary to
352            # put 'files' there; the 'mkpath()' is just so we don't die
353            # if the manifest happens to be empty.
354            self.mkpath(base_dir)
355            dir_util.create_tree(base_dir, files,
356                                 verbose=self.verbose, dry_run=self.dry_run)
357    
358            # And walk over the list of files, either making a hard link (if
359            # os.link exists) to each one that doesn't already exist in its
360            # corresponding location under 'base_dir', or copying each file
361            # that's out-of-date in 'base_dir'.  (Usually, all files will be
362            # out-of-date, because by default we blow away 'base_dir' when
363            # we're done making the distribution archives.)
364        
365            if hasattr(os, 'link'):        # can make hard links on this system
366                link = 'hard'
367                msg = "making hard links in %s..." % base_dir
368            else:                           # nope, have to copy
369                link = None
370                msg = "copying files to %s..." % base_dir
371    
372            if not files:
373                self.warn("no files to distribute -- empty manifest?")
374            else:
375                self.announce(msg)
376            for file in files:
377                if not os.path.isfile(file):
378                    self.warn("'%s' not a regular file -- skipping" % file)
379                else:
380                    dest = os.path.join(base_dir, file)
381                    self.copy_file(file, dest, link=link)
382    
383    
384        def make_distribution (self):
385            """Create the source distribution(s).  First, we create the release
386            tree with 'make_release_tree()'; then, we create all required
387            archive files (according to 'self.formats') from the release tree.
388            Finally, we clean up by blowing away the release tree (unless
389            'self.keep_temp' is true).  The list of archive files created is
390            stored so it can be retrieved later by 'get_archive_files()'.
391            """
392            # Don't warn about missing meta-data here -- should be (and is!)
393            # done elsewhere.
394            base_dir = "Thuban-data-" + self.distribution.get_version()
395            base_name = os.path.join(self.dist_dir, base_dir)
396    
397            self.make_release_tree(base_dir, self.filelist.files)
398            archive_files = []              # remember names of files we create
399            for fmt in self.formats:
400                file = self.make_archive(base_name, fmt, base_dir=base_dir)
401                archive_files.append(file)
402    
403            self.archive_files = archive_files
404    
405            if not self.keep_temp:
406                dir_util.remove_tree(base_dir, self.verbose, self.dry_run)
407    
408    
409    
# Line 262  class InstallLocal(Command): Line 416  class InstallLocal(Command):
416      """      """
417    
418      description =\      description =\
419          "Create some symlink so you can run thubanfrom the source directory"          "Create some symlinks so you can run thuban from the source directory"
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 286  class InstallLocal(Command): Line 452  class InstallLocal(Command):
452          # now do the work. Simply link or copy the Lib dir          # now do the work. Simply link or copy the Lib dir
453          libdir = os.path.join(self.build_dir, "Lib")          libdir = os.path.join(self.build_dir, "Lib")
454          if os.name == "posix":          if os.name == "posix":
455              # on posix, just lilnk the Lib dir              # on posix, just link the Lib dir
456              self.link_dir(libdir, "Lib")              self.link_dir(libdir, "Lib")
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 317  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 368  class thuban_build_py(build_py): Line 547  class thuban_build_py(build_py):
547          return modules          return modules
548    
549    
550    thubaninit_contents_start = """
551    # This module was automatically generated by Thuban's install script
552    '''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
554    afterwards.
555    
556    Usage:
557    
558    import thubaninit
559    import Thuban
560    '''
561    import sys, os
562    """
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
569    # modules
570    import Thuban
571    thubandir = os.path.join(Thuban.__path__[0], '..')
572    dir = os.path.join(thubandir, "Lib")
573    if os.path.isdir(dir):
574        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 384  class ThubanInstall(install): Line 604  class ThubanInstall(install):
604                          "(default on posix systems and only relevant there)"),                          "(default on posix systems and only relevant there)"),
605    
606                           ("extra-files", None,                           ("extra-files", None,
607                            "List of filenames or (src, dest) pairs describing "                            "List of filenames or (src, dest) pairs describing"
608                            " extra files to install "                            " extra files to install "
609                            "(can only be set from witin setup.py"),                            "(can only be set from witin setup.py"),
610    
611                             ("create-init-module=", None,
612                              "If true, create a module in the site-packages"
613                              " directory that tweaks sys.path to let you easily"
614                              " import thuban modules from outside of thuban."),
615                             ("init-module-dir=", None,
616                              "Directory in which to create the init module."
617                              " Defaults to Python's site-packages directory."),
618                           ])                           ])
619    
620      boolean_options = install.boolean_options[:]      boolean_options = install.boolean_options[:]
621      boolean_options.append("do-symlink")      boolean_options.append("do-symlink")
622        boolean_options.append("create-init-module")
623    
624      def initialize_options(self):      def initialize_options(self):
625          self.do_symlink = None          self.do_symlink = None
626          self.extra_files = []          self.extra_files = []
627    
628            # initialize the create_init_module flag from the global
629            # determined at runtime
630            self.create_init_module = create_init_module
631            self.init_module_dir = None
632          install.initialize_options(self)          install.initialize_options(self)
633    
634      def finalize_options(self):      def finalize_options(self):
# Line 404  class ThubanInstall(install): Line 638  class ThubanInstall(install):
638              else:              else:
639                  self.do_symlink = 0                  self.do_symlink = 0
640          install.finalize_options(self)          install.finalize_options(self)
641            self.expand_with_pure_python_dirs(["init_module_dir"])
642    
643        def expand_with_pure_python_dirs(self, attrs):
644            """Expand the attributes with default values of base and platbase"""
645            # it seems that the values for "prefix" and "exec_prefix" in
646            # self.config_vars are the corresponding values used by the
647            # python interpreter, so we just assign these to "base" and
648            # "platbase".
649            config_vars = self.config_vars.copy()
650            config_vars["base"] = self.config_vars["prefix"]
651            config_vars["platbase"] = self.config_vars["exec_prefix"]
652            for attr in attrs:
653                val = getattr(self, attr)
654                if val is not None:
655                    if os.name == 'posix':
656                        val = os.path.expanduser(val)
657                    val = subst_vars(val, config_vars)
658                    setattr(self, attr, val)
659    
660        def select_scheme(self, scheme):
661            """Extend the inherited method to set init_module_dir"""
662            install.select_scheme(self, scheme)
663            # only set init_module_dir if it wasn't set by the user
664            if self.init_module_dir is None:
665                self.init_module_dir = INSTALL_SCHEMES[scheme]['purelib']
666    
667        def convert_paths(self, *args):
668            """Extend the inherited method so that we can remember some filename
669            """
670            # remember the installation directory before its root gets
671            # changed
672            self.install_lib_orig = self.install_lib
673            apply(install.convert_paths, (self,) + args)
674    
675      def run(self):      def run(self):
676          install.run(self)          install.run(self)
# Line 412  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 427  class ThubanInstall(install): Line 694  class ThubanInstall(install):
694              self.mkpath(bindir)              self.mkpath(bindir)
695              self.link_file(scriptfile, binfile)              self.link_file(scriptfile, binfile)
696    
697            if self.create_init_module:
698                # create the init module
699                initfilename = self.thuban_init_filename()
700                if self.root:
701                    initfilename = change_root(self.root, initfilename)
702                contents = thubaninit_contents(self.install_lib_orig)
703                self.mkpath(os.path.dirname(initfilename))
704                self.execute(write_file, (initfilename, contents),
705                             "Create %s" % initfilename)
706    
707      def link_file(self, src, dest):      def link_file(self, src, dest):
708          """Create a symbolic link dest pointing to src.          """Create a symbolic link dest pointing to src.
709    
# Line 441  class ThubanInstall(install): Line 718  class ThubanInstall(install):
718          if not os.path.exists(dest):          if not os.path.exists(dest):
719              os.symlink(src, dest)              os.symlink(src, dest)
720    
721        def thuban_init_filename(self):
722            """Return the filename for the init-module"""
723            # Since we override the normal install dirs to point to our own
724            # prefix we have to reach into installed
725            return self.init_module_dir + "/thubaninit.py"
726    
727      def get_outputs (self):      def get_outputs (self):
728          outputs = install.get_outputs(self)          outputs = install.get_outputs(self)
# Line 456  class ThubanInstall(install): Line 738  class ThubanInstall(install):
738                  bindir = change_root(self.root, bindir)                  bindir = change_root(self.root, bindir)
739              binfile = os.path.join(bindir, "thuban")              binfile = os.path.join(bindir, "thuban")
740              outputs.append(binfile)              outputs.append(binfile)
741            if self.create_init_module:
742                initfilename = self.thuban_init_filename()
743                if self.root:
744                    initfilename = change_root(self.root, initfilename)
745                outputs.append(initfilename)
746          return outputs          return outputs
747    
748    
749    # scripts to override some of the commands put into the spec-file by the
750    # bdist_rpm command.
751    
752  bdist_rpm_prep_script = '''  bdist_rpm_prep_script = '''
753  %setup  %setup
754  cp extensions/pyshapelib/{README,README.pyshapelib}  cp extensions/pyshapelib/{README,README.pyshapelib}
# Line 466  cp extensions/pyshapelib/{COPYING,COPYIN Line 756  cp extensions/pyshapelib/{COPYING,COPYIN
756  cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection}  cp extensions/pyprojection/{LICENSE,LICENSE.pyprojection}
757  '''  '''
758    
759    bdist_rpm_install_script = '''
760    %(python)s setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES \
761       --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"""
768    
769      def run(self):      user_options = bdist_rpm.user_options[:]
770          # create the prep script for the spec-file      user_options.extend([("prefix=", None, "Install prefix for the RPM"),
771                             ])
772    
773        def initialize_options(self):
774            # per default, RPMs are installed in /usr
775            self.prefix = "/usr/"
776    
777            # create the scripts we want to override. We actually fill them
778            # with contents later because some values we put into those
779            # scripts such as the python interpreter to use are only known
780            # then.
781            open("bdist_rpm_prep", "w").close()
782            open("bdist_rpm_install", "w").close()
783            bdist_rpm.initialize_options(self)
784    
785        def _make_spec_file(self):
786            # create the scripts for the spec-file. Now we know the python
787            # interpreter to use.
788          open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script)          open("bdist_rpm_prep", "w").write(bdist_rpm_prep_script)
789            install = bdist_rpm_install_script % {"python": self.python,
790                                                  "prefix": self.prefix}
791            open("bdist_rpm_install", "w").write(install)
792    
793          bdist_rpm.run(self)          #
794            return bdist_rpm._make_spec_file(self)
795    
796    
797  class bdist_inno(Command):  class bdist_inno(Command):
# Line 570  class bdist_inno(Command): Line 885  class bdist_inno(Command):
885          if os.name != 'nt':          if os.name != 'nt':
886              # Must force install to use the 'nt' scheme;              # Must force install to use the 'nt' scheme;
887              install.select_scheme('nt')              install.select_scheme('nt')
             # don't make a symlink because we're simulating windows, so  
             # that we can generate the iss-file even on Linux  
             install.do_symlink = 0  
888    
889          self.announce("installing to %s" % self.bdist_dir)          self.announce("installing to %s" % self.bdist_dir)
890          install.ensure_finalized()          install.ensure_finalized()
# Line 583  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 649  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    
968  class InnoIconItem:  class InnoIconItem:
969    
970      """Describe one item for he start menu for the Inno Setup installer"""      """Describe one item for the start menu for the Inno Setup installer"""
971    
972      def __init__(self, filename, title, install_name = None):      def __init__(self, filename, title, install_name = None):
973          self.filename = filename          self.filename = filename
# Line 677  class thuban_bdist_inno(bdist_inno): Line 989  class thuban_bdist_inno(bdist_inno):
989              "warn_dir": 0,              "warn_dir": 0,
990              "extra_files": ["COPYING", "Lib/proj.dll"],              "extra_files": ["COPYING", "Lib/proj.dll"],
991              }              }
992            # don't make a symlink because we're simulating windows, so
993            # that we can generate the iss-file even on Linux
994            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 690  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.0.3",        version = "0.2.0",
1009        description = "Geographic data viewer",        description = "Geographic data viewer",
1010        long_description = long_description,        long_description = long_description,
1011        licence = "GPL",        licence = "GPL",
1012        author = "Intevation GmbH",        author = "Intevation GmbH",
1013        author_email = "[email protected]",        author_email = "[email protected]",
1014        url = "ftp:intevation.de/",        url = "http://thuban.intevation.de/",
1015    
1016        scripts = ["thuban.py"],        scripts = ["thuban.py"],
1017        packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI"],        packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI"],
# Line 710  setup(name = "Thuban", Line 1025  setup(name = "Thuban",
1025                   {"prefix": prefix,                   {"prefix": prefix,
1026                    # make sure both libs and scripts are installed in the                    # make sure both libs and scripts are installed in the
1027                    # same directory.                    # same directory.
1028                    "install_lib": "$base/thuban",                    "install_lib": "$base/lib/thuban",
1029                    "install_scripts": "$base/thuban",                    "install_scripts": "$base/lib/thuban",
1030                    "install_data": "$base/thuban",                    "install_data": "$base/lib/thuban",
1031    
1032                    # Don't print warning messages about the lib dir not                    # Don't print warning messages about the lib dir not
1033                    # being on Python's path. The libraries are Thuban                    # being on Python's path. The libraries are Thuban
# Line 731  setup(name = "Thuban", Line 1046  setup(name = "Thuban",
1046                    "install_local": InstallLocal,                    "install_local": InstallLocal,
1047                    "install": ThubanInstall,                    "install": ThubanInstall,
1048                    "bdist_rpm": thuban_bdist_rpm,                    "bdist_rpm": thuban_bdist_rpm,
1049                    "bdist_inno": thuban_bdist_inno                    "bdist_inno": thuban_bdist_inno,
1050                      "data_dist": data_dist
1051                    })                    })
1052    
1053    

Legend:
Removed from v.19  
changed lines
  Added in v.532

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26