source: Swollen/distros/windistro.py @ 35

Last change on this file since 35 was 6, checked in by darran, 20 years ago

new import

File size: 2.7 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, XXX+'.dll'] ) for XXX 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, XXX] ) for XXX 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                'laminar.sww']]    # sample sww file for testing
37
38
39
40#----- NETCDF DEPENDENCIES --------------------------------------------
41
42# netcdf directory
43netcdfdir = os.environ['NETCDF_DIR']
44
45# netcdf DLL
46netcdfdll = os.sep.join( [netcdfdir, 'bin', 'netcdf.dll'] )
47
48
49
50#----- OSG DEPENDENCIES -----------------------------------------------
51
52# OSG directories
53osgrootdir = os.environ['OSG_ROOT']
54osgdir = os.sep.join( [osgrootdir,'OpenSceneGraph','bin'] )
55producerdir = os.sep.join( [osgrootdir,'Producer','bin'] )
56openthreadsdir = os.sep.join( [osgrootdir,'OpenThreads','bin','win32'] )
57
58# OSG/Producer/OpenThreads DLLs
59producerdll = DLLFiles( producerdir, ['Producer'] )
60openthreadsdll = DLLFiles( openthreadsdir, ['OpenThreadsWin32'] )
61osgdlls = DLLFiles( osgdir, ['osg', 'osgdb', 'osgGA', 'osgProducer', 'osgText', 'osgUtil'] )
62
63# supported database loaders (osgdb_XXX.dll)
64osgimgformats = [ 'osgdb_'+XXX for XXX in ['jpeg', 'png', 'tiff', 'freetype'] ]
65osgimgdlls = DLLFiles( osgdir, osgimgformats )
66
67# All OSG DLLs
68osgdlls = producerdll + openthreadsdll + osgdlls + osgimgdlls
69
70
71
72#------ VISUAL STUDIO DEPENDENCIES ------------------------------------
73
74# Visual Studio runtime directory
75vsdir = os.environ['SYSTEMROOT'] + os.sep + 'system32'
76
77# DLLs
78vsdlls = DLLFiles( vsdir, ['msvcp71', 'msvcr71'] )
79
80
81
82#------ ARCHIVE -------------------------------------------------------
83
84# all files above
85files = localfiles + localdlls + osgdlls + [netcdfdll] + vsdlls
86files.sort()
87
88import tarfile
89import os.path
90print "creating tgz archive %s" % distro
91t = tarfile.open( distro, 'w:gz' )
92for f in files:
93    basename = os.path.basename(f)
94    print "\tadding %s" % basename
95    t.add( f, basename )
96t.close()
97
Note: See TracBrowser for help on using the repository browser.