Update of /cvsroot/freevo/freevo
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9779

Modified Files:
        setup.py 
Log Message:
add runtime installation support

Index: setup.py
===================================================================
RCS file: /cvsroot/freevo/freevo/setup.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** setup.py    21 Nov 2003 11:53:56 -0000      1.13
--- setup.py    10 Jun 2004 11:05:41 -0000      1.14
***************
*** 14,17 ****
--- 14,18 ----
  import version
  from util.distribution import setup, Extension, check_libs, docbook_finder
+ from distutils import core
  
  
***************
*** 22,25 ****
--- 23,100 ----
  
  
+ class Runtime(core.Command):
+ 
+     description     = "download and install runtime"
+     user_options    = []
+     boolean_options = []
+     help_options    = []
+     negative_opt    = {}
+ 
+     def initialize_options (self):
+         pass
+     
+     def finalize_options (self):
+         pass
+ 
+     def download(self, package):
+         """
+         download a package from sourceforge
+         """
+         url  = 'http://osdn.dl.sourceforge.net/sourceforge/' + package
+         file = package[package.rfind('/')+1:]
+         full = os.path.join(os.environ['HOME'], '.freevo/dist', file)
+         if not os.path.isfile(full):
+             print 'Downloading %s' % file
+             os.system('wget %s -O %s' % (url, full))
+         if not os.path.isfile(full):
+             print
+             print 'Failed to download %s' % file
+             print
+             print 'Please download %s from http://www.sf.net/projects/%s' % \
+                   (file, package[:package.find('/')])
+             print 'and store it as %s' % full
+             print
+             sys.exit(0)
+         return full
+ 
+ 
+     def mmpython_install(self, result, dirname, names):
+         """
+         install mmpython into the runtime
+         """
+         for n in names:
+             source = os.path.join(dirname, n)
+             if dirname.find('/') > 0:
+                 destdir = dirname[dirname.find('/')+1:]
+             else:
+                 destdir = ''
+             dest   = os.path.join('runtime/lib/python2.3/site-packages',
+                                   'mmpython', destdir, n)
+             if os.path.isdir(source) and not os.path.isdir(dest):
+                 os.mkdir(dest)
+             if n.endswith('.py') or n == 'mminfo':
+                 if n == 'dvdinfo.py':
+                     # runtime contains a bad hack version of dvdinfo
+                     # the normal one doesn't work
+                     continue
+                 os.system('mv "%s" "%s"' % (source, dest))
+         
+     def run (self):
+         """
+         download and install the runtime + current mmpython
+         """
+         mmpython = self.download('mmpython/mmpython-%s.tar.gz' % version.mmpython)
+         runtime  = self.download('freevo/freevo-runtime-%s.tar.gz' % version.runtime)
+         print 'Removing runtime directory'
+         os.system('rm -rf runtime')
+         print 'Unpacking runtime'
+         os.system('tar -zxf %s' % runtime)
+         print 'Unpacking mmpython'
+         os.system('tar -zxf %s' % mmpython)
+         print 'Installing mmpython into runtime'
+         os.path.walk('mmpython-%s' % version.mmpython, self.mmpython_install, None)
+         os.system('rm -rf mmpython-%s' % version.mmpython)
+ 
+     
  # check if everything is in place
  if (not os.path.isdir('./Docs/installation/html')) and \
***************
*** 59,62 ****
         i18n         = 'freevo',
         scripts      = scripts,
!        data_files   = data_files
         )
--- 134,138 ----
         i18n         = 'freevo',
         scripts      = scripts,
!        data_files   = data_files,
!        cmdclass     = { 'runtime': Runtime }
         )



-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to