/[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 202 by bh, Mon Jul 8 10:50:39 2002 UTC revision 203 by bh, Mon Jul 8 15:04:57 2002 UTC
# Line 48  if os.name == "posix": Line 48  if os.name == "posix":
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
# Line 594  class ThubanInstall(install): Line 597  class ThubanInstall(install):
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}
# Line 601  cp extensions/pyshapelib/{COPYING,COPYIN Line 607  cp extensions/pyshapelib/{COPYING,COPYIN
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    

Legend:
Removed from v.202  
changed lines
  Added in v.203

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26