source: Swollen/distros/windistro.py @ 96

Last change on this file since 96 was 96, checked in by darran, 19 years ago
  • code release
File size: 2.9 KB
Line 
1#
2# Python script to create a windows distribution,
3# currently a gzipped tar file.  I had a
4# fancy installer but (i) it required a separate
5# 23Mb download for the .NET framework and (ii) it
6# probably wouldn't have run at GA anyway.
7#
8
9
10# convenience function for building file list
11import os
12def DLLFiles( directory, list ):
13    return [ os.sep.join( [directory, name+'.dll'] ) for name in list ]
14
15
16#---- NAME ------------------------------------------------------------
17
18from datetime import datetime
19distro = datetime.today().strftime('distro%Y%m%d.tgz')
20
21
22 
23#---- LOCAL DEPENDENCIES ----------------------------------------------
24
25# local directories
26localrootdir = '..'
27localbindir = localrootdir + os.sep + 'bin'
28
29# local files
30localdlls = DLLFiles( localbindir, ['swwreader'] )
31localfiles = [ os.sep.join( [localbindir, f] ) for f in \
32               ['swollen.exe',     # the executable
33                'sky_small.jpg',   # sky texture
34                'envmap.jpg',      # water surface environment map
35                'bedslope.jpg']]   # surface texture
36
37# sample sww file for testing
38localtestdir = localrootdir + os.sep + 'tests'
39localfiles.append(localtestdir + os.sep + 'cylinders2.sww')
40localfiles.append(localtestdir + os.sep + 'cylinders2.tif')
41
42
43#----- NETCDF DEPENDENCIES --------------------------------------------
44
45# netcdf directory
46netcdfdir = os.environ['NETCDF_DIR']
47
48# netcdf DLL
49netcdfdll = os.sep.join( [netcdfdir, 'bin', 'netcdf.dll'] )
50
51
52
53#----- OSG DEPENDENCIES -----------------------------------------------
54
55# OSG directories
56osgrootdir = os.environ['OSG_ROOT']
57osgdir = os.sep.join( [osgrootdir,'OpenSceneGraph','bin'] )
58producerdir = os.sep.join( [osgrootdir,'Producer','bin'] )
59openthreadsdir = os.sep.join( [osgrootdir,'OpenThreads','bin','win32'] )
60
61# OSG/Producer/OpenThreads DLLs
62producerdll = DLLFiles( producerdir, ['Producer'] )
63openthreadsdll = DLLFiles( openthreadsdir, ['OpenThreadsWin32'] )
64osgdlls = DLLFiles( osgdir, ['osg', 'osgdb', 'osgGA', 'osgProducer', 'osgText', 'osgUtil'] )
65
66# supported database loaders (osgdb_XXX.dll)
67osgimgformats = [ 'osgdb_'+f for f in ['jpeg', 'png', 'tiff', 'freetype'] ]
68osgimgdlls = DLLFiles( osgdir, osgimgformats )
69
70# third party dlls
71thirdpartydir = os.sep.join( [osgrootdir,'3rdparty','bin'] )
72thirdpartydlls = DLLFiles( thirdpartydir, ['gdal12', 'glut32', 'msvcp71', 'msvcr71'] )
73
74# All OSG DLLs
75osgdlls = producerdll + openthreadsdll + osgdlls + osgimgdlls + thirdpartydlls
76
77
78
79#------ ARCHIVE -------------------------------------------------------
80
81# all files above
82files = localfiles + localdlls + osgdlls + [netcdfdll]
83files.sort()
84
85import tarfile
86import os.path
87print "creating tgz archive %s" % distro
88t = tarfile.open( distro, 'w:gz' )
89for f in files:
90    basename = os.path.basename(f)
91    print "\tadding %s" % basename
92    t.add( f, basename )
93t.close()
94
95cmd = "scp %s dee900@anusf.anu.edu.au:public_html/Projects/Swollen/Releases" % distro
96os.system(cmd)
Note: See TracBrowser for help on using the repository browser.