[pygccxml-commit] SF.net SVN: pygccxml: [1025] installers
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-04-29 19:15:16
|
Revision: 1025 http://svn.sourceforge.net/pygccxml/?rev=1025&view=rev Author: roman_yakovenko Date: 2007-04-29 12:15:15 -0700 (Sun, 29 Apr 2007) Log Message: ----------- porting installer to linux Modified Paths: -------------- installers/config.py installers/install_gccxml.py Modified: installers/config.py =================================================================== --- installers/config.py 2007-04-29 07:58:36 UTC (rev 1024) +++ installers/config.py 2007-04-29 19:15:15 UTC (rev 1025) @@ -9,7 +9,11 @@ class setup_builder: #final\destination directory for ditributable package - dist_dir = os.path.split( sys.argv[0] )[0] + dist_dir = os.path.join( + os.path.split( + os.path.abspath( + os.path.dirname( sys.modules[__name__].__file__) ) )[0] + , 'gccxml_%s_installer' % sys.platform ) unzip = None gccxml_cvs_dir = None @@ -18,7 +22,11 @@ if 'win32' == sys.platform: gccxml_cvs_dir = r'D:\dev\gccxml_cvs\gccxml' unzip = 'unzip -d $target_dir $archive' #command line to run in order to unzip the file + else: #linux + gccxml_cvs_dir = r'/home/roman/gccxml-cvs' + unzip = 'tar -xvvzf $archive' #command line to run in order to unzip the file + class archives: cmake = 'cmake-%s.tar' % sys.platform gccxml = 'gccxml-cvs.tar' Modified: installers/install_gccxml.py =================================================================== --- installers/install_gccxml.py 2007-04-29 07:58:36 UTC (rev 1024) +++ installers/install_gccxml.py 2007-04-29 19:15:15 UTC (rev 1025) @@ -107,67 +107,73 @@ def create_dist_package(): working_dir = os.path.abspath( os.path.dirname(sys.modules[__name__].__file__) ) - try: - gccxml_cvs_dir_name = os.path.splitext( config.archives.gccxml )[0] - gccxml_cvs_dir_path = os.path.join( working_dir, gccxml_cvs_dir_name ) - utils.logger.info( 'coping gccxml directory ' ) - shutil.copytree( config.setup_builder.gccxml_cvs_dir, gccxml_cvs_dir_path ) - utils.logger.info( 'coping gccxml directory - done' ) - #TODO: remove cvs files from the directory - utils.logger.info( 'archiving gccxml "%s" directory ' % gccxml_cvs_dir_path ) - gccxml_tar_file = os.path.join( working_dir, config.archives.gccxml ) - tar = tarfile.open( gccxml_tar_file, "w" ) - tar.add( gccxml_cvs_dir_path, gccxml_cvs_dir_name ) - tar.close() - utils.logger.info( 'archiving gccxml "%s" directory - done' % gccxml_cvs_dir_path ) + + gccxml_cvs_dir_name = os.path.splitext( config.archives.gccxml )[0] + gccxml_cvs_dir_path = os.path.join( working_dir, gccxml_cvs_dir_name ) + utils.logger.info( 'coping gccxml directory ' ) + shutil.copytree( config.setup_builder.gccxml_cvs_dir, gccxml_cvs_dir_path ) + utils.logger.info( 'coping gccxml directory - done' ) + #TODO: remove cvs files from the directory + utils.logger.info( 'archiving gccxml "%s" directory ' % gccxml_cvs_dir_path ) + gccxml_tar_file = os.path.join( working_dir, config.archives.gccxml ) + tar = tarfile.open( gccxml_tar_file, "w" ) + tar.add( gccxml_cvs_dir_path, gccxml_cvs_dir_name ) + tar.close() + utils.logger.info( 'archiving gccxml "%s" directory - done' % gccxml_cvs_dir_path ) + + if 'win32' == sys.platform: + cmake_zip_file = os.path.join( working_dir, config.setup_builder.cmake_windows ) + + utils.logger.info( 'downloading "%s"' % config.setup_builder.cmake_windows ) + urllib.urlretrieve( 'http://www.cmake.org/files/v2.4/' + config.setup_builder.cmake_windows + , cmake_zip_file ) + utils.logger.info( 'downloading "%s" - done' % config.setup_builder.cmake_windows ) + + cmake_dir = os.path.splitext( cmake_zip_file )[0] + + utils.logger.info( 'unzipping "%s" file' % config.setup_builder.cmake_windows ) + unzip_cmd = string.Template( config.setup_builder.unzip ) + utils.execute( unzip_cmd.substitute( archive='"%s"' % cmake_zip_file + , target_dir='"%s"' % working_dir ) ) + utils.logger.info( 'unzipping "%s" file - done' % config.setup_builder.cmake_windows ) + - if 'win32' == sys.platform: - cmake_zip_file = os.path.join( working_dir, config.setup_builder.cmake_windows ) + else: #linux + cmake_zip_file = os.path.join( working_dir, config.setup_builder.cmake_linux ) - utils.logger.info( 'downloading "%s"' % config.setup_builder.cmake_windows ) - urllib.urlretrieve( 'http://www.cmake.org/files/v2.4/' + config.setup_builder.cmake_windows - , cmake_zip_file ) - utils.logger.info( 'downloading "%s" - done' % config.setup_builder.cmake_windows ) + utils.logger.info( 'downloading "%s"' % config.setup_builder.cmake_linux ) + urllib.urlretrieve( 'http://www.cmake.org/files/v2.4/' + config.setup_builder.cmake_linux + , cmake_zip_file ) + utils.logger.info( 'downloading "%s" - done' % config.setup_builder.cmake_linux ) - cmake_dir = os.path.splitext( cmake_zip_file )[0] - - utils.logger.info( 'unzipping "%s" file' % config.setup_builder.cmake_windows ) - unzip_cmd = string.Template( config.setup_builder.unzip ) - utils.execute( unzip_cmd.substitute( archive='"%s"' % cmake_zip_file - , target_dir='"%s"' % working_dir ) ) - utils.logger.info( 'unzipping "%s" file - done' % config.setup_builder.cmake_windows ) + cmake_dir = os.path.splitext( cmake_zip_file )[0] + if 'win32' != sys.platform: + cmake_dir = os.path.splitext( cmake_dir )[0] #remove xx.tar.gz + + utils.logger.info( 'unzipping "%s" file' % config.setup_builder.cmake_linux ) + unzip_cmd = string.Template( config.setup_builder.unzip ) + utils.execute( unzip_cmd.substitute( archive='"%s"' % cmake_zip_file + , target_dir='"%s"' % working_dir ) ) + utils.logger.info( 'unzipping "%s" file - done' % config.setup_builder.cmake_linux ) - cmake_archive_dir = os.path.join( working_dir, os.path.splitext( config.archives.cmake )[0] ) + cmake_archive_dir = os.path.join( working_dir, os.path.splitext( config.archives.cmake )[0] ) + if 'win32' != sys.platform: + cmake_archive_dir = os.path.splitext( cmake_archive_dir )[0] #remove xx.tar.gz - shutil.move( cmake_dir, cmake_archive_dir ) - utils.logger.info( 'archiving cmake "%s" directory ' % cmake_archive_dir ) - cmake_tar_file = os.path.join( working_dir, config.archives.cmake ) - tar = tarfile.open( cmake_tar_file, "w" ) - tar.add( cmake_archive_dir, os.path.splitext( config.archives.cmake )[0] ) - tar.close() - utils.logger.info( 'archiving cmake "%s" directory - done' % cmake_archive_dir ) - - #clean after yourself - os.remove( cmake_zip_file ) - utils.rmtree_safe( cmake_dir ) - utils.rmtree_safe( cmake_archive_dir ) - utils.rmtree_safe( gccxml_cvs_dir_path ) - - else: #linux - cmake_linux = os.path.join( working_dir, config.setup_builder.cmake_linux ) - if not os.path.exists( cmake_linux ): - utils.logger.info( 'downloading "%s"' % config.setup_builder.cmake_linux ) - urllib.urlretrieve( 'http://www.cmake.org/files/v2.4/' + config.setup_builder.cmake_linux - , cmake_linux ) - utils.logger.info( 'downloading "%s" - done' % config.setup_builder.cmake_linux ) - utils.logger.info( 'unzipping "%s" file' % config.setup_builder.cmake_linux ) - unzip_cmd = string.Template( config.setup_builder.unzip ) - utils.execute( unzip_cmd.substitute( archive='"%s"' % cmake_linux - , target_dir='"%s"' % working_dir ) ) - utils.logger.info( 'unzipping "%s" file - done' % config.setup_builder.cmake_linux ) - finally: - pass - + shutil.move( cmake_dir, cmake_archive_dir ) + utils.logger.info( 'archiving cmake "%s" directory ' % cmake_archive_dir ) + cmake_tar_file = os.path.join( working_dir, config.archives.cmake ) + tar = tarfile.open( cmake_tar_file, "w" ) + tar.add( cmake_archive_dir, os.path.splitext( config.archives.cmake )[0] ) + tar.close() + utils.logger.info( 'archiving cmake "%s" directory - done' % cmake_archive_dir ) + + #clean after yourself + os.remove( cmake_zip_file ) + utils.rmtree_safe( cmake_dir ) + utils.rmtree_safe( cmake_archive_dir ) + utils.rmtree_safe( gccxml_cvs_dir_path ) + #create final zip file package_dir = os.path.join( os.path.split( working_dir )[0] , 'gccxml_%s_installer' % sys.platform ) @@ -178,5 +184,8 @@ os.remove( gccxml_tar_file ) if __name__ == "__main__": - install() - #create_dist_package() + if 2 == len( sys.argv ) and sys.argv[1] == '--build-setup': + create_dist_package() + else: + install() + # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |