Changeset 7489


Ignore:
Timestamp:
Sep 7, 2009, 2:18:26 PM (11 years ago)
Author:
ole
Message:

Updated create_distribution.py to generate NSI windows installer files.
Still need to source dependencies and viewer from SourceForge?

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/test_all.py

    r7471 r7489  
    1616os.chdir('pymetis')
    1717print 'Changing to', os.getcwd()
    18 execfile('test_all.py')
     18#execfile('test_all.py')
    1919
    2020os.chdir('..')
  • create_distribution.py

    r7406 r7489  
    2323from os import sep, system
    2424from os.path import join
     25import os
    2526from tempfile import mktemp
    2627from sys import platform, stdout
     
    5253print 'Creating ANUGA revision %s' %revision
    5354
    54 distro_filename = 'anuga-%s.tgz' %revision
     55anuga_release_name = 'anuga-%s' % revision
     56distro_filename = '%s.tgz' % anuga_release_name
    5557
    5658#-----------------------------------
     
    6062#-----------------------------------
    6163release_area = '~/anuga_releases'
    62 s = 'mkdir %s' %release_area
     64s = 'mkdir %s' % release_area
    6365try:
    6466    print s   
     
    6870
    6971
    70 release_dir = release_area + '/anuga_release_%s' %revision
    71 s = 'mkdir %s' %release_dir
     72   
     73release_dir = release_area + '/%s' % anuga_release_name
     74s = 'mkdir %s' % release_dir
    7275try:
    7376    print s   
     
    8083#-----------------------------------------------------
    8184distro_dir = mktemp()
    82 s = 'mkdir %s' %distro_dir
     85s = 'mkdir %s' % distro_dir
    8386print s   
    8487system(s)
     
    9295   
    9396    destination = join(distro_dir, dirmap[source])
    94     s = 'svn export -r %d --quiet %s %s' %(svn_revision,
    95                                            source,
    96                                            destination)
     97   
     98    s = 'svn export -r %d --quiet %s %s' % (svn_revision,
     99                                            source,
     100                                            destination)
    97101
    98102    print s
    99103    system(s)
    100104
    101 
    102 
    103 #-----------------------------
    104 # Get validation_files as well
    105 #-----------------------------
    106 #s = 'mkdir %s/anuga_validation' %distro_dir
    107 #system(s)
    108 #
    109 #s = 'svn export -r %d --quiet anuga_validation/okushiri_2005 %s/anuga_validation/okushiri'\
    110 #    %(svn_revision, distro_dir)
    111 #print s
    112 #system(s)
    113 
    114 #s = 'svn export -r %d --quiet anuga_validation/solitary_waves %s/anuga_validation/solitary_waves'\
    115 #    %(svn_revision, distro_dir)
    116 #print s
    117 #syst
    118 
    119 #s = 'svn export -r %d --quiet anuga_validation/automated_validation_tests %s/anuga_validation/automated_validation_tests'\
    120 #    %(svn_revision, distro_dir)
    121 #print s
    122 #system(s)
    123 
    124 # FIXME: Other validations in here as they appear!
    125 
    126 
    127 #---------------------------
    128 # Get demos from user manual
    129 #---------------------------
    130 #s = 'svn export -r %d --quiet anuga_core/documentation/user_manual/demos %s/anuga_demos'\
    131 #    %(svn_revision, distro_dir)
    132 #print s
    133 #system(s)
    134105
    135106
     
    152123# Zip everything up
    153124#------------------
    154 s = 'cd %s;tar cvfz %s *' %(distro_dir, distro_filename)
     125s = 'cd %s;tar cvfz %s *' % (distro_dir, distro_filename)
    155126print s
    156127system(s)
     
    159130# Move distro to release area
    160131#----------------------------
    161 s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir)
     132s = '/bin/mv %s/*.tgz %s' % (distro_dir, release_dir)
    162133print s
    163134system(s)
     
    166137# Clean up
    167138#---------
    168 s = '/bin/rm -rf %s/*' %(distro_dir)
    169 print s
    170 system(s)
    171 
    172 
    173 #-----------------------------
    174 # Copy and rename anuga_viewer
    175 #-----------------------------
    176 #s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s/anuga_viewer-%s.tgz' %(distro_dir, revision)
    177 #print s
    178 #system(s)
    179 
    180 #----------------------------
    181 # Move viewer to release area
    182 #----------------------------
    183 #s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir)
    184 #print s
    185 #system(s)
    186 
     139s = '/bin/rm -rf %s/*' % (distro_dir)
     140print s
     141system(s)
     142
     143
     144#----------------------------------------------
     145# Generate Windows installer
     146#----------------------------------------------
     147
     148root = os.getcwd()
     149from installation_files.windows.installer import create_config
     150
     151os.chdir('installation_files/windows')
     152
     153# Create ANUGA dir for NSI installer
     154try:
     155    os.mkdir('files/%s' % anuga_release_name)   
     156except:
     157    pass
     158
     159
     160# and unpack ANUGA into it
     161s = 'cd files/%s; tar xvfz %s/%s' % (anuga_release_name,
     162                                     release_dir,
     163                                     distro_filename)
     164print s
     165system(s)
     166
     167
     168# Must be replaced by local folder to where SourceForge version is downloaded
     169anuga_viewer_folder = 'anuga_viewer-1.0beta_7163'
     170python = 'python-2.5.4.msi'
     171numpy = 'Numeric-23.8.2.win32-py2.5.exe'
     172scientific_python = 'ScientificPython-2.7.8.win32-py2.5.exe'
     173netcdf_folder = 'net-cdf-3.6.1-win32'
     174mingw = 'MinGW-5.1.4.exe'
     175
     176# Generate NSI file
     177create_config(revision,
     178              'https://datamining.anu.edu.au/anuga',
     179              anuga_release_name,
     180              anuga_viewer_folder,
     181              python,
     182              numpy,
     183              scientific_python,
     184              netcdf_folder,
     185              mingw)
     186
     187             
     188# Package up files necessary to compile the installer on Windows and
     189# move to release area
     190
     191try:
     192    # Cleanup in case there was something left from a previous attempt
     193    s = 'cd %s; /bin/rm -rf windows_installer' % release_dir
     194    print s
     195    system(s)
     196except:
     197    pass   
     198   
     199# Create subdirectories for windows installer
     200s = 'cd %s; mkdir windows_installer; mkdir windows_installer/files'\
     201    % release_dir
     202print s
     203system(s)
     204
     205
     206# Copy installion scrips and imagery across
     207s = 'cp *.bmp *.nsh *.nsi *.ico %s/windows_installer' % release_dir
     208print s
     209system(s)
     210
     211# Copy actual files used by Windows installer across
     212s = 'cd files; cp -r %s %s/windows_installer/files' % (anuga_release_name,
     213                                                       release_dir)
     214print s
     215system(s)                                                       
     216
     217# Come back to starting directory
     218os.chdir(root)
     219                                                     
     220# Grab license file from anuga_core and copy to installer
     221s = 'cp anuga_core/source/anuga/LICENSE.txt %s/windows_installer/files'\
     222    % release_dir                                                       
     223print s
     224os.system(s)
     225
     226print 'NSI installer created'
    187227
    188228
     
    233273# Copy release to various destinations
    234274#-------------------------------------
     275# FIXME (Ole): I don't think this is the way any more
     276# due to changes at SourceForge.
     277
    235278answer = raw_input('Do you want to upload this to sourceforge? Y/N [Y]')
    236279if answer.lower() != 'n':
Note: See TracChangeset for help on using the changeset viewer.