/[gnue]/gnue-common/setup.py
ViewVC logotype

Diff of /gnue-common/setup.py

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

revision 1.75 by reinhard, Sat Sep 27 23:23:01 2003 UTC revision 1.76 by reinhard, Mon Sep 29 12:23:55 2003 UTC
# Line 78  def set_params (params): Line 78  def set_params (params):
78                               'prune translations/CVS'],                               'prune translations/CVS'],
79                   preserve_path = 1),                   preserve_path = 1),
80       Data_Files (base_dir = 'install_data',       Data_Files (base_dir = 'install_data',
                  copy_to = 'share/man/man1',  
                  template = ['recursive-include man *.1'],  
                  preserve_path = 0),  
      Data_Files (base_dir = 'install_data',  
81                   copy_to = 'share/doc/gnue-common',                   copy_to = 'share/doc/gnue-common',
82                   template = ['recursive-include doc *',                   template = ['recursive-include doc *',
83                               'prune doc/CVS',                               'prune doc/CVS',
# Line 96  def set_params (params): Line 92  def set_params (params):
92  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
93    
94  def build_files ():  def build_files ():
   # First check if we have everything installed we need to build the  
   # distribution  
   
   # is gsscvs available (to build man pages)?  
   if not os.path.isfile ("scripts/gsscvs"):  
     print "Could not find file 'scripts/gsscvs'.  Please run 'setup-cvs.py'."  
     sys.exit (1)  
   
   # ---------------------------------------------------------------------------  
95    
96    print "building man page"    # nothing to do here
97    if os.system ("mkdir -p man && cd man " \    pass
                  + " && ../scripts/gsscvs --generate-man-page") != 0:  
     sys.exit (1)  
98    
99  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
100  # Check dependencies for installation:  # Check dependencies for installation:
# Line 132  from distutils.sysconfig import get_pyth Line 117  from distutils.sysconfig import get_pyth
117  import distutils.command.sdist  import distutils.command.sdist
118  import distutils.command.build  import distutils.command.build
119  import distutils.command.install  import distutils.command.install
120    import distutils.command.install_scripts
121  from setupext import Data_Files, install_Data_Files  from setupext import Data_Files, install_Data_Files
122    
123  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
# Line 180  try: Line 166  try:
166  except ValueError:  except ValueError:
167    pass    pass
168    
169  if (sys.platform != "win32" and not have_prefix and "install" in sys.argv) \  if (os.name == "posix" and not have_prefix and "install" in sys.argv) \
170     or have_setupcfg:     or have_setupcfg:
171    os.system ("cp %s setup.cfg" % setupcfg)    os.system ("cp %s setup.cfg" % setupcfg)
172  else:  else:
# Line 370  class install (distutils.command.install Line 356  class install (distutils.command.install
356    def run (self):    def run (self):
357      check_dependencies ()      check_dependencies ()
358    
359      self._generate_scripts ()      # self._generate_scripts ()
360    
361      self._write_gnue_pth ()      self._write_gnue_pth ()
362    
# Line 378  class install (distutils.command.install Line 364  class install (distutils.command.install
364    
365      distutils.command.install.install.run (self)      distutils.command.install.install.run (self)
366    
367    # =============================================================================
368    # install_scripts: Generate man pages after installing
369    # =============================================================================
370    
371    class install_scripts (distutils.command.install_scripts.install_scripts):
372    
373      def run (self):
374        distutils.command.install_scripts.install_scripts.run (self)
375    
376        if os.name == "posix":
377          instcmd = self.get_finalized_command ("install")
378          man1dir = os.path.join (instcmd.install_data, "share", "man", "man1")
379          if not os.path.isdir (man1dir):
380            os.makedirs (man1dir)
381          olddir = os.getcwd ()
382          os.chdir (man1dir)
383          for script in self.get_outputs ():
384            print "building man page for %s" % os.path.basename (script)
385            os.system ("PYTHONPATH=" + instcmd.install_lib + " " + \
386                       script + " --generate-man-page")
387          os.chdir (olddir)
388    
389  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
390  # Get all packages in a directory  # Get all packages in a directory
391  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
# Line 434  setup (name             = setup_params [ Line 442  setup (name             = setup_params [
442         data_files       = setup_params ["data_files"],         data_files       = setup_params ["data_files"],
443    
444         # Override certain command classes with our own ones         # Override certain command classes with our own ones
445         cmdclass = {"build": build,         cmdclass = {"sdist": sdist,
446                       "build": build,
447                     "install": install,                     "install": install,
448                       "install_scripts": install_scripts,
449                     "install_data": install_Data_Files})                     "install_data": install_Data_Files})
450    
451  # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26